blob: 2d4ae2ef6e8b72f6dd87501699184f5eb1e99806 [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]320b2042012-07-10 23:12:0613# 'aidl_interface_file': '<interface-path>/<interface-file>.aidl',
[email protected]4ab5ddb2012-12-14 05:58:1114# 'aidl_import_include': '<(DEPTH)/<path-to-src-dir>',
[email protected]5b6f0692012-06-12 05:00:0515# },
16# 'sources': {
[email protected]320b2042012-07-10 23:12:0617# '<input-path1>/<input-file1>.aidl',
18# '<input-path2>/<input-file2>.aidl',
[email protected]5b6f0692012-06-12 05:00:0519# ...
20# },
[email protected]320b2042012-07-10 23:12:0621# 'includes': ['<path-to-this-file>/java_aidl.gypi'],
[email protected]5b6f0692012-06-12 05:00:0522# }
23#
24#
[email protected]320b2042012-07-10 23:12:0625# The generated java files will be:
26# <(PRODUCT_DIR)/lib.java/<input-file1>.java
27# <(PRODUCT_DIR)/lib.java/<input-file2>.java
28# ...
[email protected]8bf6c172012-08-13 18:35:4929#
[email protected]4ab5ddb2012-12-14 05:58:1130# Optional variables:
31# aidl_import_include - This should be an absolute path to your java src folder
32# that contains the classes that are imported by your aidl files.
33#
[email protected]8bf6c172012-08-13 18:35:4934# TODO(cjhopman): dependents need to rebuild when this target's inputs have changed.
[email protected]5b6f0692012-06-12 05:00:0535
36{
[email protected]4ab5ddb2012-12-14 05:58:1137 'variables': {
[email protected]37434b42013-02-20 22:39:1738 'intermediate_dir': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)/aidl',
[email protected]4ab5ddb2012-12-14 05:58:1139 'aidl_import_include%': '',
40 'additional_aidl_arguments': [],
[email protected]309501b2012-12-15 22:30:2741 'additional_aidl_input_paths': [],
[email protected]4ab5ddb2012-12-14 05:58:1142 },
[email protected]37434b42013-02-20 22:39:1743 'direct_dependent_settings': {
44 'variables': {
45 'generated_src_dirs': ['<(intermediate_dir)/'],
46 },
47 },
[email protected]4ab5ddb2012-12-14 05:58:1148 '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]37434b42013-02-20 22:39:1766 '<(intermediate_dir)/<(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]37434b42013-02-20 22:39:1774 '<(intermediate_dir)/<(RULE_INPUT_ROOT).java',
[email protected]5b6f0692012-06-12 05:00:0575 ],
76 },
77 ],
78}