blob: 6b1197ad4c18d48887d781251a1a88d9f2a3653a [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 {
15 name: "ravenwood-annotations",
16 srcs: [
17 "annotations-src/**/*.java",
18 ],
Anton Hanssond82cbc72023-10-30 20:00:39 +000019 path: "annotations-src",
Makoto Onuki3aefe332023-10-06 10:02:07 -070020 visibility: ["//visibility:public"],
21}
22
Makoto Onukidfade842024-05-02 15:42:08 -070023filegroup {
24 name: "ravenwood-services-policies",
25 srcs: [
26 "texts/ravenwood-services-policies.txt",
27 ],
28 visibility: ["//visibility:public"],
29}
30
31filegroup {
32 name: "ravenwood-framework-policies",
33 srcs: [
34 "texts/ravenwood-framework-policies.txt",
35 ],
36 visibility: ["//visibility:public"],
37}
38
39filegroup {
40 name: "ravenwood-standard-options",
41 srcs: [
42 "texts/ravenwood-standard-options.txt",
43 ],
44 visibility: ["//visibility:public"],
45}
46
47filegroup {
48 name: "ravenwood-annotation-allowed-classes",
49 srcs: [
50 "texts/ravenwood-annotation-allowed-classes.txt",
51 ],
52 visibility: ["//visibility:public"],
53}
54
Makoto Onuki3aefe332023-10-06 10:02:07 -070055java_library {
56 name: "ravenwood-annotations-lib",
57 srcs: [":ravenwood-annotations"],
58 sdk_version: "core_current",
59 host_supported: true,
60 visibility: ["//visibility:public"],
61}
Jeff Sharkey91f414e2023-11-07 15:43:59 -070062
Makoto Onukidf9cd262024-05-16 15:44:38 -070063// This and the next module contain the same classes with different implementations.
64// "ravenwood-runtime-common-device" will be statically linked in device side tests.
65// "ravenwood-runtime-common-ravenwood" will only exist in ravenwood-runtime, which will take
66// precedence even if the test jar (accidentally) contains "ravenwood-runtime-common-device".
67// "ravenwood-runtime-common" uses it to detect if the rutime is Ravenwood or not.
68java_library {
69 name: "ravenwood-runtime-common-ravenwood",
70 host_supported: true,
71 sdk_version: "core_current",
72 srcs: [
73 "runtime-common-ravenwood-src/**/*.java",
74 ],
Makoto Onukid619e432024-07-19 16:45:02 -070075 visibility: [
76 // Some tests need to access the utilities.
77 ":__subpackages__",
78 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -070079}
80
81java_library {
82 name: "ravenwood-runtime-common-device",
83 host_supported: true,
84 sdk_version: "core_current",
85 srcs: [
86 "runtime-common-device-src/**/*.java",
87 ],
88 visibility: ["//visibility:private"],
89}
90
91java_library {
92 name: "ravenwood-runtime-common",
93 host_supported: true,
94 sdk_version: "core_current",
95 srcs: [
96 "runtime-common-src/**/*.java",
97 ],
98 libs: [
99 "ravenwood-runtime-common-ravenwood",
100 ],
John Wu98346162024-09-26 22:59:40 +0000101 static_libs: [
102 "framework-annotations-lib", // should it be "libs" instead?
103 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700104 visibility: ["//visibility:private"],
105}
106
Makoto Onuki053eac82024-02-13 10:31:18 -0800107java_library_host {
108 name: "ravenwood-helper-libcore-runtime.host",
109 srcs: [
110 "runtime-helper-src/libcore-fake/**/*.java",
111 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700112 static_libs: [
113 "ravenwood-runtime-common",
114 ],
Makoto Onuki053eac82024-02-13 10:31:18 -0800115 visibility: ["//visibility:private"],
116}
117
118java_host_for_device {
119 name: "ravenwood-helper-libcore-runtime",
120 libs: [
121 "ravenwood-helper-libcore-runtime.host",
122 ],
123 visibility: ["//visibility:private"],
124}
125
126java_library {
127 name: "ravenwood-helper-framework-runtime",
128 srcs: [
129 "runtime-helper-src/framework/**/*.java",
130 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700131 static_libs: [
132 "ravenwood-runtime-common",
133 ],
Makoto Onuki053eac82024-02-13 10:31:18 -0800134 libs: [
135 "framework-minus-apex.ravenwood",
John Wu98346162024-09-26 22:59:40 +0000136 "ravenwood-helper-libcore-runtime",
Makoto Onuki053eac82024-02-13 10:31:18 -0800137 ],
John Wu98346162024-09-26 22:59:40 +0000138 sdk_version: "core_current",
Makoto Onuki053eac82024-02-13 10:31:18 -0800139 visibility: ["//visibility:private"],
140}
141
142// Combine ravenwood-helper-*-runtime and create a single library, which we include
143// in the ravenwood runtime.
144// We do it this way rather than including the individual jars in the runtime, because
145// for some reason we couldn't include a java_host_for_device module in the ravenwood runtime.
146java_library {
147 name: "ravenwood-helper-runtime",
148 defaults: ["ravenwood-internal-only-visibility-java"],
149 static_libs: [
150 "ravenwood-helper-framework-runtime",
151 "ravenwood-helper-libcore-runtime",
152 ],
153}
154
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700155java_library {
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700156 name: "ravenwood-junit-impl",
157 srcs: [
158 "junit-src/**/*.java",
159 "junit-impl-src/**/*.java",
160 ],
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700161 static_libs: [
162 "androidx.test.monitor-for-device",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700163 "ravenwood-runtime-common",
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700164 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700165 libs: [
Jihoon Kang1e37ed32024-08-30 00:29:12 +0000166 "android.test.mock.impl",
Jeff Sharkey5e210d72023-11-10 11:22:05 -0700167 "framework-minus-apex.ravenwood",
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700168 "ravenwood-framework",
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700169 "services.core.ravenwood",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700170 "junit",
John Wu98346162024-09-26 22:59:40 +0000171 "framework-annotations-lib",
172 "ravenwood-helper-framework-runtime",
173 "ravenwood-helper-libcore-runtime",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700174 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700175 visibility: ["//frameworks/base"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700176 jarjar_rules: ":ravenwood-services-jarjar-rules",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700177}
178
John Wu98346162024-09-26 22:59:40 +0000179java_device_for_host {
180 name: "ravenwood-junit-impl-for-ravenizer",
181 libs: [
182 "ravenwood-junit-impl",
183 ],
184 visibility: [":__subpackages__"],
185}
186
Jeff Sharkey7037e352024-02-27 14:22:24 -0700187// Separated out from ravenwood-junit-impl since it needs to compile
188// against `module_current`
189java_library {
190 name: "ravenwood-junit-impl-flag",
191 srcs: [
192 "junit-flag-src/**/*.java",
193 ],
Liana Kazanova0c16dd32024-06-25 20:40:04 +0000194 sdk_version: "module_current",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700195 libs: [
196 "junit",
197 "flag-junit",
198 ],
199 visibility: ["//visibility:public"],
200}
201
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700202// Carefully compiles against only module_current to support tests that
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700203// want to verify they're unbundled. The "impl" library above is what
204// ships inside the Ravenwood environment to actually drive any API
205// access to implementation details.
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700206// We can't use test_current here because this library needs to be statically
207// linked to mainline tests as well, which can't use test APIs because they
208// need to be able to run on multiple API levels.
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700209java_library {
210 name: "ravenwood-junit",
211 srcs: [
212 "junit-src/**/*.java",
213 "junit-stub-src/**/*.java",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700214 "junit-flag-src/**/*.java",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700215 ],
Felipe Lemedfbfb232024-07-23 05:31:38 +0000216 sdk_version: "module_current",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700217 static_libs: [
218 "ravenwood-runtime-common",
219 "ravenwood-runtime-common-device",
220 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700221 libs: [
222 "junit",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700223 "flag-junit",
John Wu98346162024-09-26 22:59:40 +0000224 "framework-annotations-lib",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700225 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700226 visibility: ["//visibility:public"],
227}
Jeff Sharkey4ee8a652023-11-14 08:45:56 -0700228
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700229// Library used to publish a handful of `android.ravenwood` APIs into
230// the Ravenwood BCP; we don't want to publish these APIs into the BCP
231// on physical devices, which is why this is a separate library
232java_library {
233 name: "ravenwood-framework",
234 srcs: [
235 "framework-src/**/*.java",
236 ],
237 libs: [
238 "framework-minus-apex.ravenwood",
239 ],
240 sdk_version: "core_current",
241 visibility: ["//visibility:public"],
242}
243
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700244java_host_for_device {
245 name: "androidx.test.monitor-for-device",
246 libs: [
247 "androidx.test.monitor-for-host",
248 ],
249}
250
251java_device_for_host {
252 name: "androidx.test.monitor-for-host",
253 libs: [
254 "androidx.test.monitor",
255 ],
256}
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700257
258filegroup {
Makoto Onukif38d5992024-05-30 10:40:50 -0700259 name: "ravenwood-framework-jarjar-rules",
260 srcs: ["texts/ravenwood-framework-jarjar-rules.txt"],
261 visibility: ["//frameworks/base"],
262}
263
264filegroup {
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700265 name: "ravenwood-services-jarjar-rules",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700266 srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700267 visibility: ["//frameworks/base"],
268}
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700269
John Wu5e13e252024-09-25 00:43:28 +0000270cc_defaults {
271 name: "ravenwood_jni_defaults",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700272 cflags: [
273 "-Wall",
274 "-Werror",
275 "-Wno-unused-parameter",
276 "-Wthread-safety",
277 ],
John Wu5e13e252024-09-25 00:43:28 +0000278 static_libs: [
279 "libnativehelper_jvm",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700280 ],
John Wu5e13e252024-09-25 00:43:28 +0000281 shared_libs: [
282 "liblog",
283 ],
284}
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700285
John Wu5e13e252024-09-25 00:43:28 +0000286// We need this as a separate library because we need to overload the
287// sysprop symbols before libbase is loaded into the process
288cc_library_host_shared {
289 name: "libravenwood_sysprop",
290 defaults: ["ravenwood_jni_defaults"],
291 srcs: ["runtime-jni/ravenwood_sysprop.cpp"],
292}
293
294cc_library_host_shared {
295 name: "libravenwood_runtime",
296 defaults: ["ravenwood_jni_defaults"],
297 srcs: [
298 "runtime-jni/ravenwood_runtime.cpp",
299 "runtime-jni/ravenwood_os_constants.cpp",
300 ],
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700301 shared_libs: [
302 "libbase",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700303 "libutils",
304 "libcutils",
305 ],
306 visibility: ["//frameworks/base"],
307}
308
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700309// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
310// The "test" just shows the available stats filenames.
311sh_test_host {
312 name: "ravenwood-stats-checker",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700313 src: "scripts/ravenwood-stats-checker.sh",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700314 test_suites: ["general-tests"],
315 data: [
John Wu98346162024-09-26 22:59:40 +0000316 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_stats.csv}",
317 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_apis.csv}",
318 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_keep_all.txt}",
319 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_dump.txt}",
Makoto Onuki134a4152024-06-26 14:21:12 -0700320 ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}",
321 ":services.core.ravenwood-base{hoststubgen_services.core_apis.csv}",
322 ":services.core.ravenwood-base{hoststubgen_services.core_keep_all.txt}",
323 ":services.core.ravenwood-base{hoststubgen_services.core_dump.txt}",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700324 ],
325}
Makoto Onukie5e97272024-05-23 10:49:31 -0700326
327java_library {
328 name: "services.fakes.ravenwood-jarjar",
329 installable: false,
330 srcs: [":services.fakes-sources"],
331 libs: [
332 "ravenwood-framework",
333 "services.core.ravenwood",
334 ],
335 jarjar_rules: ":ravenwood-services-jarjar-rules",
336 visibility: ["//visibility:private"],
337}
338
339java_library {
340 name: "mockito-ravenwood-prebuilt",
341 installable: false,
342 static_libs: [
343 "mockito-robolectric-prebuilt",
344 ],
345}
346
347java_library {
348 name: "inline-mockito-ravenwood-prebuilt",
349 installable: false,
350 static_libs: [
351 "inline-mockito-robolectric-prebuilt",
352 ],
353}
354
355android_ravenwood_libgroup {
356 name: "ravenwood-runtime",
Makoto Onukid619e432024-07-19 16:45:02 -0700357 data: [
John Wud0371fa2024-09-13 20:58:49 +0000358 ":framework-res",
359 ":ravenwood-empty-res",
Makoto Onuki8ca3b7f2024-09-17 09:45:39 -0700360 ":framework-platform-compat-config",
361 ":services-platform-compat-config",
Makoto Onukid619e432024-07-19 16:45:02 -0700362 ],
Makoto Onukie5e97272024-05-23 10:49:31 -0700363 libs: [
364 "100-framework-minus-apex.ravenwood",
365 "200-kxml2-android",
366
367 "ravenwood-runtime-common-ravenwood",
368
369 "android.test.mock.ravenwood",
370 "ravenwood-helper-runtime",
371 "hoststubgen-helper-runtime.ravenwood",
372 "services.core.ravenwood-jarjar",
373 "services.fakes.ravenwood-jarjar",
374
Makoto Onuki953445b2024-07-19 11:21:29 -0700375 // ICU
376 "core-icu4j-for-host.ravenwood",
377 "icu4j-icudata-jarjar",
378 "icu4j-icutzdata-jarjar",
379
Makoto Onukie5e97272024-05-23 10:49:31 -0700380 // Provide runtime versions of utils linked in below
381 "junit",
382 "truth",
383 "flag-junit",
384 "ravenwood-framework",
385 "ravenwood-junit-impl",
386 "ravenwood-junit-impl-flag",
387 "mockito-ravenwood-prebuilt",
388 "inline-mockito-ravenwood-prebuilt",
389
390 // It's a stub, so it should be towards the end.
391 "z00-all-updatable-modules-system-stubs",
392 ],
393 jni_libs: [
John Wu5e13e252024-09-25 00:43:28 +0000394 // Libraries has to be loaded in the following order
395 "libravenwood_sysprop",
Makoto Onukie5e97272024-05-23 10:49:31 -0700396 "libravenwood_runtime",
John Wu5e13e252024-09-25 00:43:28 +0000397 "libandroid_runtime",
Makoto Onukie5e97272024-05-23 10:49:31 -0700398 ],
399}
400
401android_ravenwood_libgroup {
402 name: "ravenwood-utils",
403 libs: [
404 "junit",
405 "truth",
406 "flag-junit",
407 "ravenwood-framework",
408 "ravenwood-junit",
409 "mockito-ravenwood-prebuilt",
410 "inline-mockito-ravenwood-prebuilt",
411 ],
412}