From 167d13b4f61bb899eed5a19b5f6b117a05522f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 2 Jul 2014 08:15:50 +0200 Subject: [PATCH] Use closure-util's Closure lib for the check-requires target --- build.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.py b/build.py index 6d197aa730..6028de2761 100755 --- a/build.py +++ b/build.py @@ -408,19 +408,19 @@ def _strip_comments(lines): @target('build/check-requires-timestamp', SRC, EXAMPLES_SRC, SHADER_SRC, SPEC) def build_check_requires_timestamp(t): - from zipfile import ZipFile unused_count = 0 all_provides = set() - zf = ZipFile(PLOVR_JAR) - for zi in zf.infolist(): - if zi.filename.endswith('.js'): - if not zi.filename.startswith('closure/goog/'): + closure_lib_path = output('node', '-e', + 'process.stdout.write(require("closure-util").getLibraryPath())') + for filename in ifind(closure_lib_path): + if filename.endswith('.js'): + if not re.match(r'.*/closure/goog/', filename): continue # Skip goog.i18n because it contains so many modules that it causes # the generated regular expression to exceed Python's limits - if zi.filename.startswith('closure/goog/i18n/'): + if re.match(r'.*/closure/goog/i18n/', filename): continue - for line in zf.open(zi, 'rU'): + for line in open(filename, 'rU'): m = re.match(r'goog.provide\(\'(.*)\'\);', line) if m: all_provides.add(m.group(1))