1//
2// Copyright (C) 2010 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    // See: http://go/android-license-faq
19    default_applicable_licenses: [
20        "cts_apps_CtsVerifier_opencv_license",
21        "Android-Apache-2.0",
22        "cts_apps_CtsVerifier_fatcow_license",
23    ],
24}
25
26license {
27    name: "cts_apps_CtsVerifier_opencv_license",
28    package_name: "opencv",
29    license_kinds: [
30        "SPDX-license-identifier-BSD",
31    ],
32    license_text: [
33        "libs/opencv-android_LICENSE",
34        "res/raw/opencv_library_license",
35    ],
36}
37
38// See: src/com/android/cts/verifier/features/FeatureSummaryActivity.java
39license {
40    name: "cts_apps_CtsVerifier_fatcow_license",
41    package_name: "fatcow icons",
42    license_kinds: [
43        "SPDX-license-identifier-CC-BY-3.0",
44    ],
45    license_text: ["LICENSE_CC_BY"],
46}
47
48filegroup {
49    name: "CtsVerifierMockVrListenerServiceFiles",
50    srcs: ["src/com/android/cts/verifier/vr/MockVrListenerService.java"],
51}
52
53android_library {
54    name: "CtsVerifierLibT",
55    defaults: ["cts_error_prone_rules_tests"],
56
57    srcs: [
58        "src/**/*.java",
59        "src/**/*.kt",
60        "src/**/I*.aidl",
61    ],
62
63    aidl: {
64        include_dirs: ["frameworks/native/aidl/gui"],
65    },
66
67    static_libs: [
68        "android.media.audio-aconfig-java",
69        "android-ex-camera2",
70        "compatibility-common-util-devicesidelib",
71        "cts-sensors-tests",
72        "cts-camera-performance-tests",
73        "ctstestrunner-axt",
74        "apache-commons-math",
75        "androidplot",
76        "ctsverifier-opencv",
77        "core-tests-support",
78        "androidx.appcompat_appcompat",
79        "androidx.fragment_fragment",
80        "androidx.legacy_legacy-support-v4",
81        "androidx.preference_preference",
82        "mockito-target-minus-junit4",
83        "mockwebserver",
84        "compatibility-device-util-axt",
85        "platform-test-annotations",
86        "cts-security-test-support-library",
87        "cts-midi-lib",
88        "cbor-java",
89        "CtsCameraUtils",
90        "androidx.legacy_legacy-support-v4",
91        "CtsForceStopHelper-constants",
92        "ctsmediautil",
93        "DpmWrapper",
94        "MediaPerformanceClassCommon",
95        "com_android_wm_shell_flags_lib",
96    ],
97
98    libs: [
99        "telephony-common",
100        "android.test.runner.stubs",
101        "android.test.base.stubs",
102        "android.test.mock.stubs",
103        "android.car-test-stubs",
104        "voip-common",
105        "truth",
106    ],
107
108    platform_apis: true,
109
110    optimize: {
111        proguard_flags_files: ["proguard.flags"],
112    },
113
114    dex_preopt: {
115        enabled: false,
116    },
117}
118
119android_test {
120    name: "CtsVerifier",
121    static_libs: [
122        "CtsVerifierLibT",
123    ],
124
125    compile_multilib: "both",
126
127    additional_manifests: ["AndroidManifest-verifierConfig.xml"],
128
129    jni_libs: [
130        "libctsverifier_jni",
131        "libctsnativemidi_jni",
132        "libaudioloopback_jni",
133        "libmegaaudio_jni",
134    ],
135}
136
137// opencv library
138java_import {
139    name: "ctsverifier-opencv",
140    jars: ["libs/opencv3-android.jar"],
141}
142
143// Build CTS verifier framework as a library.
144android_library {
145    name: "cts-verifier-framework",
146
147    sdk_version: "test_current",
148    min_sdk_version: "29",
149    resource_dirs: ["res"],
150    srcs: [
151        "src/com/android/cts/verifier/*.java",
152        "src/**/I*.aidl",
153    ],
154
155    static_libs: [
156        "androidx.legacy_legacy-support-v4",
157        "compatibility-common-util-devicesidelib",
158        "compatibility-device-util-axt",
159    ],
160
161}
162
163filegroup {
164    name: "pre_installed_apps",
165    srcs: [
166        ":CtsDefaultNotesApp",
167        ":CtsDeviceControlsApp",
168        ":CtsEmptyDeviceAdmin",
169        ":CtsEmptyDeviceOwner",
170        ":CtsPermissionApp",
171        ":CtsForceStopHelper",
172        ":NotificationBot",
173        ":CrossProfileTestApp",
174        ":CtsTtsEngineSelectorTestHelper",
175        ":CtsTtsEngineSelectorTestHelper2",
176    ],
177}
178
179// Apps to be installed as Instant App using adb install --instant
180filegroup {
181    name: "pre_installed_instant_app",
182    srcs: [
183        ":CtsVerifierInstantApp",
184    ],
185}
186
187filegroup {
188    name: "other_required_apps",
189    srcs: [
190        ":CtsCarWatchdogCompanionApp",
191        ":CtsTileServiceApp",
192        ":CtsVerifierUSBCompanion",
193        ":CtsVpnFirewallAppApi23",
194        ":CtsVpnFirewallAppApi24",
195        ":CtsVpnFirewallAppNotAlwaysOn",
196        ":jetpack-camera-app",
197    ],
198}
199
200filegroup {
201    name: "cts_apps_to_include",
202    srcs: [
203        ":pre_installed_apps",
204        ":pre_installed_instant_app",
205        ":other_required_apps",
206    ],
207}
208
209//
210// Creates a "cts-verifier" directory that will contain:
211//
212// 1. Out directory with a "android-cts-verifier" containing the CTS Verifier
213//    and other binaries it needs.
214//
215// 2. Zipped version of the android-cts-verifier directory to be included with
216//    the build distribution.
217//
218genrule {
219    name: "android-cts-verifier",
220    srcs: [
221        ":android-cts-verifier-notice",
222        ":cts_apps_to_include",
223        ":CtsVerifier",
224        ":camera-its",
225        ":camera-webcam-test",
226        ":multidevice-test",
227    ],
228    tools: [
229        "soong_zip",
230        "merge_zips",
231    ],
232    out: ["android-cts-verifier.zip"],
233    cmd: "echo $(locations :cts_apps_to_include) $(location :CtsVerifier) $(location :android-cts-verifier-notice) > $(genDir)/list &&" +
234        " $(location soong_zip) -o $(genDir)/cts-verifier.zip -j -P android-cts-verifier -l $(genDir)/list &&" +
235        " $(location merge_zips) $(out) $(genDir)/cts-verifier.zip $(location :camera-its) $(location :camera-webcam-test) $(location :multidevice-test)",
236    dists: [
237        {
238            targets: ["cts"],
239        },
240    ],
241}
242
243gen_notice {
244    name: "android-cts-verifier-notice",
245    for: ["android-cts-verifier"],
246    stem: "NOTICE",
247    suffix: ".txt",
248}
249
250filegroup {
251    name: "android-cts-verifier-for-make",
252    srcs: [":android-cts-verifier"],
253    export_to_make_var: "SOONG_ANDROID_CTS_VERIFIER_ZIP",
254}
255