blob: 095525e35bf46b55593664e1e52afa229c8a2315 [file] [log] [blame]
Steven Moreland81079f92018-07-06 16:15:53 -07001// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15bootstrap_go_package {
16 name: "aidl-soong-rules",
17 pkgPath: "android/soong/aidl",
18 deps: [
19 "blueprint",
20 "soong",
Jooyung Han1150b2a2020-08-18 15:43:56 +090021 "soong-apex",
Steven Moreland81079f92018-07-06 16:15:53 -070022 "soong-android",
23 "soong-cc",
24 "soong-genrule",
25 "soong-phony",
26 "soong-java",
Andrei Homescub62afd92020-05-11 19:24:59 -070027 "soong-rust",
Steven Moreland81079f92018-07-06 16:15:53 -070028 ],
29 srcs: [
30 "aidl_interface.go",
31 "properties.go",
32 ],
Jooyung Han63a926a2019-12-09 11:07:20 +090033 testSrcs: [
34 "aidl_test.go",
35 ],
Steven Moreland81079f92018-07-06 16:15:53 -070036 pluginFor: ["soong_build"],
37}
38
Steven Moreland74d3f552020-02-04 15:57:50 -080039aidl_interfaces_metadata {
40 name: "aidl_metadata_json",
41 visibility: ["//system/tools/aidl:__subpackages__"],
42}
43
Steven Moreland81079f92018-07-06 16:15:53 -070044// These configurations are inherited by all aidl-gen modules
45
46cc_defaults {
47 name: "aidl-cpp-module-defaults",
Steven Morelanddca9d4b2019-09-20 18:42:24 +000048 // TODO(b/31559095): remove when host bionic is available
49 defaults: ["libbinder_ndk_host_user"],
Steven Moreland81079f92018-07-06 16:15:53 -070050 cflags: [
51 "-Wall",
52 "-Werror",
53 "-Wextra-semi",
54 ],
55}
56
57java_defaults {
58 name: "aidl-java-module-defaults",
59}
60
Andrei Homescub62afd92020-05-11 19:24:59 -070061rust_defaults {
62 name: "aidl-rust-module-defaults",
63}
64
Steven Moreland81079f92018-07-06 16:15:53 -070065// Tests
66
Steven Morelandf49719c2019-06-05 14:06:44 -070067filegroup {
68 name: "aidl-test-filegroup",
69 srcs: [
70 "tests_1/some_package/IFoo.aidl",
71 "tests_1/some_package/Thing.aidl",
72 "tests_1/some_package/sub_package/*.aidl",
73 ],
74}
75
Steven Morelandbaab7f42019-02-11 12:38:56 -080076// Copy of test-piece-1 as test only. Creating a separate library because 'vendor_available' is
77// contagious.
78aidl_interface {
Steven Morelanddca9d4b2019-09-20 18:42:24 +000079 name: "test-variants",
Jiyong Parka3617e62020-04-13 11:32:05 +090080 unstable: true,
Steven Morelandbaab7f42019-02-11 12:38:56 -080081 local_include_dir: "tests_1",
82 vendor_available: true,
Steven Morelanddca9d4b2019-09-20 18:42:24 +000083 host_supported: true,
Steven Morelandbaab7f42019-02-11 12:38:56 -080084 srcs: [
Steven Morelandf49719c2019-06-05 14:06:44 -070085 ":aidl-test-filegroup",
Steven Morelandbaab7f42019-02-11 12:38:56 -080086 ],
87}
88
Steven Moreland81079f92018-07-06 16:15:53 -070089aidl_interface {
90 name: "test-piece-1",
91 local_include_dir: "tests_1",
92 srcs: [
93 "tests_1/some_package/IFoo.aidl",
94 "tests_1/some_package/Thing.aidl",
Steven Morelandf49719c2019-06-05 14:06:44 -070095 "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
Steven Moreland81079f92018-07-06 16:15:53 -070096 ],
Jeongik Cha997281d2020-01-16 15:23:59 +090097 versions: [
98 "1",
99 "2",
100 "3",
101 ],
Steven Moreland81079f92018-07-06 16:15:53 -0700102}
103
104aidl_interface {
105 name: "test-piece-2",
106 local_include_dir: "tests_1",
107 srcs: [
Steven Morelandf3da0892018-10-05 14:52:01 -0700108 "tests_1/INoPackage.aidl",
Steven Moreland81079f92018-07-06 16:15:53 -0700109 "tests_1/some_package/IBar.aidl",
110 ],
111 imports: [
112 "test-piece-1",
113 ],
Devin Mooree2ccf8a2020-05-13 14:28:20 -0700114 backend: {
115 java: {
116 platform_apis: true,
117 },
118 },
Devin Moore7d5a4542020-04-29 15:37:25 -0700119 gen_trace: true,
Jiyong Parkfce159b2018-09-20 15:24:52 +0900120 versions: ["1"],
Steven Moreland81079f92018-07-06 16:15:53 -0700121}
122
123aidl_interface {
124 name: "test-piece-3",
125 local_include_dir: "tests_1",
126 srcs: [
127 "tests_1/other_package/IBaz.aidl",
128 ],
129 imports: [
130 "test-piece-2",
131 ],
Devin Mooree2ccf8a2020-05-13 14:28:20 -0700132 backend: {
133 java: {
134 platform_apis: true,
135 },
136 },
Devin Moore7d5a4542020-04-29 15:37:25 -0700137 gen_trace: true,
Jiyong Parkfce159b2018-09-20 15:24:52 +0900138 versions: ["1"],
Steven Moreland81079f92018-07-06 16:15:53 -0700139}
140
141aidl_interface {
142 name: "test-piece-4",
143 local_include_dir: "tests_2",
144 srcs: [
145 "tests_2/another_package/IFaz.aidl",
146 ],
147 imports: [
148 "test-piece-1",
149 ],
Devin Mooree2ccf8a2020-05-13 14:28:20 -0700150 backend: {
151 java: {
152 platform_apis: true,
153 },
154 },
Devin Moore7d5a4542020-04-29 15:37:25 -0700155 gen_trace: true,
Jiyong Parkfce159b2018-09-20 15:24:52 +0900156 versions: ["1"],
Steven Moreland81079f92018-07-06 16:15:53 -0700157}
158
159aidl_interface {
160 name: "test-root-package",
161 srcs: [
162 "test_package/IBaz.aidl",
163 ],
164 imports: [
165 "test-piece-2",
166 ],
Devin Mooree2ccf8a2020-05-13 14:28:20 -0700167 backend: {
168 java: {
169 platform_apis: true,
170 },
171 },
Devin Moore7d5a4542020-04-29 15:37:25 -0700172 gen_trace: true,
Jeongik Cha997281d2020-01-16 15:23:59 +0900173 versions: [
174 "1",
175 "2",
176 ],
Steven Moreland81079f92018-07-06 16:15:53 -0700177}
Jeongik Cha969f11a2020-08-19 13:08:06 +0900178
179aidl_interface {
180 name: "test-piece-5",
181 unstable: true,
182 local_include_dir: "tests_3",
183 srcs: [
184 "tests_3/EmptyParcelable.aidl",
185 "tests_3/EmptyInterface.aidl",
186 ],
187}