[email protected] | 5b6f069 | 2012-06-12 05:00:05 | [diff] [blame^] | 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 |
| 3 | # found in the LICENSE file. |
| 4 | |
| 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. |
| 7 | # |
| 8 | # To use this, create a gyp target with the following form: |
| 9 | # { |
| 10 | # 'target_name': 'aidl_aidl-file-name', |
| 11 | # 'type': 'none', |
| 12 | # 'variables': { |
| 13 | # 'aidl_interface_file': 'path/to/aidl/interface/file/aidl-file', |
| 14 | # }, |
| 15 | # 'sources': { |
| 16 | # 'path/to/aidl/source/file/1.aidl', |
| 17 | # 'path/to/aidl/source/file/2.aidl', |
| 18 | # ... |
| 19 | # }, |
| 20 | # 'includes': ['path/to/this/gypi/file'], |
| 21 | # } |
| 22 | # |
| 23 | # |
| 24 | # Finally, the generated java file will be in the following directory: |
| 25 | # <(PRODUCT_DIR)/lib.java/ |
| 26 | |
| 27 | { |
| 28 | 'variables': { |
| 29 | 'android_sdk%': |
| 30 | '<!(if [ -z $ANDROID_BUILD_TOP ]; then \ |
| 31 | /bin/echo -n $ANDROID_SDK_ROOT/platforms/android-${ANDROID_SDK_VERSION} ; \ |
| 32 | else /bin/echo -n \ |
| 33 | $ANDROID_SDK_ROOT ; \ |
| 34 | fi)', |
| 35 | }, |
| 36 | 'rules': [ |
| 37 | { |
| 38 | 'rule_name': 'compile_aidl', |
| 39 | 'extension': 'aidl', |
| 40 | 'inputs': [ |
| 41 | '<(android_sdk)/framework.aidl', |
| 42 | '<(aidl_interface_file)', |
| 43 | ], |
| 44 | 'outputs': [ |
| 45 | '<(PRODUCT_DIR)/lib.java/<(RULE_INPUT_ROOT).java', |
| 46 | ], |
| 47 | 'action': [ |
| 48 | 'aidl', |
| 49 | '-p<(android_sdk)/framework.aidl', |
| 50 | '-p<(aidl_interface_file)', |
| 51 | '-o<(PRODUCT_DIR)/lib.java/', |
| 52 | '<(RULE_INPUT_PATH)', |
| 53 | ], |
| 54 | }, |
| 55 | ], |
| 56 | } |