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

Unified Diff: build/android/gyp/util/build_utils.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 | « build/android/gyp/javac.py ('k') | build/android/gyp/util/md5_check.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/util/build_utils.py
diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py
index f95053f7d26c998fac868d43361cf91d760647a8..4922f9be74e841091b38f32942ef498efffee108 100644
--- a/build/android/gyp/util/build_utils.py
+++ b/build/android/gyp/util/build_utils.py
@@ -196,7 +196,8 @@ def CheckZipPath(name):
raise Exception('Absolute zip path: %s' % name)
-def ExtractAll(zip_path, path=None, no_clobber=True, pattern=None):
+def ExtractAll(zip_path, path=None, no_clobber=True, pattern=None,
+ predicate=None):
if path is None:
path = os.getcwd()
elif not os.path.exists(path):
@@ -209,6 +210,8 @@ def ExtractAll(zip_path, path=None, no_clobber=True, pattern=None):
if pattern is not None:
if not fnmatch.fnmatch(name, pattern):
continue
+ if predicate and not predicate(name):
+ continue
CheckZipPath(name)
if no_clobber:
output_path = os.path.join(path, name)
@@ -403,7 +406,8 @@ def ExpandFileArgs(args):
def CallAndWriteDepfileIfStale(function, options, record_path=None,
input_paths=None, input_strings=None,
- output_paths=None, force=False):
+ output_paths=None, force=False,
+ pass_changes=False):
"""Wraps md5_check.CallAndRecordIfStale() and also writes dep & stamp files.
Depfiles and stamp files are automatically added to output_paths when present
@@ -427,8 +431,9 @@ def CallAndWriteDepfileIfStale(function, options, record_path=None,
if stamp_file:
output_paths += [stamp_file]
- def on_stale_md5():
- function()
+ def on_stale_md5(changes):
+ args = (changes,) if pass_changes else ()
+ function(*args)
if python_deps is not None:
WriteDepfile(options.depfile, python_deps + input_paths)
if stamp_file:
@@ -440,5 +445,6 @@ def CallAndWriteDepfileIfStale(function, options, record_path=None,
input_paths=input_paths,
input_strings=input_strings,
output_paths=output_paths,
- force=force)
+ force=force,
+ pass_changes=True)
« no previous file with comments | « build/android/gyp/javac.py ('k') | build/android/gyp/util/md5_check.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698