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-cc", 32 "soong-genrule", 33 "soong-phony", 34 "soong-java", 35 "soong-rust", 36 ], 37 srcs: [ 38 "aidl_interface.go", 39 "properties.go", 40 "aidl_api.go", 41 "aidl_gen_rule.go", 42 "aidl_interface_backends.go", 43 "aidl_interface_metadata_singleton.go", 44 "aidl_mapping.go", 45 "aidl_rust_source_provider.go", 46 "aidl_utils.go", 47 ], 48 testSrcs: [ 49 "aidl_test.go", 50 ], 51 pluginFor: ["soong_build"], 52} 53 54aidl_interfaces_metadata { 55 name: "aidl_metadata_json", 56 visibility: ["//system/tools/aidl:__subpackages__"], 57} 58 59// These configurations are inherited by all aidl-gen modules 60// TODO(b/146436251): default isn't applied because the module is created 61// in PreArchMutators, when import behavior becomes explicit, the logic can 62// be moved back to LoadHook, and then default can be applied as well. 63cc_defaults { 64 name: "aidl-cpp-module-defaults", 65 target: { 66 darwin: { 67 enabled: false, 68 }, 69 }, 70} 71 72java_defaults { 73 name: "aidl-java-module-defaults", 74} 75 76rust_defaults { 77 name: "aidl-rust-module-defaults", 78} 79 80// Tests 81 82filegroup { 83 name: "aidl-test-filegroup", 84 srcs: [ 85 "tests_1/some_package/IFoo.aidl", 86 "tests_1/some_package/Thing.aidl", 87 "tests_1/some_package/sub_package/*.aidl", 88 ], 89} 90 91aidl_interface { 92 name: "test-piece-1", 93 local_include_dir: "tests_1", 94 vendor_available: true, 95 double_loadable: true, 96 host_supported: true, 97 flags: ["-Werror"], 98 srcs: [ 99 "tests_1/some_package/IFoo.aidl", 100 "tests_1/some_package/Thing.aidl", 101 "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup 102 ], 103 versions: [ 104 "1", 105 "2", 106 "3", 107 "4", 108 ], 109} 110 111aidl_interface { 112 name: "test-piece-ndk-sdk-29", 113 local_include_dir: "tests_1", 114 flags: ["-Werror"], 115 srcs: [ 116 "tests_1/some_package/IFoo.aidl", 117 "tests_1/some_package/Thing.aidl", 118 "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup 119 ], 120 unstable: true, 121 backend: { ndk: { sdk_version: "29", }, }, 122} 123aidl_interface { 124 name: "test-piece-ndk-sdk-30", 125 local_include_dir: "tests_1", 126 flags: ["-Werror"], 127 srcs: [ 128 "tests_1/some_package/IFoo.aidl", 129 "tests_1/some_package/Thing.aidl", 130 "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup 131 ], 132 unstable: true, 133 backend: { ndk: { sdk_version: "30", }, }, 134} 135aidl_interface { 136 name: "test-piece-ndk-sdk-31", 137 local_include_dir: "tests_1", 138 flags: ["-Werror"], 139 srcs: [ 140 "tests_1/some_package/IFoo.aidl", 141 "tests_1/some_package/Thing.aidl", 142 "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup 143 ], 144 unstable: true, 145 backend: { ndk: { sdk_version: "31", }, }, 146} 147 148aidl_interface { 149 name: "test-piece-2", 150 local_include_dir: "tests_1", 151 flags: ["-Werror"], 152 srcs: [ 153 "tests_1/INoPackage.aidl", 154 "tests_1/some_package/IBar.aidl", 155 ], 156 imports: [ 157 "test-piece-1-V3", 158 ], 159 backend: { 160 java: { 161 platform_apis: true, 162 }, 163 }, 164 gen_trace: true, 165 versions_with_info: [ 166 { 167 version: "1", 168 imports: ["test-piece-1-V3"], 169 }, 170 ], 171 172} 173 174aidl_interface { 175 name: "test-piece-3", 176 local_include_dir: "tests_1", 177 flags: ["-Werror"], 178 srcs: [ 179 "tests_1/other_package/IBaz.aidl", 180 ], 181 imports: [ 182 "test-piece-2-V1", 183 ], 184 backend: { 185 java: { 186 platform_apis: true, 187 }, 188 }, 189 gen_trace: true, 190 versions: ["1"], 191} 192 193aidl_interface { 194 name: "test-piece-4", 195 local_include_dir: "tests_2", 196 flags: ["-Werror"], 197 srcs: [ 198 "tests_2/another_package/IFaz.aidl", 199 ], 200 imports: [ 201 "test-piece-1-V3", 202 ], 203 backend: { 204 java: { 205 platform_apis: true, 206 }, 207 }, 208 gen_trace: true, 209 versions: ["1"], 210 dumpapi: { 211 no_license: true, 212 }, 213} 214 215aidl_interface { 216 name: "test-root-package", 217 flags: ["-Werror"], 218 srcs: [ 219 "test_package/IBaz.aidl", 220 ], 221 imports: [ 222 "test-piece-2-V1", 223 ], 224 backend: { 225 java: { 226 platform_apis: true, 227 }, 228 }, 229 gen_trace: true, 230 versions: [ 231 "1", 232 "2", 233 "3", 234 ], 235} 236 237aidl_interface { 238 name: "test-piece-5", 239 unstable: true, 240 local_include_dir: "tests_3", 241 flags: ["-Werror"], 242 srcs: [ 243 "tests_3/EmptyParcelable.aidl", 244 "tests_3/IEmptyInterface.aidl", 245 ], 246} 247 248aidl_interface { 249 name: "test-piece-6", 250 unstable: true, 251 local_include_dir: "tests_6", 252 flags: ["-Werror"], 253 srcs: [ 254 "tests_6/test6/Bar.aidl", 255 "tests_6/test6/Foo.aidl", 256 ], 257} 258 259// These test that a parcel imported from A->B->C will have the required dependencies to link in 260// all backends (C++ backends need to link direclty against the constructor of the parcelable 261// in order to work) 262aidl_interface { 263 name: "tests_transitive_parcel.a", 264 flags: ["-Werror"], 265 srcs: ["tests_transitive_parcel/a/*.aidl"], 266 imports: [ 267 "tests_transitive_parcel.b", 268 "tests_transitive_parcel.c", 269 ], 270 unstable: true, 271 backend: { 272 rust: { 273 enabled: true, 274 }, 275 }, 276} 277 278aidl_interface { 279 name: "tests_transitive_parcel.b", 280 flags: ["-Werror"], 281 srcs: ["tests_transitive_parcel/b/*.aidl"], 282 imports: ["tests_transitive_parcel.c"], 283 unstable: true, 284 backend: { 285 rust: { 286 enabled: true, 287 }, 288 }, 289} 290 291aidl_interface { 292 name: "tests_transitive_parcel.c", 293 flags: ["-Werror"], 294 srcs: ["tests_transitive_parcel/c/*.aidl"], 295 unstable: true, 296 backend: { 297 rust: { 298 enabled: true, 299 }, 300 }, 301} 302 303sh_binary { 304 name: "aidl_hash_gen", 305 src: "hash_gen.sh", 306 host_supported: true, 307} 308