blob: 733e8a97d871bbe76d1f7f54e7e41fa3df209cdd [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
Makoto Onuki9e4c0722024-10-14 15:32:09 -070011 default_team: "trendy_team_ravenwood",
Makoto Onuki3aefe332023-10-06 10:02:07 -070012}
13
14filegroup {
John Wu25110732024-10-10 22:40:49 +000015 name: "ravenwood-common-policies",
16 srcs: [
17 "texts/ravenwood-common-policies.txt",
18 ],
19 visibility: ["//visibility:private"],
20}
21
22filegroup {
Makoto Onukidfade842024-05-02 15:42:08 -070023 name: "ravenwood-services-policies",
24 srcs: [
25 "texts/ravenwood-services-policies.txt",
26 ],
John Wu2abff412024-10-10 21:58:26 +000027 visibility: ["//visibility:private"],
Makoto Onukidfade842024-05-02 15:42:08 -070028}
29
30filegroup {
31 name: "ravenwood-framework-policies",
32 srcs: [
33 "texts/ravenwood-framework-policies.txt",
34 ],
John Wu2abff412024-10-10 21:58:26 +000035 visibility: ["//visibility:private"],
Makoto Onukidfade842024-05-02 15:42:08 -070036}
37
38filegroup {
39 name: "ravenwood-standard-options",
40 srcs: [
41 "texts/ravenwood-standard-options.txt",
42 ],
John Wu2abff412024-10-10 21:58:26 +000043 visibility: ["//visibility:private"],
Makoto Onukidfade842024-05-02 15:42:08 -070044}
45
46filegroup {
47 name: "ravenwood-annotation-allowed-classes",
48 srcs: [
49 "texts/ravenwood-annotation-allowed-classes.txt",
50 ],
John Wu2abff412024-10-10 21:58:26 +000051 visibility: ["//visibility:private"],
Makoto Onukidfade842024-05-02 15:42:08 -070052}
53
Makoto Onukidf9cd262024-05-16 15:44:38 -070054// This and the next module contain the same classes with different implementations.
55// "ravenwood-runtime-common-device" will be statically linked in device side tests.
56// "ravenwood-runtime-common-ravenwood" will only exist in ravenwood-runtime, which will take
57// precedence even if the test jar (accidentally) contains "ravenwood-runtime-common-device".
58// "ravenwood-runtime-common" uses it to detect if the rutime is Ravenwood or not.
59java_library {
60 name: "ravenwood-runtime-common-ravenwood",
61 host_supported: true,
62 sdk_version: "core_current",
63 srcs: [
64 "runtime-common-ravenwood-src/**/*.java",
65 ],
Makoto Onukid619e432024-07-19 16:45:02 -070066 visibility: [
67 // Some tests need to access the utilities.
68 ":__subpackages__",
69 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -070070}
71
72java_library {
73 name: "ravenwood-runtime-common-device",
74 host_supported: true,
75 sdk_version: "core_current",
76 srcs: [
77 "runtime-common-device-src/**/*.java",
78 ],
79 visibility: ["//visibility:private"],
80}
81
82java_library {
83 name: "ravenwood-runtime-common",
84 host_supported: true,
85 sdk_version: "core_current",
86 srcs: [
87 "runtime-common-src/**/*.java",
88 ],
89 libs: [
90 "ravenwood-runtime-common-ravenwood",
91 ],
John Wu98346162024-09-26 22:59:40 +000092 static_libs: [
93 "framework-annotations-lib", // should it be "libs" instead?
94 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -070095 visibility: ["//visibility:private"],
96}
97
Makoto Onuki053eac82024-02-13 10:31:18 -080098java_library_host {
99 name: "ravenwood-helper-libcore-runtime.host",
100 srcs: [
101 "runtime-helper-src/libcore-fake/**/*.java",
102 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700103 static_libs: [
104 "ravenwood-runtime-common",
105 ],
Makoto Onuki053eac82024-02-13 10:31:18 -0800106 visibility: ["//visibility:private"],
107}
108
109java_host_for_device {
110 name: "ravenwood-helper-libcore-runtime",
111 libs: [
112 "ravenwood-helper-libcore-runtime.host",
113 ],
114 visibility: ["//visibility:private"],
115}
116
117java_library {
118 name: "ravenwood-helper-framework-runtime",
119 srcs: [
120 "runtime-helper-src/framework/**/*.java",
121 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700122 static_libs: [
123 "ravenwood-runtime-common",
124 ],
Makoto Onuki053eac82024-02-13 10:31:18 -0800125 libs: [
126 "framework-minus-apex.ravenwood",
John Wu0bbc5442024-10-17 08:46:06 +0000127 "framework-configinfrastructure.ravenwood",
John Wu98346162024-09-26 22:59:40 +0000128 "ravenwood-helper-libcore-runtime",
Makoto Onuki053eac82024-02-13 10:31:18 -0800129 ],
John Wu98346162024-09-26 22:59:40 +0000130 sdk_version: "core_current",
Makoto Onuki053eac82024-02-13 10:31:18 -0800131 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",
John Wu98346162024-09-26 22:59:40 +0000163 "framework-annotations-lib",
164 "ravenwood-helper-framework-runtime",
165 "ravenwood-helper-libcore-runtime",
John Wu9c7227e2024-10-09 00:29:02 +0000166 "hoststubgen-helper-runtime.ravenwood",
167 "mockito-ravenwood-prebuilt",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700168 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700169 visibility: ["//frameworks/base"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700170 jarjar_rules: ":ravenwood-services-jarjar-rules",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700171}
172
John Wu98346162024-09-26 22:59:40 +0000173java_device_for_host {
174 name: "ravenwood-junit-impl-for-ravenizer",
175 libs: [
176 "ravenwood-junit-impl",
177 ],
178 visibility: [":__subpackages__"],
179}
180
Jeff Sharkey7037e352024-02-27 14:22:24 -0700181// Separated out from ravenwood-junit-impl since it needs to compile
182// against `module_current`
183java_library {
184 name: "ravenwood-junit-impl-flag",
185 srcs: [
186 "junit-flag-src/**/*.java",
187 ],
Liana Kazanova0c16dd32024-06-25 20:40:04 +0000188 sdk_version: "module_current",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700189 libs: [
190 "junit",
191 "flag-junit",
192 ],
193 visibility: ["//visibility:public"],
194}
195
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700196// Carefully compiles against only module_current to support tests that
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700197// want to verify they're unbundled. The "impl" library above is what
198// ships inside the Ravenwood environment to actually drive any API
199// access to implementation details.
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700200// We can't use test_current here because this library needs to be statically
201// linked to mainline tests as well, which can't use test APIs because they
202// need to be able to run on multiple API levels.
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700203java_library {
204 name: "ravenwood-junit",
205 srcs: [
206 "junit-src/**/*.java",
207 "junit-stub-src/**/*.java",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700208 "junit-flag-src/**/*.java",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700209 ],
Felipe Lemedfbfb232024-07-23 05:31:38 +0000210 sdk_version: "module_current",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700211 static_libs: [
212 "ravenwood-runtime-common",
213 "ravenwood-runtime-common-device",
214 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700215 libs: [
216 "junit",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700217 "flag-junit",
John Wu98346162024-09-26 22:59:40 +0000218 "framework-annotations-lib",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700219 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700220 visibility: ["//visibility:public"],
221}
Jeff Sharkey4ee8a652023-11-14 08:45:56 -0700222
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700223// Library used to publish a handful of `android.ravenwood` APIs into
224// the Ravenwood BCP; we don't want to publish these APIs into the BCP
225// on physical devices, which is why this is a separate library
226java_library {
227 name: "ravenwood-framework",
228 srcs: [
229 "framework-src/**/*.java",
230 ],
231 libs: [
232 "framework-minus-apex.ravenwood",
233 ],
234 sdk_version: "core_current",
235 visibility: ["//visibility:public"],
236}
237
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700238java_host_for_device {
239 name: "androidx.test.monitor-for-device",
240 libs: [
241 "androidx.test.monitor-for-host",
242 ],
243}
244
245java_device_for_host {
246 name: "androidx.test.monitor-for-host",
247 libs: [
248 "androidx.test.monitor",
249 ],
250}
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700251
252filegroup {
Makoto Onukif38d5992024-05-30 10:40:50 -0700253 name: "ravenwood-framework-jarjar-rules",
254 srcs: ["texts/ravenwood-framework-jarjar-rules.txt"],
255 visibility: ["//frameworks/base"],
256}
257
258filegroup {
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700259 name: "ravenwood-services-jarjar-rules",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700260 srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700261 visibility: ["//frameworks/base"],
262}
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700263
John Wu5e13e252024-09-25 00:43:28 +0000264cc_defaults {
265 name: "ravenwood_jni_defaults",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700266 cflags: [
267 "-Wall",
268 "-Werror",
269 "-Wno-unused-parameter",
270 "-Wthread-safety",
271 ],
John Wu5e13e252024-09-25 00:43:28 +0000272 static_libs: [
273 "libnativehelper_jvm",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700274 ],
John Wu5e13e252024-09-25 00:43:28 +0000275 shared_libs: [
276 "liblog",
277 ],
278}
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700279
John Wu5e13e252024-09-25 00:43:28 +0000280// We need this as a separate library because we need to overload the
281// sysprop symbols before libbase is loaded into the process
282cc_library_host_shared {
283 name: "libravenwood_sysprop",
284 defaults: ["ravenwood_jni_defaults"],
285 srcs: ["runtime-jni/ravenwood_sysprop.cpp"],
286}
287
288cc_library_host_shared {
289 name: "libravenwood_runtime",
290 defaults: ["ravenwood_jni_defaults"],
291 srcs: [
292 "runtime-jni/ravenwood_runtime.cpp",
293 "runtime-jni/ravenwood_os_constants.cpp",
294 ],
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700295 shared_libs: [
296 "libbase",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700297 "libutils",
298 "libcutils",
299 ],
300 visibility: ["//frameworks/base"],
301}
302
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700303// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
304// The "test" just shows the available stats filenames.
305sh_test_host {
306 name: "ravenwood-stats-checker",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700307 src: "scripts/ravenwood-stats-checker.sh",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700308 test_suites: ["general-tests"],
Cole Faust5aeb9fd2024-10-22 16:30:57 -0700309 device_common_data: [
John Wu98346162024-09-26 22:59:40 +0000310 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_stats.csv}",
311 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_apis.csv}",
312 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_keep_all.txt}",
313 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_dump.txt}",
Makoto Onuki134a4152024-06-26 14:21:12 -0700314 ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}",
315 ":services.core.ravenwood-base{hoststubgen_services.core_apis.csv}",
316 ":services.core.ravenwood-base{hoststubgen_services.core_keep_all.txt}",
317 ":services.core.ravenwood-base{hoststubgen_services.core_dump.txt}",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700318 ],
319}
Makoto Onukie5e97272024-05-23 10:49:31 -0700320
321java_library {
322 name: "services.fakes.ravenwood-jarjar",
323 installable: false,
324 srcs: [":services.fakes-sources"],
325 libs: [
326 "ravenwood-framework",
327 "services.core.ravenwood",
328 ],
329 jarjar_rules: ":ravenwood-services-jarjar-rules",
330 visibility: ["//visibility:private"],
331}
332
333java_library {
334 name: "mockito-ravenwood-prebuilt",
335 installable: false,
336 static_libs: [
337 "mockito-robolectric-prebuilt",
338 ],
339}
340
341java_library {
342 name: "inline-mockito-ravenwood-prebuilt",
343 installable: false,
344 static_libs: [
345 "inline-mockito-robolectric-prebuilt",
346 ],
347}
348
John Wu2abff412024-10-10 21:58:26 +0000349// JARs in "ravenwood-runtime" are set to the classpath, sorted alphabetically.
350// Rename some of the dependencies to make sure they're included in the intended order.
351
352java_library {
353 name: "100-framework-minus-apex.ravenwood",
354 installable: false,
355 static_libs: ["framework-minus-apex.ravenwood"],
356 visibility: ["//visibility:private"],
357}
358
359java_library {
360 name: "200-kxml2-android",
361 installable: false,
362 static_libs: ["kxml2-android"],
363 visibility: ["//visibility:private"],
364}
365
366java_library {
367 name: "z00-all-updatable-modules-system-stubs",
368 installable: false,
369 static_libs: ["all-updatable-modules-system-stubs-for-host"],
370 visibility: ["//visibility:private"],
371}
372
Makoto Onukie5e97272024-05-23 10:49:31 -0700373android_ravenwood_libgroup {
374 name: "ravenwood-runtime",
Makoto Onukid619e432024-07-19 16:45:02 -0700375 data: [
John Wud69d3ee2024-10-15 23:58:01 +0000376 ":system-build.prop",
John Wud0371fa2024-09-13 20:58:49 +0000377 ":framework-res",
378 ":ravenwood-empty-res",
Makoto Onuki8ca3b7f2024-09-17 09:45:39 -0700379 ":framework-platform-compat-config",
380 ":services-platform-compat-config",
Makoto Onukid619e432024-07-19 16:45:02 -0700381 ],
Makoto Onukie5e97272024-05-23 10:49:31 -0700382 libs: [
383 "100-framework-minus-apex.ravenwood",
384 "200-kxml2-android",
385
386 "ravenwood-runtime-common-ravenwood",
387
388 "android.test.mock.ravenwood",
389 "ravenwood-helper-runtime",
390 "hoststubgen-helper-runtime.ravenwood",
391 "services.core.ravenwood-jarjar",
392 "services.fakes.ravenwood-jarjar",
393
Makoto Onuki953445b2024-07-19 11:21:29 -0700394 // ICU
395 "core-icu4j-for-host.ravenwood",
396 "icu4j-icudata-jarjar",
397 "icu4j-icutzdata-jarjar",
398
John Wu0bbc5442024-10-17 08:46:06 +0000399 // DeviceConfig
400 "framework-configinfrastructure.ravenwood",
401
Makoto Onukie5e97272024-05-23 10:49:31 -0700402 // Provide runtime versions of utils linked in below
403 "junit",
404 "truth",
405 "flag-junit",
406 "ravenwood-framework",
407 "ravenwood-junit-impl",
408 "ravenwood-junit-impl-flag",
409 "mockito-ravenwood-prebuilt",
410 "inline-mockito-ravenwood-prebuilt",
411
412 // It's a stub, so it should be towards the end.
413 "z00-all-updatable-modules-system-stubs",
414 ],
415 jni_libs: [
John Wu5e13e252024-09-25 00:43:28 +0000416 // Libraries has to be loaded in the following order
417 "libravenwood_sysprop",
Makoto Onukie5e97272024-05-23 10:49:31 -0700418 "libravenwood_runtime",
John Wu5e13e252024-09-25 00:43:28 +0000419 "libandroid_runtime",
Makoto Onukie5e97272024-05-23 10:49:31 -0700420 ],
421}
422
423android_ravenwood_libgroup {
424 name: "ravenwood-utils",
425 libs: [
426 "junit",
427 "truth",
428 "flag-junit",
429 "ravenwood-framework",
430 "ravenwood-junit",
431 "mockito-ravenwood-prebuilt",
432 "inline-mockito-ravenwood-prebuilt",
433 ],
434}
John Wu2abff412024-10-10 21:58:26 +0000435
436build = [
437 "Framework.bp",
438]