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

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

Issue 2485663003: Fix a subtle proguard incremental build error (Closed)
Patch Set: slash to paren Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/proguard.py
diff --git a/build/android/gyp/proguard.py b/build/android/gyp/proguard.py
index 071f32438439df45f57c169c8d6dec3993cf7d3f..8cfa27b7da61b71e3a70151fdb62972600ee1b9c 100755
--- a/build/android/gyp/proguard.py
+++ b/build/android/gyp/proguard.py
@@ -66,6 +66,18 @@ def main(args):
args = build_utils.ExpandFileArgs(args)
options = _ParseOptions(args)
+ # Work around cases where we switch from a non-proguard setup
+ # to proguard. The output jar might exist and might be a hardlink
+ # to the input jar, so remove the output before doing anything
+ # in that case to avoid an incremental build failure.
+ try:
+ out_inode = os.stat(options.output_path).st_ino
+ except OSError:
+ out_inode = None
+ if (out_inode and
+ out_inode in (os.stat(injar).st_ino for injar in options.input_paths)):
+ os.unlink(options.output_path)
+
proguard = proguard_util.ProguardCmdBuilder(options.proguard_path)
proguard.injars(options.input_paths)
proguard.configs(options.proguard_configs)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698