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

Side by Side Diff: third_party/closure_compiler/compile.py

Issue 2052973002: Get Polymer externs from closure/github (instead of Polymer/bower) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@roll-closure
Patch Set: revert binaries so we can try this thang Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/closure_compiler/compile2.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Runs Closure compiler on JavaScript files to check for errors and produce 6 """Runs Closure compiler on JavaScript files to check for errors and produce
7 minified output.""" 7 minified output."""
8 8
9 import argparse 9 import argparse
10 import os 10 import os
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 340
341 parser.set_defaults(single_file=True, strict=False) 341 parser.set_defaults(single_file=True, strict=False)
342 opts = parser.parse_args() 342 opts = parser.parse_args()
343 343
344 depends = opts.depends or [] 344 depends = opts.depends or []
345 # TODO(devlin): should we run normpath() on this first and/or do this for 345 # TODO(devlin): should we run normpath() on this first and/or do this for
346 # depends as well? 346 # depends as well?
347 externs = set(opts.externs or []) 347 externs = set(opts.externs or [])
348 sources = set(opts.sources) 348 sources = set(opts.sources)
349 349
350 polymer_externs = os.path.join(os.path.dirname(_CURRENT_DIR), 'polymer', 350 externs.add(os.path.join(_CURRENT_DIR, "externs", "polymer-1.0.js"))
351 'v1_0', 'components-chromium',
352 'polymer-externs', 'polymer.externs.js')
353 externs.add(polymer_externs)
354 351
355 checker = Checker(verbose=opts.verbose, strict=opts.strict) 352 checker = Checker(verbose=opts.verbose, strict=opts.strict)
356 if opts.single_file: 353 if opts.single_file:
357 for source in sources: 354 for source in sources:
358 # Normalize source to the current directory. 355 # Normalize source to the current directory.
359 source = os.path.normpath(os.path.join(os.getcwd(), source)) 356 source = os.path.normpath(os.path.join(os.getcwd(), source))
360 depends, externs = build.inputs.resolve_recursive_dependencies( 357 depends, externs = build.inputs.resolve_recursive_dependencies(
361 source, depends, externs) 358 source, depends, externs)
362 359
363 found_errors, _ = checker.check(source, out_file=opts.out_file, 360 found_errors, _ = checker.check(source, out_file=opts.out_file,
364 depends=depends, externs=externs, 361 depends=depends, externs=externs,
365 closure_args=opts.closure_args) 362 closure_args=opts.closure_args)
366 if found_errors: 363 if found_errors:
367 sys.exit(1) 364 sys.exit(1)
368 else: 365 else:
369 found_errors, stderr = checker.check_multiple( 366 found_errors, stderr = checker.check_multiple(
370 sources, 367 sources,
371 out_file=opts.out_file, 368 out_file=opts.out_file,
372 externs=externs, 369 externs=externs,
373 closure_args=opts.closure_args) 370 closure_args=opts.closure_args)
374 if found_errors: 371 if found_errors:
375 print stderr 372 print stderr
376 sys.exit(1) 373 sys.exit(1)
OLDNEW
« no previous file with comments | « no previous file | third_party/closure_compiler/compile2.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698