1/*
2 * Copyright (C) 2021 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
17// Targets for the Audio Test Harness Server Components.
18// The Server allows for communication with host-side Audio Devices from
19// any connected gRPC clients either on another host or a device.
20// BINARIES ==============================================================
21
22package {
23    default_team: "trendy_team_android_video_image_codecs",
24    default_applicable_licenses: ["Android-Apache-2.0"],
25}
26
27java_binary_host {
28    name: "audiotestharness-clicapturer",
29    srcs: [
30        "src/main/java/com/android/media/audiotestharness/server/examples/AudioTestHarnessCliCapturer.java",
31    ],
32    static_libs: [
33        "audiotestharness-javasoundlib",
34        "audiotestharness-commonlib-lite",
35        "audiotestharness-commonprotolib-lite",
36        "audiotestharness-corelib",
37        "guava",
38    ],
39    manifest: "cli-capturer-manifest.inf",
40}
41
42java_binary_host {
43    name: "audiotestharness-server",
44    static_libs: [
45        "audiotestharness-serverlib",
46    ],
47    manifest: "server-manifest.inf",
48}
49
50// LIBRARIES ==============================================================
51
52java_library_host {
53    name: "audiotestharness-serverlib",
54    srcs: [
55        "src/main/java/com/android/media/audiotestharness/server/*.java",
56    ],
57    static_libs: [
58        "audiotestharness-servicelib",
59        "audiotestharness-utilitylib",
60        "audiotestharness-javasoundlib",
61        "audiotestharness-corelib",
62        "audiotestharness-configlib",
63        "audiotestharness-servicegrpclib-full",
64        "grpc-java-netty-shaded",
65    ],
66}
67
68java_library_host {
69    name: "audiotestharness-corelib",
70    srcs: [
71        "src/main/java/com/android/media/audiotestharness/server/core/*.java",
72    ],
73    static_libs: [
74        "audiotestharness-commonlib-full",
75        "audiotestharness-commonprotolib-full",
76        "guava",
77    ],
78}
79
80java_library_host {
81    name: "audiotestharness-configlib",
82    srcs: [
83        "src/main/java/com/android/media/audiotestharness/server/config/*.java",
84    ],
85    libs: [
86        "auto_value_annotations",
87    ],
88    static_libs: [
89        "audiotestharness-commonlib-full",
90        "audiotestharness-commonprotolib-full",
91        "guava",
92        "guice",
93    ],
94    plugins: [
95        "auto_value_plugin",
96    ],
97}
98
99java_library_host {
100    name: "audiotestharness-servicelib",
101    srcs: [
102        "src/main/java/com/android/media/audiotestharness/server/service/*.java",
103    ],
104    static_libs: [
105        "audiotestharness-commonlib-full",
106        "audiotestharness-commonprotolib-full",
107        "audiotestharness-servicegrpclib-full",
108        "audiotestharness-corelib",
109        "audiotestharness-configlib",
110        "guava",
111        "guice",
112    ],
113}
114
115java_library_host {
116    name: "audiotestharness-javasoundlib",
117    srcs: [
118        "src/main/java/com/android/media/audiotestharness/server/javasound/*.java",
119    ],
120    static_libs: [
121        "audiotestharness-corelib",
122        "audiotestharness-commonlib-full",
123        "audiotestharness-commonprotolib-full",
124        "guava",
125        "guice",
126    ],
127}
128
129java_library_host {
130    name: "audiotestharness-utilitylib",
131    srcs: [
132        "src/main/java/com/android/media/audiotestharness/server/utility/*.java",
133    ],
134}
135
136// TESTS ==============================================================
137
138java_test_host {
139    name: "audiotestharness-serverlib-tests",
140    srcs: [
141        "src/test/java/com/android/media/audiotestharness/server/*.java",
142    ],
143    static_libs: [
144        "audiotestharness-serverlib",
145        "junit",
146        "junit-params",
147
148        "mockito",
149        "objenesis",
150
151        "audiotestharness-servicegrpclib-full",
152        "grpc-java-netty-shaded",
153    ],
154    test_options: {
155        unit_test: false,
156    },
157}
158
159java_test_host {
160    name: "audiotestharness-servicelib-tests",
161    srcs: [
162        "src/test/java/com/android/media/audiotestharness/server/service/*.java",
163    ],
164    static_libs: [
165        "audiotestharness-servicelib",
166        "audiotestharness-corelib",
167        "audiotestharness-servicegrpclib-full",
168        "junit",
169        "junit-params",
170        "grpc-java-testing",
171        "guava",
172        "mockito",
173        "objenesis",
174    ],
175    test_options: {
176        unit_test: false,
177    },
178}
179
180java_test_host {
181    name: "audiotestharness-javasoundlib-tests",
182    srcs: [
183        "src/test/java/com/android/media/audiotestharness/server/javasound/*.java",
184    ],
185    static_libs: [
186        "audiotestharness-corelib",
187        "audiotestharness-javasoundlib",
188        "audiotestharness-commonlib-full",
189        "audiotestharness-commonprotolib-full",
190
191        "guava",
192        "junit-host",
193
194        "mockito",
195        "objenesis",
196    ],
197    test_options: {
198        unit_test: false,
199    },
200}
201
202java_test_host {
203    name: "audiotestharness-utilitylib-tests",
204    srcs: [
205        "src/test/java/com/android/media/audiotestharness/server/utility/*.java",
206    ],
207    static_libs: [
208        "audiotestharness-utilitylib",
209        "junit",
210    ],
211    test_options: {
212        unit_test: false,
213    },
214}
215