blob: ac62687f1b7702e455d2f27d8b90bd7783e5e8a5 [file] [log] [blame]
Makoto Onuki3aefe332023-10-06 10:02:07 -07001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "frameworks_base_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["frameworks_base_license"],
8}
9
10filegroup {
11 name: "ravenwood-annotations",
12 srcs: [
13 "annotations-src/**/*.java",
14 ],
Anton Hanssond82cbc72023-10-30 20:00:39 +000015 path: "annotations-src",
Makoto Onuki3aefe332023-10-06 10:02:07 -070016 visibility: ["//visibility:public"],
17}
18
Makoto Onukidfade842024-05-02 15:42:08 -070019filegroup {
20 name: "ravenwood-services-policies",
21 srcs: [
22 "texts/ravenwood-services-policies.txt",
23 ],
24 visibility: ["//visibility:public"],
25}
26
27filegroup {
28 name: "ravenwood-framework-policies",
29 srcs: [
30 "texts/ravenwood-framework-policies.txt",
31 ],
32 visibility: ["//visibility:public"],
33}
34
35filegroup {
36 name: "ravenwood-standard-options",
37 srcs: [
38 "texts/ravenwood-standard-options.txt",
39 ],
40 visibility: ["//visibility:public"],
41}
42
43filegroup {
44 name: "ravenwood-annotation-allowed-classes",
45 srcs: [
46 "texts/ravenwood-annotation-allowed-classes.txt",
47 ],
48 visibility: ["//visibility:public"],
49}
50
Makoto Onuki3aefe332023-10-06 10:02:07 -070051java_library {
52 name: "ravenwood-annotations-lib",
53 srcs: [":ravenwood-annotations"],
54 sdk_version: "core_current",
55 host_supported: true,
56 visibility: ["//visibility:public"],
57}
Jeff Sharkey91f414e2023-11-07 15:43:59 -070058
Makoto Onukidf9cd262024-05-16 15:44:38 -070059// This and the next module contain the same classes with different implementations.
60// "ravenwood-runtime-common-device" will be statically linked in device side tests.
61// "ravenwood-runtime-common-ravenwood" will only exist in ravenwood-runtime, which will take
62// precedence even if the test jar (accidentally) contains "ravenwood-runtime-common-device".
63// "ravenwood-runtime-common" uses it to detect if the rutime is Ravenwood or not.
64java_library {
65 name: "ravenwood-runtime-common-ravenwood",
66 host_supported: true,
67 sdk_version: "core_current",
68 srcs: [
69 "runtime-common-ravenwood-src/**/*.java",
70 ],
Makoto Onukid619e432024-07-19 16:45:02 -070071 visibility: [
72 // Some tests need to access the utilities.
73 ":__subpackages__",
74 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -070075}
76
77java_library {
78 name: "ravenwood-runtime-common-device",
79 host_supported: true,
80 sdk_version: "core_current",
81 srcs: [
82 "runtime-common-device-src/**/*.java",
83 ],
84 visibility: ["//visibility:private"],
85}
86
87java_library {
88 name: "ravenwood-runtime-common",
89 host_supported: true,
90 sdk_version: "core_current",
91 srcs: [
92 "runtime-common-src/**/*.java",
93 ],
94 libs: [
95 "ravenwood-runtime-common-ravenwood",
96 ],
97 visibility: ["//visibility:private"],
98}
99
Makoto Onuki053eac82024-02-13 10:31:18 -0800100java_library_host {
101 name: "ravenwood-helper-libcore-runtime.host",
102 srcs: [
103 "runtime-helper-src/libcore-fake/**/*.java",
104 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700105 static_libs: [
106 "ravenwood-runtime-common",
107 ],
Makoto Onuki053eac82024-02-13 10:31:18 -0800108 visibility: ["//visibility:private"],
109}
110
111java_host_for_device {
112 name: "ravenwood-helper-libcore-runtime",
113 libs: [
114 "ravenwood-helper-libcore-runtime.host",
115 ],
116 visibility: ["//visibility:private"],
117}
118
119java_library {
120 name: "ravenwood-helper-framework-runtime",
121 srcs: [
122 "runtime-helper-src/framework/**/*.java",
123 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700124 static_libs: [
125 "ravenwood-runtime-common",
126 ],
Makoto Onuki053eac82024-02-13 10:31:18 -0800127 libs: [
128 "framework-minus-apex.ravenwood",
Makoto Onuki50276f02024-02-13 14:58:56 -0800129 "ravenwood-junit",
Makoto Onuki053eac82024-02-13 10:31:18 -0800130 ],
131 visibility: ["//visibility:private"],
132}
133
134// Combine ravenwood-helper-*-runtime and create a single library, which we include
135// in the ravenwood runtime.
136// We do it this way rather than including the individual jars in the runtime, because
137// for some reason we couldn't include a java_host_for_device module in the ravenwood runtime.
138java_library {
139 name: "ravenwood-helper-runtime",
140 defaults: ["ravenwood-internal-only-visibility-java"],
141 static_libs: [
142 "ravenwood-helper-framework-runtime",
143 "ravenwood-helper-libcore-runtime",
144 ],
145}
146
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700147java_library {
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700148 name: "ravenwood-junit-impl",
149 srcs: [
150 "junit-src/**/*.java",
151 "junit-impl-src/**/*.java",
152 ],
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700153 static_libs: [
154 "androidx.test.monitor-for-device",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700155 "ravenwood-runtime-common",
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700156 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700157 libs: [
Jihoon Kang1e37ed32024-08-30 00:29:12 +0000158 "android.test.mock.impl",
Jeff Sharkey5e210d72023-11-10 11:22:05 -0700159 "framework-minus-apex.ravenwood",
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700160 "ravenwood-framework",
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700161 "services.core.ravenwood",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700162 "junit",
163 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700164 visibility: ["//frameworks/base"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700165 jarjar_rules: ":ravenwood-services-jarjar-rules",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700166}
167
Jeff Sharkey7037e352024-02-27 14:22:24 -0700168// Separated out from ravenwood-junit-impl since it needs to compile
169// against `module_current`
170java_library {
171 name: "ravenwood-junit-impl-flag",
172 srcs: [
173 "junit-flag-src/**/*.java",
174 ],
Liana Kazanova0c16dd32024-06-25 20:40:04 +0000175 sdk_version: "module_current",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700176 libs: [
177 "junit",
178 "flag-junit",
179 ],
180 visibility: ["//visibility:public"],
181}
182
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700183// Carefully compiles against only module_current to support tests that
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700184// want to verify they're unbundled. The "impl" library above is what
185// ships inside the Ravenwood environment to actually drive any API
186// access to implementation details.
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700187// We can't use test_current here because this library needs to be statically
188// linked to mainline tests as well, which can't use test APIs because they
189// need to be able to run on multiple API levels.
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700190java_library {
191 name: "ravenwood-junit",
192 srcs: [
193 "junit-src/**/*.java",
194 "junit-stub-src/**/*.java",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700195 "junit-flag-src/**/*.java",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700196 ],
Felipe Lemedfbfb232024-07-23 05:31:38 +0000197 sdk_version: "module_current",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700198 static_libs: [
199 "ravenwood-runtime-common",
200 "ravenwood-runtime-common-device",
201 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700202 libs: [
203 "junit",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700204 "flag-junit",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700205 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700206 visibility: ["//visibility:public"],
207}
Jeff Sharkey4ee8a652023-11-14 08:45:56 -0700208
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700209// Library used to publish a handful of `android.ravenwood` APIs into
210// the Ravenwood BCP; we don't want to publish these APIs into the BCP
211// on physical devices, which is why this is a separate library
212java_library {
213 name: "ravenwood-framework",
214 srcs: [
215 "framework-src/**/*.java",
216 ],
217 libs: [
218 "framework-minus-apex.ravenwood",
219 ],
220 sdk_version: "core_current",
221 visibility: ["//visibility:public"],
222}
223
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700224java_host_for_device {
225 name: "androidx.test.monitor-for-device",
226 libs: [
227 "androidx.test.monitor-for-host",
228 ],
229}
230
231java_device_for_host {
232 name: "androidx.test.monitor-for-host",
233 libs: [
234 "androidx.test.monitor",
235 ],
236}
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700237
238filegroup {
Makoto Onukif38d5992024-05-30 10:40:50 -0700239 name: "ravenwood-framework-jarjar-rules",
240 srcs: ["texts/ravenwood-framework-jarjar-rules.txt"],
241 visibility: ["//frameworks/base"],
242}
243
244filegroup {
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700245 name: "ravenwood-services-jarjar-rules",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700246 srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700247 visibility: ["//frameworks/base"],
248}
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700249
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700250cc_library_shared {
251 name: "libravenwood_runtime",
252 host_supported: true,
253
254 cflags: [
255 "-Wall",
256 "-Werror",
257 "-Wno-unused-parameter",
258 "-Wthread-safety",
259 ],
260
261 srcs: [
Makoto Onukidf9cd262024-05-16 15:44:38 -0700262 "runtime-jni/*.cpp",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700263 ],
264
265 shared_libs: [
266 "libbase",
267 "liblog",
268 "libnativehelper",
269 "libutils",
270 "libcutils",
271 ],
272 visibility: ["//frameworks/base"],
273}
274
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700275// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
276// The "test" just shows the available stats filenames.
277sh_test_host {
278 name: "ravenwood-stats-checker",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700279 src: "scripts/ravenwood-stats-checker.sh",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700280 test_suites: ["general-tests"],
281 data: [
Makoto Onukifcf5cde2024-08-02 09:11:46 -0700282 ":hoststubgen_framework-minus-apex_stats.csv",
283 ":hoststubgen_framework-minus-apex_apis.csv",
284 ":hoststubgen_framework-minus-apex_keep_all.txt",
285 ":hoststubgen_framework-minus-apex_dump.txt",
Makoto Onuki134a4152024-06-26 14:21:12 -0700286 ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}",
287 ":services.core.ravenwood-base{hoststubgen_services.core_apis.csv}",
288 ":services.core.ravenwood-base{hoststubgen_services.core_keep_all.txt}",
289 ":services.core.ravenwood-base{hoststubgen_services.core_dump.txt}",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700290 ],
291}
Makoto Onukie5e97272024-05-23 10:49:31 -0700292
293java_library {
294 name: "services.fakes.ravenwood-jarjar",
295 installable: false,
296 srcs: [":services.fakes-sources"],
297 libs: [
298 "ravenwood-framework",
299 "services.core.ravenwood",
300 ],
301 jarjar_rules: ":ravenwood-services-jarjar-rules",
302 visibility: ["//visibility:private"],
303}
304
305java_library {
306 name: "mockito-ravenwood-prebuilt",
307 installable: false,
308 static_libs: [
309 "mockito-robolectric-prebuilt",
310 ],
311}
312
313java_library {
314 name: "inline-mockito-ravenwood-prebuilt",
315 installable: false,
316 static_libs: [
317 "inline-mockito-robolectric-prebuilt",
318 ],
319}
320
321android_ravenwood_libgroup {
322 name: "ravenwood-runtime",
Makoto Onukid619e432024-07-19 16:45:02 -0700323 data: [
John Wud0371fa2024-09-13 20:58:49 +0000324 ":framework-res",
325 ":ravenwood-empty-res",
Makoto Onuki8ca3b7f2024-09-17 09:45:39 -0700326 ":framework-platform-compat-config",
327 ":services-platform-compat-config",
Makoto Onukid619e432024-07-19 16:45:02 -0700328 ],
Makoto Onukie5e97272024-05-23 10:49:31 -0700329 libs: [
330 "100-framework-minus-apex.ravenwood",
331 "200-kxml2-android",
332
333 "ravenwood-runtime-common-ravenwood",
334
335 "android.test.mock.ravenwood",
336 "ravenwood-helper-runtime",
337 "hoststubgen-helper-runtime.ravenwood",
338 "services.core.ravenwood-jarjar",
339 "services.fakes.ravenwood-jarjar",
340
Makoto Onuki953445b2024-07-19 11:21:29 -0700341 // ICU
342 "core-icu4j-for-host.ravenwood",
343 "icu4j-icudata-jarjar",
344 "icu4j-icutzdata-jarjar",
345
Makoto Onukie5e97272024-05-23 10:49:31 -0700346 // Provide runtime versions of utils linked in below
347 "junit",
348 "truth",
349 "flag-junit",
350 "ravenwood-framework",
351 "ravenwood-junit-impl",
352 "ravenwood-junit-impl-flag",
353 "mockito-ravenwood-prebuilt",
354 "inline-mockito-ravenwood-prebuilt",
355
356 // It's a stub, so it should be towards the end.
357 "z00-all-updatable-modules-system-stubs",
358 ],
359 jni_libs: [
360 "libandroid_runtime",
361 "libravenwood_runtime",
362 ],
363}
364
365android_ravenwood_libgroup {
366 name: "ravenwood-utils",
367 libs: [
368 "junit",
369 "truth",
370 "flag-junit",
371 "ravenwood-framework",
372 "ravenwood-junit",
373 "mockito-ravenwood-prebuilt",
374 "inline-mockito-ravenwood-prebuilt",
375 ],
376}