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

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

Issue 13432002: Add input content checking to some build scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
Index: build/android/gyp/jar.py
diff --git a/build/android/jar.py b/build/android/gyp/jar.py
similarity index 73%
rename from build/android/jar.py
rename to build/android/gyp/jar.py
index 9120a7902054ef5dd06ef4b5dbd2f28cde801af5..c8931c969a3999eb637ad9879ec06bb7b3c186bf 100755
--- a/build/android/jar.py
+++ b/build/android/gyp/jar.py
@@ -9,6 +9,11 @@ import optparse
import os
import sys
+from util import md5_check
+
+BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..')
+sys.path.append(BUILD_ANDROID_DIR)
+
from pylib import build_utils
@@ -24,9 +29,18 @@ def DoJar(options):
# the command. Because of this, the command should be run in
# options.classes_dir so the .class file paths in the jar are correct.
jar_cwd = options.classes_dir
- class_files = [os.path.relpath(f, jar_cwd) for f in class_files]
- jar_cmd = ['jar', 'cf0', jar_path] + class_files
- build_utils.CheckCallDie(jar_cmd, cwd=jar_cwd)
+ class_files_rel = [os.path.relpath(f, jar_cwd) for f in class_files]
+ jar_cmd = ['jar', 'cf0', jar_path] + class_files_rel
+
+
+ md5_stamp = '%s.md5' % options.jar_path
+ md5_checker = md5_check.Md5Checker(
+ stamp=md5_stamp, inputs=class_files, command=jar_cmd)
+ if md5_checker.IsStale():
+ build_utils.CheckCallDie(jar_cmd, cwd=jar_cwd)
+ else:
+ build_utils.Touch(options.jar_path)
+ md5_checker.Write()
def main(argv):

Powered by Google App Engine
This is Rietveld 408576698