| 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/to/aidl/interface/file/aidl-file', |
| 14 # }, | 14 # }, |
| 15 # 'sources': { | 15 # 'sources': { |
| 16 # 'path/to/aidl/source/file/1.aidl', | 16 # 'path/to/aidl/source/file/1.aidl', |
| 17 # 'path/to/aidl/source/file/2.aidl', | 17 # 'path/to/aidl/source/file/2.aidl', |
| 18 # ... | 18 # ... |
| 19 # }, | 19 # }, |
| 20 # 'includes': ['path/to/this/gypi/file'], | 20 # 'includes': ['path/to/this/gypi/file'], |
| 21 # } | 21 # } |
| 22 # | 22 # |
| 23 # | 23 # |
| 24 # Finally, the generated java file will be in the following directory: | 24 # Finally, the generated java file will be in the following directory: |
| 25 # <(PRODUCT_DIR)/lib.java/ | 25 # <(PRODUCT_DIR)/lib.java/ |
| 26 | 26 |
| 27 { | 27 { |
| 28 'variables': { | |
| 29 'android_sdk%': | |
| 30 '<!(if [ -z $ANDROID_BUILD_TOP ]; then \ | |
| 31 /bin/echo -n $ANDROID_SDK_ROOT/platforms/android-${ANDROID_SDK_VERSI
ON} ; \ | |
| 32 else /bin/echo -n \ | |
| 33 $ANDROID_SDK_ROOT ; \ | |
| 34 fi)', | |
| 35 }, | |
| 36 'rules': [ | 28 'rules': [ |
| 37 { | 29 { |
| 38 'rule_name': 'compile_aidl', | 30 'rule_name': 'compile_aidl', |
| 39 'extension': 'aidl', | 31 'extension': 'aidl', |
| 40 'inputs': [ | 32 'inputs': [ |
| 41 '<(android_sdk)/framework.aidl', | 33 '<(android_sdk)/framework.aidl', |
| 42 '<(aidl_interface_file)', | 34 '<(aidl_interface_file)', |
| 43 ], | 35 ], |
| 44 'outputs': [ | 36 'outputs': [ |
| 45 '<(PRODUCT_DIR)/lib.java/<(RULE_INPUT_ROOT).java', | 37 '<(PRODUCT_DIR)/lib.java/<(RULE_INPUT_ROOT).java', |
| 46 ], | 38 ], |
| 47 'action': [ | 39 'action': [ |
| 48 'aidl', | 40 'aidl', |
| 49 '-p<(android_sdk)/framework.aidl', | 41 '-p<(android_sdk)/framework.aidl', |
| 50 '-p<(aidl_interface_file)', | 42 '-p<(aidl_interface_file)', |
| 51 '-o<(PRODUCT_DIR)/lib.java/', | 43 '-o<(PRODUCT_DIR)/lib.java/', |
| 52 '<(RULE_INPUT_PATH)', | 44 '<(RULE_INPUT_PATH)', |
| 53 ], | 45 ], |
| 54 }, | 46 }, |
| 55 ], | 47 ], |
| 56 } | 48 } |
| OLD | NEW |