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

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

Issue 2295363002: 🔔 Allow android_* targets to specify proguard flags for apks (Closed)
Patch Set: Created 4 years, 4 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 | « build/android/gyp/proguard.py ('k') | 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/write_build_config.py
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py
index 0298529775307cc20f7a2ee743c0e3903ecfad55..1843c7481b0086503f351fba3d1f58142a2fbb17 100755
--- a/build/android/gyp/write_build_config.py
+++ b/build/android/gyp/write_build_config.py
@@ -278,6 +278,8 @@ def main(argv):
'test apk).')
parser.add_option('--proguard-enabled', action='store_true',
help='Whether proguard is enabled for this apk.')
+ parser.add_option('--proguard-configs',
+ help='GYP-list of proguard flag files to use in final apk.')
Ian Wen 2016/09/01 01:31:55 Q: do we have plans to rename GYP-list to GN-list
agrieve 2016/09/01 14:07:08 We definitely should :)
parser.add_option('--proguard-info',
help='Path to the proguard .info output for this apk.')
parser.add_option('--has-alternative-locale-resource', action='store_true',
@@ -574,6 +576,11 @@ def main(argv):
deps_dex_files = [
p for p in deps_dex_files if not p in tested_apk_deps_dex_files]
+ if options.proguard_configs:
+ assert options.type == 'java_library'
+ deps_info['proguard_configs'] = (
+ build_utils.ParseGnList(options.proguard_configs))
+
if options.type == 'android_apk':
deps_info['proguard_enabled'] = options.proguard_enabled
deps_info['proguard_info'] = options.proguard_info
@@ -581,9 +588,12 @@ def main(argv):
proguard_config = config['proguard']
proguard_config['input_paths'] = [options.jar_path] + java_full_classpath
extra_jars = set()
+ lib_configs = set()
for c in all_library_deps:
extra_jars.update(c.get('extra_classpath_jars', ()))
+ lib_configs.update(c.get('proguard_configs', ()))
proguard_config['lib_paths'] = list(extra_jars)
+ proguard_config['lib_configs'] = list(lib_configs)
# Dependencies for the final dex file of an apk or a 'deps_dex'.
if options.type in ['android_apk', 'deps_dex']:
« no previous file with comments | « build/android/gyp/proguard.py ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698