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

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

Issue 1356873003: CallAndRecordIfStale(): Add knownledge of output_files, depfiles, stamp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@incremental-script-dep
Patch Set: add assert and remove map() 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/dex.py ('k') | build/android/gyp/proguard.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/javac.py
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py
index 97ecb7bdc5d2f0e259dd5fb97f2b779ea6f1d70b..c95dc98eaa7c670703a79303ea22b11eaae8b524 100755
--- a/build/android/gyp/javac.py
+++ b/build/android/gyp/javac.py
@@ -12,7 +12,6 @@ import sys
import textwrap
from util import build_utils
-from util import md5_check
import jar
@@ -212,16 +211,20 @@ def main(argv):
compile_classpath = (
[ijar_re.sub('.interface.jar', p) for p in runtime_classpath])
- javac_args = [
+ javac_cmd = ['javac']
+ if options.use_errorprone_path:
+ javac_cmd = [options.use_errorprone_path] + ERRORPRONE_OPTIONS
+
+ javac_cmd.extend((
'-g',
# Chromium only allows UTF8 source files. Being explicit avoids
# javac pulling a default encoding from the user's environment.
'-encoding', 'UTF-8',
'-classpath', ':'.join(compile_classpath),
- ]
+ ))
if options.bootclasspath:
- javac_args.extend([
+ javac_cmd.extend([
'-bootclasspath', ':'.join(options.bootclasspath),
'-source', '1.7',
'-target', '1.7',
@@ -229,16 +232,12 @@ def main(argv):
if options.chromium_code:
# TODO(aurimas): re-enable '-Xlint:deprecation' checks once they are fixed.
- javac_args.extend(['-Xlint:unchecked'])
+ javac_cmd.extend(['-Xlint:unchecked'])
else:
# XDignore.symbol.file makes javac compile against rt.jar instead of
# ct.sym. This means that using a java internal package/class will not
# trigger a compile warning or error.
- javac_args.extend(['-XDignore.symbol.file'])
-
- javac_cmd = ['javac']
- if options.use_errorprone_path:
- javac_cmd = [options.use_errorprone_path] + ERRORPRONE_OPTIONS
+ javac_cmd.extend(['-XDignore.symbol.file'])
# Compute the list of paths that when changed, we need to rebuild.
input_paths = options.bootclasspath + options.java_srcjars + java_files
@@ -249,9 +248,8 @@ def main(argv):
input_paths.append(path + '.TOC')
else:
input_paths.append(path)
- python_deps = build_utils.GetPythonDependencies()
- def OnStaleMd5():
+ def on_stale_md5():
with build_utils.TempDir() as temp_dir:
if options.java_srcjars:
java_dir = os.path.join(temp_dir, 'java')
@@ -267,7 +265,7 @@ def main(argv):
if java_files:
# Don't include the output directory in the initial set of args since it
# being in a temp dir makes it unstable (breaks md5 stamping).
- cmd = javac_cmd + javac_args + ['-d', classes_dir] + java_files
+ cmd = javac_cmd + ['-d', classes_dir] + java_files
build_utils.CheckOutput(
cmd,
@@ -288,25 +286,16 @@ def main(argv):
options.jar_path,
manifest_file=manifest_file)
- if options.stamp:
- build_utils.Touch(options.stamp)
-
- if options.depfile:
- build_utils.WriteDepfile(options.depfile, input_paths + python_deps)
-
# List python deps in input_strings rather than input_paths since the contents
# of them does not change what gets written to the depsfile.
- md5_check.CallAndRecordIfStale(
- OnStaleMd5,
- record_path=options.jar_path + '.javac.md5.stamp',
+ build_utils.CallAndWriteDepfileIfStale(
+ on_stale_md5,
+ options,
input_paths=input_paths,
- input_strings=javac_cmd + javac_args + python_deps,
- force=not os.path.exists(options.jar_path))
-
+ input_strings=javac_cmd,
+ output_paths=[options.jar_path])
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
-
-
« no previous file with comments | « build/android/gyp/dex.py ('k') | build/android/gyp/proguard.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698