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

Unified Diff: build/android/gyp/util/proguard_util.py

Issue 2626323002: Android: Write all proguard flags to out.jar.flags file (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | build/config/android/internal_rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/util/proguard_util.py
diff --git a/build/android/gyp/util/proguard_util.py b/build/android/gyp/util/proguard_util.py
index 547a7646f72dc905fc1b5851c4dd9347019b1b0c..1977833c130c84f44f3869a6e201ea9c39f29284 100644
--- a/build/android/gyp/util/proguard_util.py
+++ b/build/android/gyp/util/proguard_util.py
@@ -151,6 +151,19 @@ class ProguardCmdBuilder(object):
inputs += [self._tested_apk_info_path]
return inputs
+ def _WriteFlagsFile(self, out):
+ # Quite useful for auditing proguard flags.
+ for config in self._configs:
+ out.write('#' * 80 + '\n')
+ out.write(config + '\n')
+ out.write('#' * 80 + '\n')
+ with open(config) as config_file:
+ out.write(config_file.read().rstrip())
+ out.write('\n\n')
+ out.write('#' * 80 + '\n')
+ out.write('Command-line\n')
+ out.write('#' * 80 + '\n')
+ out.write(' '.join(self._cmd) + '\n')
def CheckOutput(self):
self.build()
@@ -160,6 +173,10 @@ class ProguardCmdBuilder(object):
open(self._outjar + '.seeds', 'w').close()
open(self._outjar + '.usage', 'w').close()
open(self._outjar + '.mapping', 'w').close()
+
+ with open(self._outjar + '.flags', 'w') as out:
+ self._WriteFlagsFile(out)
+
# Warning: and Error: are sent to stderr, but messages and Note: are sent
# to stdout.
stdout_filter = None
« no previous file with comments | « no previous file | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698