diff options
author | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-16 17:05:20 +0000 |
---|---|---|
committer | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-16 17:05:20 +0000 |
commit | ba50fd8275458583684065943041fdbd96254713 (patch) | |
tree | be19ae14cd8a9a1d12b961f6c5fa33f9302ec438 /build/android/gyp/javac.py | |
parent | bfe06bc74b95f3c1ca8e41afcf9bed115b12679b (diff) | |
download | chromium_src-ba50fd8275458583684065943041fdbd96254713.zip chromium_src-ba50fd8275458583684065943041fdbd96254713.tar.gz chromium_src-ba50fd8275458583684065943041fdbd96254713.tar.bz2 |
[Android] Refactor md5_check + add tests
This adds a function md5_check.CallAndRecordIfStale that makes the
common (and currently only) use of Md5Checker much simpler (i.e just
call this function). All the users of md5_check are updated to use this
function, and everything else in md5_check is no longer part of the
public API.
Also, adds tests for the md5_check module. These are only run manually currently.
BUG=158821
Review URL: https://codereview.chromium.org/14263006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194377 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android/gyp/javac.py')
-rwxr-xr-x | build/android/gyp/javac.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py index cbd4293..c117004 100755 --- a/build/android/gyp/javac.py +++ b/build/android/gyp/javac.py @@ -52,12 +52,7 @@ def DoJavac(options): '-Xlint:deprecation', ] + 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(): + def Compile(): # 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 @@ -66,7 +61,14 @@ def DoJavac(options): build_utils.MakeDirectory(output_dir) suppress_output = not options.chromium_code build_utils.CheckCallDie(javac_cmd, suppress_output=suppress_output) - md5_checker.Write() + + record_path = '%s/javac.md5.stamp' % options.output_dir + md5_check.CallAndRecordIfStale( + Compile, + record_path=record_path, + input_paths=java_files + jar_inputs, + input_strings=javac_cmd) + def main(argv): parser = optparse.OptionParser() |