| 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': '<interface-path>/<interface-file>.aidl', |
| 14 # }, | 14 # }, |
| 15 # 'sources': { | 15 # 'sources': { |
| 16 # 'path/to/aidl/source/file/1.aidl', | 16 # '<input-path1>/<input-file1>.aidl', |
| 17 # 'path/to/aidl/source/file/2.aidl', | 17 # '<input-path2>/<input-file2>.aidl', |
| 18 # ... | 18 # ... |
| 19 # }, | 19 # }, |
| 20 # 'includes': ['path/to/this/gypi/file'], | 20 # 'includes': ['<path-to-this-file>/java_aidl.gypi'], |
| 21 # } | 21 # } |
| 22 # | 22 # |
| 23 # | 23 # |
| 24 # Finally, the generated java file will be in the following directory: | 24 # The generated java files will be: |
| 25 # <(PRODUCT_DIR)/lib.java/ | 25 # <(PRODUCT_DIR)/lib.java/<input-file1>.java |
| 26 # <(PRODUCT_DIR)/lib.java/<input-file2>.java |
| 27 # ... |
| 26 | 28 |
| 27 { | 29 { |
| 28 'rules': [ | 30 'rules': [ |
| 29 { | 31 { |
| 30 'rule_name': 'compile_aidl', | 32 'rule_name': 'compile_aidl', |
| 31 'extension': 'aidl', | 33 'extension': 'aidl', |
| 32 'inputs': [ | 34 'inputs': [ |
| 33 '<(android_sdk)/framework.aidl', | 35 '<(android_sdk)/framework.aidl', |
| 34 '<(aidl_interface_file)', | 36 '<(aidl_interface_file)', |
| 35 ], | 37 ], |
| 36 'outputs': [ | 38 'outputs': [ |
| 37 '<(PRODUCT_DIR)/lib.java/<(RULE_INPUT_ROOT).java', | 39 '<(PRODUCT_DIR)/lib.java/<(RULE_INPUT_ROOT).java', |
| 38 ], | 40 ], |
| 39 'action': [ | 41 'action': [ |
| 40 '<(android_sdk_tools)/aidl', | 42 '<(android_sdk_tools)/aidl', |
| 41 '-p<(android_sdk)/framework.aidl', | 43 '-p<(android_sdk)/framework.aidl', |
| 42 '-p<(aidl_interface_file)', | 44 '-p<(aidl_interface_file)', |
| 43 '-o<(PRODUCT_DIR)/lib.java/', | |
| 44 '<(RULE_INPUT_PATH)', | 45 '<(RULE_INPUT_PATH)', |
| 46 '<(PRODUCT_DIR)/lib.java/<(RULE_INPUT_ROOT).java', |
| 45 ], | 47 ], |
| 46 }, | 48 }, |
| 47 ], | 49 ], |
| 48 } | 50 } |
| OLD | NEW |