From 3615c1ee3b1ca796fac83e6255b1586936adaff3 Mon Sep 17 00:00:00 2001 From: agrieve Date: Thu, 24 Sep 2015 18:15:47 -0700 Subject: [PATCH] Make use of md5_check within finalize_apk.py This stops the _incremental.apk from being re-finalized over and over during normal development. BUG=533442 Review URL: https://codereview.chromium.org/1348533006 Cr-Original-Commit-Position: refs/heads/master@{#350732} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 1ed522607cd798f60c6120ed5f97b85e6a233f47 --- android/gyp/finalize_apk.py | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/android/gyp/finalize_apk.py b/android/gyp/finalize_apk.py index 0a8003508..a6a1040d3 100755 --- a/android/gyp/finalize_apk.py +++ b/android/gyp/finalize_apk.py @@ -65,7 +65,9 @@ def AlignApk(zipalign_path, unaligned_path, final_path): build_utils.CheckOutput(align_cmd) -def main(): +def main(args): + args = build_utils.ExpandFileArgs(args) + parser = optparse.OptionParser() build_utils.AddDepfileOption(parser) @@ -86,14 +88,27 @@ def main(): options, _ = parser.parse_args() - FinalizeApk(options) + input_paths = [ + options.unsigned_apk_path, + options.key_path, + ] - if options.depfile: - build_utils.WriteDepfile( - options.depfile, build_utils.GetPythonDependencies()) + if options.load_library_from_zip: + input_paths.append(options.rezip_apk_jar_path) - if options.stamp: - build_utils.Touch(options.stamp) + input_strings = [ + options.load_library_from_zip, + options.key_name, + options.key_passwd, + ] + + build_utils.CallAndWriteDepfileIfStale( + lambda: FinalizeApk(options), + options, + record_path=options.unsigned_apk_path + '.finalize.md5.stamp', + input_paths=input_paths, + input_strings=input_strings, + output_paths=[options.final_apk_path]) def FinalizeApk(options): @@ -129,4 +144,4 @@ def FinalizeApk(options): if __name__ == '__main__': - sys.exit(main()) + sys.exit(main(sys.argv[1:]))