• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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
15package {
16    // See: http://go/android-license-faq
17    // A large-scale-change added 'default_applicable_licenses' to import
18    // all of the 'license_kinds' from "system_tools_aidl_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["system_tools_aidl_license"],
22}
23
24bootstrap_go_package {
25    name: "aidl-soong-rules",
26    pkgPath: "android/soong/aidl",
27    deps: [
28        "blueprint",
29        "soong",
30        "soong-android",
31        "soong-bp2build",
32        "soong-cc",
33        "soong-genrule",
34        "soong-phony",
35        "soong-java",
36        "soong-rust",
37    ],
38    srcs: [
39        "aidl_interface.go",
40        "properties.go",
41        "aidl_api.go",
42        "aidl_gen_rule.go",
43        "aidl_interface_backends.go",
44        "aidl_interface_defaults.go",
45        "aidl_interface_headers.go",
46        "aidl_interface_metadata_singleton.go",
47        "aidl_rust_source_provider.go",
48        "aidl_utils.go",
49    ],
50    testSrcs: [
51        "aidl_test.go",
52        "aidl_interface_bp2build_test.go",
53    ],
54    pluginFor: ["soong_build"],
55}
56
57aidl_interfaces_metadata {
58    name: "aidl_metadata_json",
59    visibility: ["//system/tools/aidl:__subpackages__"],
60}
61
62// These configurations are inherited by all aidl-gen modules
63// TODO(b/146436251): default isn't applied because the module is created
64// in PreArchMutators, when import behavior becomes explicit, the logic can
65// be moved back to LoadHook, and then default can be applied as well.
66cc_defaults {
67    name: "aidl-cpp-module-defaults",
68    target: {
69        darwin: {
70            enabled: false,
71        },
72    },
73}
74
75java_defaults {
76    name: "aidl-java-module-defaults",
77}
78
79rust_defaults {
80    name: "aidl-rust-module-defaults",
81}
82
83// Tests
84
85filegroup {
86    name: "aidl-test-filegroup",
87    srcs: [
88        "tests_1/some_package/IFoo.aidl",
89        "tests_1/some_package/Thing.aidl",
90        "tests_1/some_package/sub_package/*.aidl",
91    ],
92}
93
94aidl_interface {
95    name: "test-piece-1",
96    local_include_dir: "tests_1",
97    vendor_available: true,
98    product_available: true,
99    double_loadable: true,
100    host_supported: true,
101    flags: ["-Werror"],
102    srcs: [
103        "tests_1/some_package/IFoo.aidl",
104        "tests_1/some_package/Thing.aidl",
105        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
106    ],
107    versions: [
108        "1",
109        "2",
110        "3",
111        "4",
112    ],
113    backend: {
114        rust: {
115            enabled: true,
116        },
117    },
118}
119
120aidl_interface {
121    name: "test-piece-ndk-sdk-29",
122    local_include_dir: "tests_1",
123    flags: ["-Werror"],
124    srcs: [
125        "tests_1/some_package/IFoo.aidl",
126        "tests_1/some_package/Thing.aidl",
127        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
128    ],
129    unstable: true,
130    backend: {
131        rust: {
132            enabled: true,
133        },
134        ndk: {
135            sdk_version: "29",
136            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
137        },
138    },
139}
140
141aidl_interface {
142    name: "test-piece-ndk-sdk-30",
143    local_include_dir: "tests_1",
144    flags: ["-Werror"],
145    srcs: [
146        "tests_1/some_package/IFoo.aidl",
147        "tests_1/some_package/Thing.aidl",
148        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
149    ],
150    unstable: true,
151    backend: {
152        rust: {
153            enabled: true,
154        },
155        ndk: {
156            sdk_version: "30",
157            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
158        },
159    },
160}
161
162aidl_interface {
163    name: "test-piece-ndk-sdk-31",
164    local_include_dir: "tests_1",
165    flags: ["-Werror"],
166    srcs: [
167        "tests_1/some_package/IFoo.aidl",
168        "tests_1/some_package/Thing.aidl",
169        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
170    ],
171    unstable: true,
172    backend: {
173        rust: {
174            enabled: true,
175        },
176        ndk: {
177            sdk_version: "31",
178            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
179        },
180    },
181}
182
183aidl_interface {
184    name: "test-piece-ndk-sdk-32",
185    local_include_dir: "tests_1",
186    flags: ["-Werror"],
187    srcs: [
188        "tests_1/some_package/IFoo.aidl",
189        "tests_1/some_package/Thing.aidl",
190        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
191    ],
192    unstable: true,
193    backend: {
194        rust: {
195            enabled: true,
196        },
197        ndk: {
198            sdk_version: "32",
199            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
200        },
201    },
202}
203
204aidl_interface {
205    name: "test-piece-ndk-sdk-33",
206    local_include_dir: "tests_1",
207    flags: ["-Werror"],
208    srcs: [
209        "tests_1/some_package/IFoo.aidl",
210        "tests_1/some_package/Thing.aidl",
211        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
212    ],
213    unstable: true,
214    backend: {
215        rust: {
216            enabled: true,
217        },
218        ndk: {
219            sdk_version: "33",
220            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
221        },
222    },
223}
224
225aidl_interface {
226    name: "tests-vintf",
227    local_include_dir: "tests_vintf",
228    srcs: ["tests_vintf/vintf/IFoo.aidl"],
229    stability: "vintf",
230    backend: {
231        rust: {
232            enabled: true,
233        },
234        ndk: {
235            sdk_version: "31",
236        },
237        java: {
238            sdk_version: "system_current",
239        },
240    },
241    versions_with_info: [
242        {
243            version: "1",
244            imports: [],
245        },
246    ],
247
248}
249
250aidl_interface {
251    name: "test-piece-2",
252    local_include_dir: "tests_1",
253    flags: ["-Werror"],
254    srcs: [
255        "tests_1/INoPackage.aidl",
256        "tests_1/some_package/IBar.aidl",
257    ],
258    imports: [
259        "test-piece-1-V3",
260    ],
261    backend: {
262        rust: {
263            enabled: true,
264        },
265        java: {
266            platform_apis: true,
267        },
268    },
269    gen_trace: true,
270    versions_with_info: [
271        {
272            version: "1",
273            imports: ["test-piece-1-V3"],
274        },
275    ],
276
277}
278
279aidl_interface {
280    name: "test-piece-3",
281    local_include_dir: "tests_1",
282    flags: ["-Werror"],
283    srcs: [
284        "tests_1/other_package/Enum.aidl",
285        "tests_1/other_package/IBaz.aidl",
286    ],
287    imports: [
288        "test-piece-2-V1",
289    ],
290    backend: {
291        rust: {
292            enabled: true,
293        },
294        java: {
295            platform_apis: true,
296            gen_trace: true,
297        },
298    },
299    gen_trace: true,
300    versions_with_info: [
301        {
302            version: "1",
303            imports: ["test-piece-2-V1"],
304        },
305        {
306            version: "2",
307            imports: ["test-piece-2-V1"],
308        },
309
310    ],
311    frozen: true,
312}
313
314cc_test_library {
315    name: "client-using-test-piece-3",
316    srcs: ["client-using-test-piece-3.cpp"],
317    shared_libs: ["test-piece-3-V2-cpp"],
318}
319
320aidl_interface {
321    name: "test-piece-4",
322    local_include_dir: "tests_2",
323    flags: ["-Werror"],
324    srcs: [
325        "tests_2/another_package/IFaz.aidl",
326    ],
327    imports: [
328        "test-piece-1-V3",
329    ],
330    backend: {
331        rust: {
332            enabled: true,
333        },
334        java: {
335            platform_apis: true,
336        },
337    },
338    gen_trace: true,
339    versions: ["1"],
340    dumpapi: {
341        no_license: true,
342    },
343}
344
345aidl_interface {
346    name: "test-root-package",
347    flags: ["-Werror"],
348    srcs: [
349        "test_package/IBaz.aidl",
350    ],
351    imports: [
352        "test-piece-2-V1",
353    ],
354    backend: {
355        rust: {
356            enabled: true,
357        },
358        java: {
359            platform_apis: true,
360        },
361    },
362    gen_trace: true,
363    versions: [
364        "1",
365        "2",
366        "3",
367    ],
368}
369
370aidl_interface {
371    name: "test-piece-5",
372    unstable: true,
373    local_include_dir: "tests_3",
374    flags: ["-Werror"],
375    srcs: [
376        "tests_3/EmptyParcelable.aidl",
377        "tests_3/IEmptyInterface.aidl",
378    ],
379}
380
381aidl_interface {
382    name: "test-piece-6",
383    unstable: true,
384    local_include_dir: "tests_6",
385    flags: ["-Werror"],
386    srcs: [
387        "tests_6/test6/Bar.aidl",
388        "tests_6/test6/Foo.aidl",
389    ],
390}
391
392// These test that a parcel imported from A->B->C will have the required dependencies to link in
393// all backends (C++ backends need to link direclty against the constructor of the parcelable
394// in order to work)
395aidl_interface {
396    name: "tests_transitive_parcel.a",
397    flags: ["-Werror"],
398    srcs: ["tests_transitive_parcel/a/*.aidl"],
399    imports: [
400        "tests_transitive_parcel.b",
401        "tests_transitive_parcel.c",
402    ],
403    unstable: true,
404    backend: {
405        rust: {
406            enabled: true,
407        },
408    },
409}
410
411aidl_interface {
412    name: "tests_transitive_parcel.b",
413    flags: ["-Werror"],
414    srcs: ["tests_transitive_parcel/b/*.aidl"],
415    imports: ["tests_transitive_parcel.c"],
416    unstable: true,
417    backend: {
418        rust: {
419            enabled: true,
420        },
421    },
422}
423
424aidl_interface {
425    name: "tests_transitive_parcel.c",
426    flags: ["-Werror"],
427    srcs: ["tests_transitive_parcel/c/*.aidl"],
428    unstable: true,
429    backend: {
430        rust: {
431            enabled: true,
432        },
433    },
434}
435
436sh_binary {
437    name: "aidl_hash_gen",
438    src: "hash_gen.sh",
439    host_supported: true,
440}
441