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

Unified Diff: build/android/gyp/jar.py

Issue 1361733002: Make javac invocations incremental when possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@apkbuilder
Patch Set: add flag and disable by default Created 5 years, 3 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 | « no previous file | build/android/gyp/javac.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/jar.py
diff --git a/build/android/gyp/jar.py b/build/android/gyp/jar.py
index 3c520ed55e28d95bef6eb5de6faa3f1684cd5c52..e060f6f1a9733fb19d03ea6da483abd931c3f58a 100755
--- a/build/android/gyp/jar.py
+++ b/build/android/gyp/jar.py
@@ -33,10 +33,10 @@ def Jar(class_files, classes_dir, jar_path, manifest_file=None):
build_utils.Touch(jar_path, fail_if_missing=True)
-def JarDirectory(classes_dir, excluded_classes, jar_path, manifest_file=None):
+def JarDirectory(classes_dir, jar_path, manifest_file=None, predicate=None):
class_files = build_utils.FindInDirectory(classes_dir, '*.class')
- class_files = [f for f in class_files
- if not build_utils.MatchesGlob(f, excluded_classes)]
+ if predicate:
+ class_files = [f for f in class_files if predicate(f)]
Jar(class_files, classes_dir, jar_path, manifest_file=manifest_file)
@@ -51,13 +51,12 @@ def main():
options, _ = parser.parse_args()
+ predicate = None
if options.excluded_classes:
excluded_classes = build_utils.ParseGypList(options.excluded_classes)
- else:
- excluded_classes = []
- JarDirectory(options.classes_dir,
- excluded_classes,
- options.jar_path)
+ predicate = lambda f: not build_utils.MatchesGlob(f, excluded_classes)
+
+ JarDirectory(options.classes_dir, options.jar_path, predicate=predicate)
if options.stamp:
build_utils.Touch(options.stamp)
« no previous file with comments | « no previous file | build/android/gyp/javac.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698