Chromium Code Reviews| Index: build/android/gyp/apkbuilder.py |
| diff --git a/build/android/gyp/apkbuilder.py b/build/android/gyp/apkbuilder.py |
| index f668c08e690ee41ebc6bef1db3bd805c1d05f4c4..d2b0d0e719df4d32de6d2513cd078fce1a75998e 100755 |
| --- a/build/android/gyp/apkbuilder.py |
| +++ b/build/android/gyp/apkbuilder.py |
| @@ -51,6 +51,8 @@ def _ParseArgs(args): |
| parser.add_argument('--native-lib-placeholders', |
| help='GYP-list of native library placeholders to add.', |
| default='[]') |
| + parser.add_argument('--emma-device-jar', |
| + help='Path to emma_device.jar to include.') |
| options = parser.parse_args(args) |
| options.assets = build_utils.ParseGypList(options.assets) |
| options.uncompressed_assets = build_utils.ParseGypList( |
| @@ -122,6 +124,9 @@ def main(args): |
| if options.dex_file: |
| input_paths.append(options.dex_file) |
| + if options.emma_device_jar: |
| + input_paths.append(options.emma_device_jar) |
| + |
| input_strings = [options.android_abi, options.native_lib_placeholders] |
| for path in itertools.chain(options.assets, options.uncompressed_assets): |
| @@ -152,6 +157,23 @@ def main(args): |
| if options.dex_file: |
| apk.write(options.dex_file, 'classes.dex') |
| + if options.emma_device_jar: |
| + with zipfile.ZipFile(options.emma_device_jar, 'r') as emma_device_jar: |
| + emma_device_jar_entries = emma_device_jar.namelist() |
|
agrieve
2015/11/19 01:50:52
nit: no need for this variable
pkotwicz
2015/11/19 16:55:59
Done.
|
| + for emma_device_jar_entry in emma_device_jar_entries: |
| + entry_name_lower = emma_device_jar_entry.lower() |
| + if entry_name_lower.startswith('meta-inf/'): |
|
agrieve
2015/11/19 01:50:52
I think you can delete this since it's covered by
pkotwicz
2015/11/19 16:55:59
The next if statement does not exclude META-INF/MA
|
| + continue |
| + |
| + if entry_name_lower.endswith('/'): |
| + continue |
| + |
| + if entry_name_lower.endswith('.class'): |
| + continue |
| + |
| + apk.writestr(emma_device_jar_entry, |
|
agrieve
2015/11/19 01:50:52
nit: could you add a comment saying what types of
pkotwicz
2015/11/19 16:55:59
I am not sure why we copy over files from emma_dev
agrieve
2015/11/19 18:39:40
Ahh, okay. I suspect the root .properties files ar
|
| + emma_device_jar.read(emma_device_jar_entry)) |
| + |
| shutil.move(tmp_apk, options.output_apk) |
| finally: |
| if os.path.exists(tmp_apk): |