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

Unified Diff: third_party/closure_compiler/build/inputs.py

Issue 1152583011: Refactor compile_js.gypi to support script_args and closure_args (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yet another rebase Created 5 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 | « remoting/webapp/build_template.gni ('k') | third_party/closure_compiler/closure_args.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/closure_compiler/build/inputs.py
diff --git a/third_party/closure_compiler/build/inputs.py b/third_party/closure_compiler/build/inputs.py
index 05ad818fa9c74d152c6cf25d3f8e87067520d776..a403c25bbb425c36e2be3c2859aaefadb33812e1 100755
--- a/third_party/closure_compiler/build/inputs.py
+++ b/third_party/closure_compiler/build/inputs.py
@@ -72,21 +72,25 @@ def resolve_recursive_dependencies(source, input_depends, depends_externs):
def GetInputs(args):
parser = argparse.ArgumentParser()
- parser.add_argument("source", nargs=1)
+ parser.add_argument("sources", nargs=argparse.ONE_OR_MORE)
parser.add_argument("-d", "--depends", nargs=argparse.ZERO_OR_MORE,
default=[])
parser.add_argument("-e", "--externs", nargs=argparse.ZERO_OR_MORE,
default=[])
opts = parser.parse_args(args)
- source = opts.source[0]
- depends, externs = resolve_recursive_dependencies(
- os.path.normpath(os.path.join(os.getcwd(), source)),
- opts.depends,
- opts.externs)
+ # TODO(twellington): resolve dependencies for multiple sources.
+ if len(opts.sources) == 1:
+ depends, externs = resolve_recursive_dependencies(
+ os.path.normpath(os.path.join(os.getcwd(), opts.sources[0])),
+ opts.depends,
+ opts.externs)
+ else:
+ depends = opts.depends
+ externs = set(opts.externs)
files = set()
- for file in {source} | set(depends) | externs:
+ for file in set(opts.sources) | set(depends) | externs:
files.add(file)
files.update(processor.Processor(file).included_files)
« no previous file with comments | « remoting/webapp/build_template.gni ('k') | third_party/closure_compiler/closure_args.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698