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

Side by Side Diff: build/android/gyp/apk_obfuscate.py

Issue 542483002: [Android] Stop ProGuard from shrinking release test apks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Generates the obfuscated jar and test jar for an apk. 7 """Generates the obfuscated jar and test jar for an apk.
8 8
9 If proguard is not enabled or 'Release' is not in the configuration name, 9 If proguard is not enabled or 'Release' is not in the configuration name,
10 obfuscation will be a no-op. 10 obfuscation will be a no-op.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 # configs should only contain the process_resources.py generated config. 118 # configs should only contain the process_resources.py generated config.
119 assert len(configs) == 1, ( 119 assert len(configs) == 1, (
120 'test apks should not have custom proguard configs: ' + str(configs)) 120 'test apks should not have custom proguard configs: ' + str(configs))
121 tested_jar_info = build_utils.ReadJson( 121 tested_jar_info = build_utils.ReadJson(
122 options.tested_apk_obfuscated_jar_path + '.info') 122 options.tested_apk_obfuscated_jar_path + '.info')
123 exclude_paths = tested_jar_info['inputs'] 123 exclude_paths = tested_jar_info['inputs']
124 configs = tested_jar_info['configs'] 124 configs = tested_jar_info['configs']
125 proguard_cmd += [ 125 proguard_cmd += [
126 '-dontobfuscate', 126 '-dontobfuscate',
127 '-dontoptimize', 127 '-dontoptimize',
128 '-dontshrink',
128 '-dontskipnonpubliclibraryclassmembers', 129 '-dontskipnonpubliclibraryclassmembers',
129 '-libraryjars', options.tested_apk_obfuscated_jar_path, 130 '-libraryjars', options.tested_apk_obfuscated_jar_path,
130 '-applymapping', options.tested_apk_obfuscated_jar_path + '.mapping', 131 '-applymapping', options.tested_apk_obfuscated_jar_path + '.mapping',
131 ] 132 ]
132 133
133 proguard_injars = [p for p in input_jars if p not in exclude_paths] 134 proguard_injars = [p for p in input_jars if p not in exclude_paths]
134 proguard_cmd += ['-injars', ':'.join(proguard_injars)] 135 proguard_cmd += ['-injars', ':'.join(proguard_injars)]
135 136
136 for config_file in configs: 137 for config_file in configs:
137 proguard_cmd += ['-include', config_file] 138 proguard_cmd += ['-include', config_file]
(...skipping 21 matching lines...) Expand all
159 for f in output_files: 160 for f in output_files:
160 if os.path.exists(f): 161 if os.path.exists(f):
161 os.remove(f) 162 os.remove(f)
162 build_utils.Touch(f) 163 build_utils.Touch(f)
163 164
164 if options.stamp: 165 if options.stamp:
165 build_utils.Touch(options.stamp) 166 build_utils.Touch(options.stamp)
166 167
167 if __name__ == '__main__': 168 if __name__ == '__main__':
168 sys.exit(main(sys.argv[1:])) 169 sys.exit(main(sys.argv[1:]))
OLDNEW
« 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