Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6181)

Unified Diff: chrome/browser/resources/chromeos/chromevox/tools/jsbundler.py

Issue 342153003: Add ChromeVox braille_util_test to chromevox_tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/tools/generate_test_messages.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/tools/jsbundler.py
diff --git a/chrome/browser/resources/chromeos/chromevox/tools/jsbundler.py b/chrome/browser/resources/chromeos/chromevox/tools/jsbundler.py
index 3bfbec22f6d316d7c7d836a26b31a28ab879f9b8..f2c15c7ab6af01399a1303c1e4ec346e2313de29 100755
--- a/chrome/browser/resources/chromeos/chromevox/tools/jsbundler.py
+++ b/chrome/browser/resources/chromeos/chromevox/tools/jsbundler.py
@@ -144,7 +144,7 @@ class PathRewriter():
def ReadSources(roots=[], source_files=[], need_source_text=False,
- path_rewriter=PathRewriter()):
+ path_rewriter=PathRewriter(), exclude=[]):
'''Reads all source specified on the command line, including sources
included by --root options.
'''
@@ -161,6 +161,8 @@ def ReadSources(roots=[], source_files=[], need_source_text=False,
sources = {}
for root in roots:
for name in treescan.ScanTreeForJsFiles(root):
+ if any((r.search(name) for r in exclude)):
+ continue
EnsureSourceLoaded(name, sources)
for path in source_files:
if need_source_text:
@@ -301,6 +303,10 @@ def CreateOptionParser():
default='list', metavar='MODE',
help=("Otput mode. One of 'list', 'html', 'bundle', " +
"'compressed_bundle' or 'copy'."))
+ parser.add_option('-x', '--exclude', action='append', default=[],
+ help=('Exclude files whose full path contains a match for '
+ 'the given regular expression. Does not apply to '
+ 'filenames given as arguments.'))
return parser
@@ -310,8 +316,9 @@ def main():
Die('At least one top-level source file must be specified.')
will_output_source_text = options.mode in ('bundle', 'compressed_bundle')
path_rewriter = PathRewriter(options.prefix_map)
+ exclude = [re.compile(r) for r in options.exclude]
sources = ReadSources(options.roots, args, will_output_source_text,
- path_rewriter)
+ path_rewriter, exclude)
if will_output_source_text:
_MarkAsCompiled(sources)
bundle = Bundle()
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/tools/generate_test_messages.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698