OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to build Java aidl files in a consistent manner. | 6 # to build Java aidl files in a consistent manner. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'target_name': 'aidl_aidl-file-name', | 10 # 'target_name': 'aidl_aidl-file-name', |
11 # 'type': 'none', | 11 # 'type': 'none', |
12 # 'variables': { | 12 # 'variables': { |
13 # 'aidl_interface_file': 'path/to/aidl/interface/file/aidl-file', | 13 # 'aidl_interface_file': '<path>/<interface-file>.aidl', |
| 14 # 'input_package_path': '<package_path>, |
14 # }, | 15 # }, |
15 # 'sources': { | 16 # 'sources': { |
16 # 'path/to/aidl/source/file/1.aidl', | 17 # '<path>/<package-path>/<input-file1>.aidl', |
17 # 'path/to/aidl/source/file/2.aidl', | 18 # '<path>/<package-path>/<input-file2>.aidl', |
18 # ... | 19 # ... |
19 # }, | 20 # }, |
20 # 'includes': ['path/to/this/gypi/file'], | 21 # 'includes': ['<path>/java_aidl.gypi'], |
21 # } | 22 # } |
22 # | 23 # |
23 # | 24 # |
24 # Finally, the generated java file will be in the following directory: | 25 # The generated java files will be: |
25 # <(PRODUCT_DIR)/lib.java/ | 26 # <(PRODUCT_DIR)/lib.java/<package-path>/<input-file1>.java |
| 27 # <(PRODUCT_DIR)/lib.java/<package-path>/<input-file2>.java |
| 28 # ... |
26 | 29 |
27 { | 30 { |
28 'rules': [ | 31 'rules': [ |
29 { | 32 { |
30 'rule_name': 'compile_aidl', | 33 'rule_name': 'compile_aidl', |
31 'extension': 'aidl', | 34 'extension': 'aidl', |
32 'inputs': [ | 35 'inputs': [ |
33 '<(android_sdk)/framework.aidl', | 36 '<(android_sdk)/framework.aidl', |
34 '<(aidl_interface_file)', | 37 '<(aidl_interface_file)', |
35 ], | 38 ], |
36 'outputs': [ | 39 'outputs': [ |
37 '<(PRODUCT_DIR)/lib.java/<(RULE_INPUT_ROOT).java', | 40 '<(PRODUCT_DIR)/lib.java/<(input_package_path)/<(RULE_INPUT_ROOT).java', |
38 ], | 41 ], |
39 'action': [ | 42 'action': [ |
40 '<(android_sdk_tools)/aidl', | 43 '<(android_sdk_tools)/aidl', |
41 '-p<(android_sdk)/framework.aidl', | 44 '-p<(android_sdk)/framework.aidl', |
42 '-p<(aidl_interface_file)', | 45 '-p<(aidl_interface_file)', |
43 '-o<(PRODUCT_DIR)/lib.java/', | 46 '-o<(PRODUCT_DIR)/lib.java/', |
44 '<(RULE_INPUT_PATH)', | 47 '<(RULE_INPUT_PATH)', |
45 ], | 48 ], |
46 }, | 49 }, |
47 ], | 50 ], |
48 } | 51 } |
OLD | NEW |