OLD | NEW |
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 """Invokes Android's aidl | 7 """Invokes Android's aidl |
8 """ | 8 """ |
9 | 9 |
10 import optparse | 10 import optparse |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 with zipfile.ZipFile(options.srcjar, 'w') as srcjar: | 47 with zipfile.ZipFile(options.srcjar, 'w') as srcjar: |
48 for path in build_utils.FindInDirectory(temp_dir, '*.java'): | 48 for path in build_utils.FindInDirectory(temp_dir, '*.java'): |
49 with open(path) as fileobj: | 49 with open(path) as fileobj: |
50 data = fileobj.read() | 50 data = fileobj.read() |
51 pkg_name = re.search(r'^\s*package\s+(.*?)\s*;', data, re.M).group(1) | 51 pkg_name = re.search(r'^\s*package\s+(.*?)\s*;', data, re.M).group(1) |
52 arcname = '%s/%s' % (pkg_name.replace('.', '/'), os.path.basename(path)) | 52 arcname = '%s/%s' % (pkg_name.replace('.', '/'), os.path.basename(path)) |
53 srcjar.writestr(arcname, data) | 53 srcjar.writestr(arcname, data) |
54 | 54 |
55 if options.depfile: | 55 if options.depfile: |
56 build_utils.WriteDepfile( | 56 build_utils.WriteDepfile(options.depfile, options.srcjar) |
57 options.depfile, | |
58 build_utils.GetPythonDependencies()) | |
59 | 57 |
60 | 58 |
61 if __name__ == '__main__': | 59 if __name__ == '__main__': |
62 sys.exit(main(sys.argv)) | 60 sys.exit(main(sys.argv)) |
OLD | NEW |