blob: bb8f2b8cdd8afbc2a10ef61567626917cbad323a [file] [log] [blame]
[email protected]5b6f0692012-06-12 05:00:051# 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': {
[email protected]8bf6c172012-08-13 18:35:4913# 'package_name': <name-of-package>
[email protected]320b2042012-07-10 23:12:0614# 'aidl_interface_file': '<interface-path>/<interface-file>.aidl',
[email protected]4ab5ddb2012-12-14 05:58:1115# 'aidl_import_include': '<(DEPTH)/<path-to-src-dir>',
[email protected]5b6f0692012-06-12 05:00:0516# },
17# 'sources': {
[email protected]320b2042012-07-10 23:12:0618# '<input-path1>/<input-file1>.aidl',
19# '<input-path2>/<input-file2>.aidl',
[email protected]5b6f0692012-06-12 05:00:0520# ...
21# },
[email protected]320b2042012-07-10 23:12:0622# 'includes': ['<path-to-this-file>/java_aidl.gypi'],
[email protected]5b6f0692012-06-12 05:00:0523# }
24#
25#
[email protected]320b2042012-07-10 23:12:0626# The generated java files will be:
27# <(PRODUCT_DIR)/lib.java/<input-file1>.java
28# <(PRODUCT_DIR)/lib.java/<input-file2>.java
29# ...
[email protected]8bf6c172012-08-13 18:35:4930#
[email protected]4ab5ddb2012-12-14 05:58:1131# Optional variables:
32# aidl_import_include - This should be an absolute path to your java src folder
33# that contains the classes that are imported by your aidl files.
34#
[email protected]8bf6c172012-08-13 18:35:4935# TODO(cjhopman): dependents need to rebuild when this target's inputs have changed.
[email protected]5b6f0692012-06-12 05:00:0536
37{
[email protected]8bf6c172012-08-13 18:35:4938 'direct_dependent_settings': {
39 'variables': {
[email protected]d54f19b2012-09-28 18:22:2940 'generated_src_dirs': ['<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/'],
[email protected]8bf6c172012-08-13 18:35:4941 },
42 },
[email protected]4ab5ddb2012-12-14 05:58:1143 'variables': {
44 'aidl_import_include%': '',
45 'additional_aidl_arguments': [],
[email protected]309501b2012-12-15 22:30:2746 'additional_aidl_input_paths': [],
[email protected]4ab5ddb2012-12-14 05:58:1147 },
48 'conditions': [
49 ['"<(aidl_import_include)"!=""', {
50 'variables': {
[email protected]309501b2012-12-15 22:30:2751 'additional_aidl_arguments': [ '-I<(aidl_import_include)' ],
52 'additional_aidl_input_paths': [ '<!@(find <(aidl_import_include) -name "*.java")', ]
[email protected]4ab5ddb2012-12-14 05:58:1153 }
54 }],
55 ],
[email protected]5b6f0692012-06-12 05:00:0556 'rules': [
57 {
58 'rule_name': 'compile_aidl',
59 'extension': 'aidl',
60 'inputs': [
61 '<(android_sdk)/framework.aidl',
62 '<(aidl_interface_file)',
[email protected]309501b2012-12-15 22:30:2763 '<@(additional_aidl_input_paths)',
[email protected]5b6f0692012-06-12 05:00:0564 ],
65 'outputs': [
[email protected]8bf6c172012-08-13 18:35:4966 '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
[email protected]5b6f0692012-06-12 05:00:0567 ],
68 'action': [
[email protected]5308c3bf2012-07-04 14:27:3669 '<(android_sdk_tools)/aidl',
[email protected]5b6f0692012-06-12 05:00:0570 '-p<(android_sdk)/framework.aidl',
71 '-p<(aidl_interface_file)',
[email protected]4ab5ddb2012-12-14 05:58:1172 '<@(additional_aidl_arguments)',
[email protected]5b6f0692012-06-12 05:00:0573 '<(RULE_INPUT_PATH)',
[email protected]8bf6c172012-08-13 18:35:4974 '<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
[email protected]5b6f0692012-06-12 05:00:0575 ],
76 },
77 ],
78}