Chromium Code Reviews| Index: build/android/gyp/aidl.py |
| diff --git a/build/android/gyp/aidl.py b/build/android/gyp/aidl.py |
| index d5aa5467709fdd7d522f755f41f94b1e312578ab..85ceeae3e64ecb527f833d4d28860473ba3efdf9 100755 |
| --- a/build/android/gyp/aidl.py |
| +++ b/build/android/gyp/aidl.py |
| @@ -9,7 +9,9 @@ |
| import optparse |
| import os |
| +import re |
| import sys |
| +import zipfile |
| from util import build_utils |
| @@ -42,7 +44,13 @@ def main(argv): |
| ] |
| build_utils.CheckOutput(aidl_cmd) |
| - build_utils.ZipDir(options.srcjar, temp_dir) |
| + with zipfile.ZipFile(options.srcjar, 'w') as srcjar: |
|
Yaron
2015/09/29 17:24:05
As an alternative, how hard would it be to create
agrieve
2015/09/29 17:36:56
The .java files are deleted after the script runs,
Yaron
2015/09/29 17:48:00
Right, thanks for clarifying the gyp vs gn thing.
|
| + for path in build_utils.FindInDirectory(temp_dir, '*.java'): |
| + with open(path) as fileobj: |
| + data = fileobj.read() |
| + pkg_name = re.search(r'^\s*package\s+(.*?)\s*;', data, re.M).group(1) |
| + arcname = '%s/%s' % (pkg_name.replace('.', '/'), os.path.basename(path)) |
| + srcjar.writestr(arcname, data) |
| if options.depfile: |
| build_utils.WriteDepfile( |