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

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

Issue 14203002: [Android] Create and use .TOC files for jars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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/jar_toc.py ('k') | build/java.gypi » ('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 8a62e5f994f51a9e2358583abe107c7144737edf..cbd42930258a24edb6f016847416c66415b97e18 100755
--- a/build/android/gyp/javac.py
+++ b/build/android/gyp/javac.py
@@ -10,6 +10,7 @@ import os
import sys
from util import build_utils
+from util import md5_check
def DoJavac(options):
@@ -31,17 +32,16 @@ def DoJavac(options):
# crash... Sorted order works, so use that.
# See https://code.google.com/p/guava-libraries/issues/detail?id=950
java_files.sort()
-
classpath = build_utils.ParseGypList(options.classpath)
- # Delete the classes directory. This ensures that all .class files in the
- # output are actually from the input .java files. For example, if a .java
- # file is deleted or an inner class is removed, the classes directory should
- # not contain the corresponding old .class file after running this action.
- build_utils.DeleteDirectory(output_dir)
- build_utils.MakeDirectory(output_dir)
+ jar_inputs = []
+ for path in classpath:
+ if os.path.exists(path + '.TOC'):
+ jar_inputs.append(path + '.TOC')
+ else:
+ jar_inputs.append(path)
- cmd = [
+ javac_cmd = [
'javac',
'-g',
'-source', '1.5',
@@ -50,10 +50,23 @@ def DoJavac(options):
'-d', output_dir,
'-Xlint:unchecked',
'-Xlint:deprecation',
- ]
-
- suppress_output = not options.chromium_code
- build_utils.CheckCallDie(cmd + java_files, suppress_output=suppress_output)
+ ] + java_files
+
+ md5_stamp = '%s/javac.md5' % options.output_dir
+ md5_checker = md5_check.Md5Checker(
+ stamp=md5_stamp,
+ inputs=java_files + jar_inputs,
+ command=javac_cmd)
+ if md5_checker.IsStale():
+ # Delete the classes directory. This ensures that all .class files in the
+ # output are actually from the input .java files. For example, if a .java
+ # file is deleted or an inner class is removed, the classes directory should
+ # not contain the corresponding old .class file after running this action.
+ build_utils.DeleteDirectory(output_dir)
+ build_utils.MakeDirectory(output_dir)
+ suppress_output = not options.chromium_code
+ build_utils.CheckCallDie(javac_cmd, suppress_output=suppress_output)
+ md5_checker.Write()
def main(argv):
parser = optparse.OptionParser()
« no previous file with comments | « build/android/gyp/jar_toc.py ('k') | build/java.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698