michael@0: # Copyright (c) 2012 The Chromium Authors. All rights reserved. michael@0: # Use of this source code is governed by a BSD-style license that can be michael@0: # found in the LICENSE file. michael@0: michael@0: # This file is meant to be included into a target to provide a rule michael@0: # to build Java aidl files in a consistent manner. michael@0: # michael@0: # To use this, create a gyp target with the following form: michael@0: # { michael@0: # 'target_name': 'aidl_aidl-file-name', michael@0: # 'type': 'none', michael@0: # 'variables': { michael@0: # 'package_name': michael@0: # 'aidl_interface_file': '/.aidl', michael@0: # }, michael@0: # 'sources': { michael@0: # '/.aidl', michael@0: # '/.aidl', michael@0: # ... michael@0: # }, michael@0: # 'includes': ['/java_aidl.gypi'], michael@0: # } michael@0: # michael@0: # michael@0: # The generated java files will be: michael@0: # <(PRODUCT_DIR)/lib.java/.java michael@0: # <(PRODUCT_DIR)/lib.java/.java michael@0: # ... michael@0: # michael@0: # TODO(cjhopman): dependents need to rebuild when this target's inputs have changed. michael@0: michael@0: { michael@0: 'direct_dependent_settings': { michael@0: 'variables': { michael@0: 'generated_src_dirs': ['<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/'], michael@0: }, michael@0: }, michael@0: 'rules': [ michael@0: { michael@0: 'rule_name': 'compile_aidl', michael@0: 'extension': 'aidl', michael@0: 'inputs': [ michael@0: '<(android_sdk)/framework.aidl', michael@0: '<(aidl_interface_file)', michael@0: ], michael@0: 'outputs': [ michael@0: '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java', michael@0: ], michael@0: 'action': [ michael@0: '<(android_sdk_tools)/aidl', michael@0: '-p<(android_sdk)/framework.aidl', michael@0: '-p<(aidl_interface_file)', michael@0: '<(RULE_INPUT_PATH)', michael@0: '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java', michael@0: ], michael@0: }, michael@0: ], michael@0: }