blob: bfa801f30955103308730035a733ad3ea9735022 [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 Wu98346162024-09-26 22:59:40 +0000127 "ravenwood-helper-libcore-runtime",
Makoto Onuki053eac82024-02-13 10:31:18 -0800128 ],
John Wu98346162024-09-26 22:59:40 +0000129 sdk_version: "core_current",
Makoto Onuki053eac82024-02-13 10:31:18 -0800130 visibility: ["//visibility:private"],
131}
132
133// Combine ravenwood-helper-*-runtime and create a single library, which we include
134// in the ravenwood runtime.
135// We do it this way rather than including the individual jars in the runtime, because
136// for some reason we couldn't include a java_host_for_device module in the ravenwood runtime.
137java_library {
138 name: "ravenwood-helper-runtime",
139 defaults: ["ravenwood-internal-only-visibility-java"],
140 static_libs: [
141 "ravenwood-helper-framework-runtime",
142 "ravenwood-helper-libcore-runtime",
143 ],
144}
145
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700146java_library {
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700147 name: "ravenwood-junit-impl",
148 srcs: [
149 "junit-src/**/*.java",
150 "junit-impl-src/**/*.java",
151 ],
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700152 static_libs: [
153 "androidx.test.monitor-for-device",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700154 "ravenwood-runtime-common",
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700155 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700156 libs: [
Jihoon Kang1e37ed32024-08-30 00:29:12 +0000157 "android.test.mock.impl",
Jeff Sharkey5e210d72023-11-10 11:22:05 -0700158 "framework-minus-apex.ravenwood",
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700159 "ravenwood-framework",
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700160 "services.core.ravenwood",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700161 "junit",
John Wu98346162024-09-26 22:59:40 +0000162 "framework-annotations-lib",
163 "ravenwood-helper-framework-runtime",
164 "ravenwood-helper-libcore-runtime",
John Wu9c7227e2024-10-09 00:29:02 +0000165 "hoststubgen-helper-runtime.ravenwood",
166 "mockito-ravenwood-prebuilt",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700167 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700168 visibility: ["//frameworks/base"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700169 jarjar_rules: ":ravenwood-services-jarjar-rules",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700170}
171
John Wu98346162024-09-26 22:59:40 +0000172java_device_for_host {
173 name: "ravenwood-junit-impl-for-ravenizer",
174 libs: [
175 "ravenwood-junit-impl",
176 ],
177 visibility: [":__subpackages__"],
178}
179
Jeff Sharkey7037e352024-02-27 14:22:24 -0700180// Separated out from ravenwood-junit-impl since it needs to compile
181// against `module_current`
182java_library {
183 name: "ravenwood-junit-impl-flag",
184 srcs: [
185 "junit-flag-src/**/*.java",
186 ],
Liana Kazanova0c16dd32024-06-25 20:40:04 +0000187 sdk_version: "module_current",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700188 libs: [
189 "junit",
190 "flag-junit",
191 ],
192 visibility: ["//visibility:public"],
193}
194
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700195// Carefully compiles against only module_current to support tests that
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700196// want to verify they're unbundled. The "impl" library above is what
197// ships inside the Ravenwood environment to actually drive any API
198// access to implementation details.
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700199// We can't use test_current here because this library needs to be statically
200// linked to mainline tests as well, which can't use test APIs because they
201// need to be able to run on multiple API levels.
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700202java_library {
203 name: "ravenwood-junit",
204 srcs: [
205 "junit-src/**/*.java",
206 "junit-stub-src/**/*.java",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700207 "junit-flag-src/**/*.java",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700208 ],
Felipe Lemedfbfb232024-07-23 05:31:38 +0000209 sdk_version: "module_current",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700210 static_libs: [
211 "ravenwood-runtime-common",
212 "ravenwood-runtime-common-device",
213 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700214 libs: [
215 "junit",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700216 "flag-junit",
John Wu98346162024-09-26 22:59:40 +0000217 "framework-annotations-lib",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700218 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700219 visibility: ["//visibility:public"],
220}
Jeff Sharkey4ee8a652023-11-14 08:45:56 -0700221
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700222// Library used to publish a handful of `android.ravenwood` APIs into
223// the Ravenwood BCP; we don't want to publish these APIs into the BCP
224// on physical devices, which is why this is a separate library
225java_library {
226 name: "ravenwood-framework",
227 srcs: [
228 "framework-src/**/*.java",
229 ],
230 libs: [
231 "framework-minus-apex.ravenwood",
232 ],
233 sdk_version: "core_current",
234 visibility: ["//visibility:public"],
235}
236
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700237java_host_for_device {
238 name: "androidx.test.monitor-for-device",
239 libs: [
240 "androidx.test.monitor-for-host",
241 ],
242}
243
244java_device_for_host {
245 name: "androidx.test.monitor-for-host",
246 libs: [
247 "androidx.test.monitor",
248 ],
249}
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700250
251filegroup {
Makoto Onukif38d5992024-05-30 10:40:50 -0700252 name: "ravenwood-framework-jarjar-rules",
253 srcs: ["texts/ravenwood-framework-jarjar-rules.txt"],
254 visibility: ["//frameworks/base"],
255}
256
257filegroup {
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700258 name: "ravenwood-services-jarjar-rules",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700259 srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700260 visibility: ["//frameworks/base"],
261}
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700262
John Wu5e13e252024-09-25 00:43:28 +0000263cc_defaults {
264 name: "ravenwood_jni_defaults",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700265 cflags: [
266 "-Wall",
267 "-Werror",
268 "-Wno-unused-parameter",
269 "-Wthread-safety",
270 ],
John Wu5e13e252024-09-25 00:43:28 +0000271 static_libs: [
272 "libnativehelper_jvm",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700273 ],
John Wu5e13e252024-09-25 00:43:28 +0000274 shared_libs: [
275 "liblog",
276 ],
277}
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700278
John Wu5e13e252024-09-25 00:43:28 +0000279// We need this as a separate library because we need to overload the
280// sysprop symbols before libbase is loaded into the process
281cc_library_host_shared {
282 name: "libravenwood_sysprop",
283 defaults: ["ravenwood_jni_defaults"],
284 srcs: ["runtime-jni/ravenwood_sysprop.cpp"],
285}
286
287cc_library_host_shared {
288 name: "libravenwood_runtime",
289 defaults: ["ravenwood_jni_defaults"],
290 srcs: [
291 "runtime-jni/ravenwood_runtime.cpp",
292 "runtime-jni/ravenwood_os_constants.cpp",
293 ],
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700294 shared_libs: [
295 "libbase",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700296 "libutils",
297 "libcutils",
298 ],
299 visibility: ["//frameworks/base"],
300}
301
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700302// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
303// The "test" just shows the available stats filenames.
304sh_test_host {
305 name: "ravenwood-stats-checker",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700306 src: "scripts/ravenwood-stats-checker.sh",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700307 test_suites: ["general-tests"],
308 data: [
John Wu98346162024-09-26 22:59:40 +0000309 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_stats.csv}",
310 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_apis.csv}",
311 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_keep_all.txt}",
312 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_dump.txt}",
Makoto Onuki134a4152024-06-26 14:21:12 -0700313 ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}",
314 ":services.core.ravenwood-base{hoststubgen_services.core_apis.csv}",
315 ":services.core.ravenwood-base{hoststubgen_services.core_keep_all.txt}",
316 ":services.core.ravenwood-base{hoststubgen_services.core_dump.txt}",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700317 ],
318}
Makoto Onukie5e97272024-05-23 10:49:31 -0700319
320java_library {
321 name: "services.fakes.ravenwood-jarjar",
322 installable: false,
323 srcs: [":services.fakes-sources"],
324 libs: [
325 "ravenwood-framework",
326 "services.core.ravenwood",
327 ],
328 jarjar_rules: ":ravenwood-services-jarjar-rules",
329 visibility: ["//visibility:private"],
330}
331
332java_library {
333 name: "mockito-ravenwood-prebuilt",
334 installable: false,
335 static_libs: [
336 "mockito-robolectric-prebuilt",
337 ],
338}
339
340java_library {
341 name: "inline-mockito-ravenwood-prebuilt",
342 installable: false,
343 static_libs: [
344 "inline-mockito-robolectric-prebuilt",
345 ],
346}
347
John Wu2abff412024-10-10 21:58:26 +0000348// JARs in "ravenwood-runtime" are set to the classpath, sorted alphabetically.
349// Rename some of the dependencies to make sure they're included in the intended order.
350
351java_library {
352 name: "100-framework-minus-apex.ravenwood",
353 installable: false,
354 static_libs: ["framework-minus-apex.ravenwood"],
355 visibility: ["//visibility:private"],
356}
357
358java_library {
359 name: "200-kxml2-android",
360 installable: false,
361 static_libs: ["kxml2-android"],
362 visibility: ["//visibility:private"],
363}
364
365java_library {
366 name: "z00-all-updatable-modules-system-stubs",
367 installable: false,
368 static_libs: ["all-updatable-modules-system-stubs-for-host"],
369 visibility: ["//visibility:private"],
370}
371
Makoto Onukie5e97272024-05-23 10:49:31 -0700372android_ravenwood_libgroup {
373 name: "ravenwood-runtime",
Makoto Onukid619e432024-07-19 16:45:02 -0700374 data: [
John Wud0371fa2024-09-13 20:58:49 +0000375 ":framework-res",
376 ":ravenwood-empty-res",
Makoto Onuki8ca3b7f2024-09-17 09:45:39 -0700377 ":framework-platform-compat-config",
378 ":services-platform-compat-config",
Makoto Onukid619e432024-07-19 16:45:02 -0700379 ],
Makoto Onukie5e97272024-05-23 10:49:31 -0700380 libs: [
381 "100-framework-minus-apex.ravenwood",
382 "200-kxml2-android",
383
384 "ravenwood-runtime-common-ravenwood",
385
386 "android.test.mock.ravenwood",
387 "ravenwood-helper-runtime",
388 "hoststubgen-helper-runtime.ravenwood",
389 "services.core.ravenwood-jarjar",
390 "services.fakes.ravenwood-jarjar",
391
Makoto Onuki953445b2024-07-19 11:21:29 -0700392 // ICU
393 "core-icu4j-for-host.ravenwood",
394 "icu4j-icudata-jarjar",
395 "icu4j-icutzdata-jarjar",
396
Makoto Onukie5e97272024-05-23 10:49:31 -0700397 // Provide runtime versions of utils linked in below
398 "junit",
399 "truth",
400 "flag-junit",
401 "ravenwood-framework",
402 "ravenwood-junit-impl",
403 "ravenwood-junit-impl-flag",
404 "mockito-ravenwood-prebuilt",
405 "inline-mockito-ravenwood-prebuilt",
406
407 // It's a stub, so it should be towards the end.
408 "z00-all-updatable-modules-system-stubs",
409 ],
410 jni_libs: [
John Wu5e13e252024-09-25 00:43:28 +0000411 // Libraries has to be loaded in the following order
412 "libravenwood_sysprop",
Makoto Onukie5e97272024-05-23 10:49:31 -0700413 "libravenwood_runtime",
John Wu5e13e252024-09-25 00:43:28 +0000414 "libandroid_runtime",
Makoto Onukie5e97272024-05-23 10:49:31 -0700415 ],
416}
417
418android_ravenwood_libgroup {
419 name: "ravenwood-utils",
420 libs: [
421 "junit",
422 "truth",
423 "flag-junit",
424 "ravenwood-framework",
425 "ravenwood-junit",
426 "mockito-ravenwood-prebuilt",
427 "inline-mockito-ravenwood-prebuilt",
428 ],
429}
John Wu2abff412024-10-10 21:58:26 +0000430
431build = [
432 "Framework.bp",
433]