| 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 3773e98bc70beeb6c154774c395a31999a85b009..a70e92f38505b6d646ca3011a5c5f5757421c3d7 100755
|
| --- a/build/android/gyp/write_build_config.py
|
| +++ b/build/android/gyp/write_build_config.py
|
| @@ -147,6 +147,10 @@ def main(argv):
|
| parser.add_option('--tested-apk-config',
|
| help='Path to the build config of the tested apk (for an instrumentation '
|
| 'test apk).')
|
| + parser.add_option('--proguard-enabled', action='store_true',
|
| + help='Whether proguard is enabled for this apk.')
|
| + parser.add_option('--proguard-info',
|
| + help='Path to the proguard .info output for this apk.')
|
|
|
| options, args = parser.parse_args(argv)
|
|
|
| @@ -289,6 +293,17 @@ def main(argv):
|
| if options.type in ['android_apk', 'deps_dex']:
|
| deps_dex_files = [c['dex_path'] for c in all_library_deps]
|
|
|
| + proguard_enabled = options.proguard_enabled
|
| + if options.type == 'android_apk':
|
| + deps_info['proguard_enabled'] = proguard_enabled
|
| + if proguard_enabled:
|
| + deps_info['proguard_info'] = options.proguard_info
|
| + config['proguard'] = {}
|
| + proguard_config = config['proguard']
|
| + proguard_config['input_paths'] = [options.jar_path] + java_full_classpath
|
| + proguard_config['tested_apk_info'] = ''
|
| +
|
| +
|
| # An instrumentation test apk should exclude the dex files that are in the apk
|
| # under test.
|
| if options.type == 'android_apk' and options.tested_apk_config:
|
| @@ -302,12 +317,21 @@ def main(argv):
|
| expected_tested_package = tested_apk_config['package_name']
|
| AndroidManifest(options.android_manifest).CheckInstrumentation(
|
| expected_tested_package)
|
| + if tested_apk_config['proguard_enabled']:
|
| + proguard_config['tested_apk_info'] = tested_apk_config['proguard_info']
|
| + assert proguard_enabled, ('proguard must be enabled for instrumentation'
|
| + ' apks if it\'s enabled for the tested apk')
|
| +
|
| +
|
|
|
| # Dependencies for the final dex file of an apk or a 'deps_dex'.
|
| if options.type in ['android_apk', 'deps_dex']:
|
| config['final_dex'] = {}
|
| dex_config = config['final_dex']
|
| - # TODO(cjhopman): proguard version
|
| + if proguard_enabled:
|
| + # When proguard is enabled, the proguarded jar contains the code for all
|
| + # of the dependencies.
|
| + deps_dex_files = []
|
| dex_config['dependency_dex_files'] = deps_dex_files
|
|
|
| if options.type == 'android_apk':
|
|
|