blob: 11b66fc3f1e5d9433e0a4ee034fb957bb0bf4e5c [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"],
John Wu98346162024-09-26 22:59:40 +00008
9 // OWNER: g/ravenwood
10 // Bug component: 25698
11 default_team: "trendy_team_framework_backstage_power",
Makoto Onuki3aefe332023-10-06 10:02:07 -070012}
13
14filegroup {
Makoto Onukidfade842024-05-02 15:42:08 -070015 name: "ravenwood-services-policies",
16 srcs: [
17 "texts/ravenwood-services-policies.txt",
18 ],
19 visibility: ["//visibility:public"],
20}
21
22filegroup {
23 name: "ravenwood-framework-policies",
24 srcs: [
25 "texts/ravenwood-framework-policies.txt",
26 ],
27 visibility: ["//visibility:public"],
28}
29
30filegroup {
31 name: "ravenwood-standard-options",
32 srcs: [
33 "texts/ravenwood-standard-options.txt",
34 ],
35 visibility: ["//visibility:public"],
36}
37
38filegroup {
39 name: "ravenwood-annotation-allowed-classes",
40 srcs: [
41 "texts/ravenwood-annotation-allowed-classes.txt",
42 ],
43 visibility: ["//visibility:public"],
44}
45
Makoto Onukidf9cd262024-05-16 15:44:38 -070046// This and the next module contain the same classes with different implementations.
47// "ravenwood-runtime-common-device" will be statically linked in device side tests.
48// "ravenwood-runtime-common-ravenwood" will only exist in ravenwood-runtime, which will take
49// precedence even if the test jar (accidentally) contains "ravenwood-runtime-common-device".
50// "ravenwood-runtime-common" uses it to detect if the rutime is Ravenwood or not.
51java_library {
52 name: "ravenwood-runtime-common-ravenwood",
53 host_supported: true,
54 sdk_version: "core_current",
55 srcs: [
56 "runtime-common-ravenwood-src/**/*.java",
57 ],
Makoto Onukid619e432024-07-19 16:45:02 -070058 visibility: [
59 // Some tests need to access the utilities.
60 ":__subpackages__",
61 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -070062}
63
64java_library {
65 name: "ravenwood-runtime-common-device",
66 host_supported: true,
67 sdk_version: "core_current",
68 srcs: [
69 "runtime-common-device-src/**/*.java",
70 ],
71 visibility: ["//visibility:private"],
72}
73
74java_library {
75 name: "ravenwood-runtime-common",
76 host_supported: true,
77 sdk_version: "core_current",
78 srcs: [
79 "runtime-common-src/**/*.java",
80 ],
81 libs: [
82 "ravenwood-runtime-common-ravenwood",
83 ],
John Wu98346162024-09-26 22:59:40 +000084 static_libs: [
85 "framework-annotations-lib", // should it be "libs" instead?
86 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -070087 visibility: ["//visibility:private"],
88}
89
Makoto Onuki053eac82024-02-13 10:31:18 -080090java_library_host {
91 name: "ravenwood-helper-libcore-runtime.host",
92 srcs: [
93 "runtime-helper-src/libcore-fake/**/*.java",
94 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -070095 static_libs: [
96 "ravenwood-runtime-common",
97 ],
Makoto Onuki053eac82024-02-13 10:31:18 -080098 visibility: ["//visibility:private"],
99}
100
101java_host_for_device {
102 name: "ravenwood-helper-libcore-runtime",
103 libs: [
104 "ravenwood-helper-libcore-runtime.host",
105 ],
106 visibility: ["//visibility:private"],
107}
108
109java_library {
110 name: "ravenwood-helper-framework-runtime",
111 srcs: [
112 "runtime-helper-src/framework/**/*.java",
113 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700114 static_libs: [
115 "ravenwood-runtime-common",
116 ],
Makoto Onuki053eac82024-02-13 10:31:18 -0800117 libs: [
118 "framework-minus-apex.ravenwood",
John Wu98346162024-09-26 22:59:40 +0000119 "ravenwood-helper-libcore-runtime",
Makoto Onuki053eac82024-02-13 10:31:18 -0800120 ],
John Wu98346162024-09-26 22:59:40 +0000121 sdk_version: "core_current",
Makoto Onuki053eac82024-02-13 10:31:18 -0800122 visibility: ["//visibility:private"],
123}
124
125// Combine ravenwood-helper-*-runtime and create a single library, which we include
126// in the ravenwood runtime.
127// We do it this way rather than including the individual jars in the runtime, because
128// for some reason we couldn't include a java_host_for_device module in the ravenwood runtime.
129java_library {
130 name: "ravenwood-helper-runtime",
131 defaults: ["ravenwood-internal-only-visibility-java"],
132 static_libs: [
133 "ravenwood-helper-framework-runtime",
134 "ravenwood-helper-libcore-runtime",
135 ],
136}
137
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700138java_library {
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700139 name: "ravenwood-junit-impl",
140 srcs: [
141 "junit-src/**/*.java",
142 "junit-impl-src/**/*.java",
143 ],
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700144 static_libs: [
145 "androidx.test.monitor-for-device",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700146 "ravenwood-runtime-common",
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700147 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700148 libs: [
Jihoon Kang1e37ed32024-08-30 00:29:12 +0000149 "android.test.mock.impl",
Jeff Sharkey5e210d72023-11-10 11:22:05 -0700150 "framework-minus-apex.ravenwood",
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700151 "ravenwood-framework",
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700152 "services.core.ravenwood",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700153 "junit",
John Wu98346162024-09-26 22:59:40 +0000154 "framework-annotations-lib",
155 "ravenwood-helper-framework-runtime",
156 "ravenwood-helper-libcore-runtime",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700157 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700158 visibility: ["//frameworks/base"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700159 jarjar_rules: ":ravenwood-services-jarjar-rules",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700160}
161
John Wu98346162024-09-26 22:59:40 +0000162java_device_for_host {
163 name: "ravenwood-junit-impl-for-ravenizer",
164 libs: [
165 "ravenwood-junit-impl",
166 ],
167 visibility: [":__subpackages__"],
168}
169
Jeff Sharkey7037e352024-02-27 14:22:24 -0700170// Separated out from ravenwood-junit-impl since it needs to compile
171// against `module_current`
172java_library {
173 name: "ravenwood-junit-impl-flag",
174 srcs: [
175 "junit-flag-src/**/*.java",
176 ],
Liana Kazanova0c16dd32024-06-25 20:40:04 +0000177 sdk_version: "module_current",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700178 libs: [
179 "junit",
180 "flag-junit",
181 ],
182 visibility: ["//visibility:public"],
183}
184
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700185// Carefully compiles against only module_current to support tests that
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700186// want to verify they're unbundled. The "impl" library above is what
187// ships inside the Ravenwood environment to actually drive any API
188// access to implementation details.
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700189// We can't use test_current here because this library needs to be statically
190// linked to mainline tests as well, which can't use test APIs because they
191// need to be able to run on multiple API levels.
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700192java_library {
193 name: "ravenwood-junit",
194 srcs: [
195 "junit-src/**/*.java",
196 "junit-stub-src/**/*.java",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700197 "junit-flag-src/**/*.java",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700198 ],
Felipe Lemedfbfb232024-07-23 05:31:38 +0000199 sdk_version: "module_current",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700200 static_libs: [
201 "ravenwood-runtime-common",
202 "ravenwood-runtime-common-device",
203 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700204 libs: [
205 "junit",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700206 "flag-junit",
John Wu98346162024-09-26 22:59:40 +0000207 "framework-annotations-lib",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700208 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700209 visibility: ["//visibility:public"],
210}
Jeff Sharkey4ee8a652023-11-14 08:45:56 -0700211
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700212// Library used to publish a handful of `android.ravenwood` APIs into
213// the Ravenwood BCP; we don't want to publish these APIs into the BCP
214// on physical devices, which is why this is a separate library
215java_library {
216 name: "ravenwood-framework",
217 srcs: [
218 "framework-src/**/*.java",
219 ],
220 libs: [
221 "framework-minus-apex.ravenwood",
222 ],
223 sdk_version: "core_current",
224 visibility: ["//visibility:public"],
225}
226
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700227java_host_for_device {
228 name: "androidx.test.monitor-for-device",
229 libs: [
230 "androidx.test.monitor-for-host",
231 ],
232}
233
234java_device_for_host {
235 name: "androidx.test.monitor-for-host",
236 libs: [
237 "androidx.test.monitor",
238 ],
239}
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700240
241filegroup {
Makoto Onukif38d5992024-05-30 10:40:50 -0700242 name: "ravenwood-framework-jarjar-rules",
243 srcs: ["texts/ravenwood-framework-jarjar-rules.txt"],
244 visibility: ["//frameworks/base"],
245}
246
247filegroup {
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700248 name: "ravenwood-services-jarjar-rules",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700249 srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700250 visibility: ["//frameworks/base"],
251}
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700252
John Wu5e13e252024-09-25 00:43:28 +0000253cc_defaults {
254 name: "ravenwood_jni_defaults",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700255 cflags: [
256 "-Wall",
257 "-Werror",
258 "-Wno-unused-parameter",
259 "-Wthread-safety",
260 ],
John Wu5e13e252024-09-25 00:43:28 +0000261 static_libs: [
262 "libnativehelper_jvm",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700263 ],
John Wu5e13e252024-09-25 00:43:28 +0000264 shared_libs: [
265 "liblog",
266 ],
267}
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700268
John Wu5e13e252024-09-25 00:43:28 +0000269// We need this as a separate library because we need to overload the
270// sysprop symbols before libbase is loaded into the process
271cc_library_host_shared {
272 name: "libravenwood_sysprop",
273 defaults: ["ravenwood_jni_defaults"],
274 srcs: ["runtime-jni/ravenwood_sysprop.cpp"],
275}
276
277cc_library_host_shared {
278 name: "libravenwood_runtime",
279 defaults: ["ravenwood_jni_defaults"],
280 srcs: [
281 "runtime-jni/ravenwood_runtime.cpp",
282 "runtime-jni/ravenwood_os_constants.cpp",
283 ],
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700284 shared_libs: [
285 "libbase",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700286 "libutils",
287 "libcutils",
288 ],
289 visibility: ["//frameworks/base"],
290}
291
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700292// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
293// The "test" just shows the available stats filenames.
294sh_test_host {
295 name: "ravenwood-stats-checker",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700296 src: "scripts/ravenwood-stats-checker.sh",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700297 test_suites: ["general-tests"],
298 data: [
John Wu98346162024-09-26 22:59:40 +0000299 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_stats.csv}",
300 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_apis.csv}",
301 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_keep_all.txt}",
302 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_dump.txt}",
Makoto Onuki134a4152024-06-26 14:21:12 -0700303 ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}",
304 ":services.core.ravenwood-base{hoststubgen_services.core_apis.csv}",
305 ":services.core.ravenwood-base{hoststubgen_services.core_keep_all.txt}",
306 ":services.core.ravenwood-base{hoststubgen_services.core_dump.txt}",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700307 ],
308}
Makoto Onukie5e97272024-05-23 10:49:31 -0700309
310java_library {
311 name: "services.fakes.ravenwood-jarjar",
312 installable: false,
313 srcs: [":services.fakes-sources"],
314 libs: [
315 "ravenwood-framework",
316 "services.core.ravenwood",
317 ],
318 jarjar_rules: ":ravenwood-services-jarjar-rules",
319 visibility: ["//visibility:private"],
320}
321
322java_library {
323 name: "mockito-ravenwood-prebuilt",
324 installable: false,
325 static_libs: [
326 "mockito-robolectric-prebuilt",
327 ],
328}
329
330java_library {
331 name: "inline-mockito-ravenwood-prebuilt",
332 installable: false,
333 static_libs: [
334 "inline-mockito-robolectric-prebuilt",
335 ],
336}
337
338android_ravenwood_libgroup {
339 name: "ravenwood-runtime",
Makoto Onukid619e432024-07-19 16:45:02 -0700340 data: [
John Wud0371fa2024-09-13 20:58:49 +0000341 ":framework-res",
342 ":ravenwood-empty-res",
Makoto Onuki8ca3b7f2024-09-17 09:45:39 -0700343 ":framework-platform-compat-config",
344 ":services-platform-compat-config",
Makoto Onukid619e432024-07-19 16:45:02 -0700345 ],
Makoto Onukie5e97272024-05-23 10:49:31 -0700346 libs: [
347 "100-framework-minus-apex.ravenwood",
348 "200-kxml2-android",
349
350 "ravenwood-runtime-common-ravenwood",
351
352 "android.test.mock.ravenwood",
353 "ravenwood-helper-runtime",
354 "hoststubgen-helper-runtime.ravenwood",
355 "services.core.ravenwood-jarjar",
356 "services.fakes.ravenwood-jarjar",
357
Makoto Onuki953445b2024-07-19 11:21:29 -0700358 // ICU
359 "core-icu4j-for-host.ravenwood",
360 "icu4j-icudata-jarjar",
361 "icu4j-icutzdata-jarjar",
362
Makoto Onukie5e97272024-05-23 10:49:31 -0700363 // Provide runtime versions of utils linked in below
364 "junit",
365 "truth",
366 "flag-junit",
367 "ravenwood-framework",
368 "ravenwood-junit-impl",
369 "ravenwood-junit-impl-flag",
370 "mockito-ravenwood-prebuilt",
371 "inline-mockito-ravenwood-prebuilt",
372
373 // It's a stub, so it should be towards the end.
374 "z00-all-updatable-modules-system-stubs",
375 ],
376 jni_libs: [
John Wu5e13e252024-09-25 00:43:28 +0000377 // Libraries has to be loaded in the following order
378 "libravenwood_sysprop",
Makoto Onukie5e97272024-05-23 10:49:31 -0700379 "libravenwood_runtime",
John Wu5e13e252024-09-25 00:43:28 +0000380 "libandroid_runtime",
Makoto Onukie5e97272024-05-23 10:49:31 -0700381 ],
382}
383
384android_ravenwood_libgroup {
385 name: "ravenwood-utils",
386 libs: [
387 "junit",
388 "truth",
389 "flag-junit",
390 "ravenwood-framework",
391 "ravenwood-junit",
392 "mockito-ravenwood-prebuilt",
393 "inline-mockito-ravenwood-prebuilt",
394 ],
395}