1// Copyright (C) 2023 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
24aidl_interface {
25    name: "android.aidl.test.trunk",
26    srcs: ["android/aidl/test/trunk/*.aidl"],
27    flags: ["-Werror"],
28    gen_trace: true,
29    backend: {
30        cpp: {
31            gen_log: true,
32        },
33        ndk: {
34            gen_log: true,
35        },
36        java: {
37            platform_apis: true,
38        },
39        rust: {
40            enabled: true,
41        },
42    },
43    versions_with_info: [
44        {
45            version: "1",
46            imports: [],
47        },
48    ],
49    frozen: false,
50    // Some tests rely on the last version not being frozen.
51    // Owner is set so the interface isn't frozen with the rest.
52    owner: "aosp",
53
54}
55
56// Test using the same client and server source code including different
57// versions of the generated AIDL library.
58// This is an example of a possible solution to dealing with different
59// configurations of the build without needing to modify the source code.
60// This is the version of the test that uses the V1 library with the
61// V2 code behind #ifdefs.
62cc_test {
63    name: "aidl_ndk_V1_trunk_stable_unittest",
64    srcs: ["trunk_ndk_unittest.cpp"],
65    shared_libs: [
66        "libbinder_ndk",
67        "libbase",
68        "libcutils",
69        "liblog",
70    ],
71    cflags: [
72        "-DAIDL_TEST_TRUNK_VER=1",
73    ],
74    static_libs: [
75        "android.aidl.test.trunk-V1-ndk",
76    ],
77    require_root: true,
78}
79
80// This is the version of the test that uses the latest V2 library.
81cc_test {
82    name: "aidl_ndk_V2_trunk_stable_unittest",
83    srcs: ["trunk_ndk_unittest.cpp"],
84    shared_libs: [
85        "libcutils",
86        "liblog",
87        "libbinder_ndk",
88        "libbase",
89    ],
90    cflags: [
91        "-DAIDL_TEST_TRUNK_VER=2",
92    ],
93    static_libs: [
94        "android.aidl.test.trunk-V2-ndk",
95    ],
96    require_root: true,
97}
98