blob: 629d846212af82a4962e1d4dee19da17d18129af [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 {
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",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700165 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700166 visibility: ["//frameworks/base"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700167 jarjar_rules: ":ravenwood-services-jarjar-rules",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700168}
169
John Wu98346162024-09-26 22:59:40 +0000170java_device_for_host {
171 name: "ravenwood-junit-impl-for-ravenizer",
172 libs: [
173 "ravenwood-junit-impl",
174 ],
175 visibility: [":__subpackages__"],
176}
177
Jeff Sharkey7037e352024-02-27 14:22:24 -0700178// Separated out from ravenwood-junit-impl since it needs to compile
179// against `module_current`
180java_library {
181 name: "ravenwood-junit-impl-flag",
182 srcs: [
183 "junit-flag-src/**/*.java",
184 ],
Liana Kazanova0c16dd32024-06-25 20:40:04 +0000185 sdk_version: "module_current",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700186 libs: [
187 "junit",
188 "flag-junit",
189 ],
190 visibility: ["//visibility:public"],
191}
192
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700193// Carefully compiles against only module_current to support tests that
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700194// want to verify they're unbundled. The "impl" library above is what
195// ships inside the Ravenwood environment to actually drive any API
196// access to implementation details.
Makoto Onuki8df6bd02024-08-01 12:38:50 -0700197// We can't use test_current here because this library needs to be statically
198// linked to mainline tests as well, which can't use test APIs because they
199// need to be able to run on multiple API levels.
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700200java_library {
201 name: "ravenwood-junit",
202 srcs: [
203 "junit-src/**/*.java",
204 "junit-stub-src/**/*.java",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700205 "junit-flag-src/**/*.java",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700206 ],
Felipe Lemedfbfb232024-07-23 05:31:38 +0000207 sdk_version: "module_current",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700208 static_libs: [
209 "ravenwood-runtime-common",
210 "ravenwood-runtime-common-device",
211 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700212 libs: [
213 "junit",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700214 "flag-junit",
John Wu98346162024-09-26 22:59:40 +0000215 "framework-annotations-lib",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700216 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700217 visibility: ["//visibility:public"],
218}
Jeff Sharkey4ee8a652023-11-14 08:45:56 -0700219
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700220// Library used to publish a handful of `android.ravenwood` APIs into
221// the Ravenwood BCP; we don't want to publish these APIs into the BCP
222// on physical devices, which is why this is a separate library
223java_library {
224 name: "ravenwood-framework",
225 srcs: [
226 "framework-src/**/*.java",
227 ],
228 libs: [
229 "framework-minus-apex.ravenwood",
230 ],
231 sdk_version: "core_current",
232 visibility: ["//visibility:public"],
233}
234
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700235java_host_for_device {
236 name: "androidx.test.monitor-for-device",
237 libs: [
238 "androidx.test.monitor-for-host",
239 ],
240}
241
242java_device_for_host {
243 name: "androidx.test.monitor-for-host",
244 libs: [
245 "androidx.test.monitor",
246 ],
247}
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700248
249filegroup {
Makoto Onukif38d5992024-05-30 10:40:50 -0700250 name: "ravenwood-framework-jarjar-rules",
251 srcs: ["texts/ravenwood-framework-jarjar-rules.txt"],
252 visibility: ["//frameworks/base"],
253}
254
255filegroup {
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700256 name: "ravenwood-services-jarjar-rules",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700257 srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700258 visibility: ["//frameworks/base"],
259}
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700260
John Wu5e13e252024-09-25 00:43:28 +0000261cc_defaults {
262 name: "ravenwood_jni_defaults",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700263 cflags: [
264 "-Wall",
265 "-Werror",
266 "-Wno-unused-parameter",
267 "-Wthread-safety",
268 ],
John Wu5e13e252024-09-25 00:43:28 +0000269 static_libs: [
270 "libnativehelper_jvm",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700271 ],
John Wu5e13e252024-09-25 00:43:28 +0000272 shared_libs: [
273 "liblog",
274 ],
275}
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700276
John Wu5e13e252024-09-25 00:43:28 +0000277// We need this as a separate library because we need to overload the
278// sysprop symbols before libbase is loaded into the process
279cc_library_host_shared {
280 name: "libravenwood_sysprop",
281 defaults: ["ravenwood_jni_defaults"],
282 srcs: ["runtime-jni/ravenwood_sysprop.cpp"],
283}
284
285cc_library_host_shared {
286 name: "libravenwood_runtime",
287 defaults: ["ravenwood_jni_defaults"],
288 srcs: [
289 "runtime-jni/ravenwood_runtime.cpp",
290 "runtime-jni/ravenwood_os_constants.cpp",
291 ],
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700292 shared_libs: [
293 "libbase",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700294 "libutils",
295 "libcutils",
296 ],
297 visibility: ["//frameworks/base"],
298}
299
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700300// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
301// The "test" just shows the available stats filenames.
302sh_test_host {
303 name: "ravenwood-stats-checker",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700304 src: "scripts/ravenwood-stats-checker.sh",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700305 test_suites: ["general-tests"],
306 data: [
John Wu98346162024-09-26 22:59:40 +0000307 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_stats.csv}",
308 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_apis.csv}",
309 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_keep_all.txt}",
310 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_dump.txt}",
Makoto Onuki134a4152024-06-26 14:21:12 -0700311 ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}",
312 ":services.core.ravenwood-base{hoststubgen_services.core_apis.csv}",
313 ":services.core.ravenwood-base{hoststubgen_services.core_keep_all.txt}",
314 ":services.core.ravenwood-base{hoststubgen_services.core_dump.txt}",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700315 ],
316}
Makoto Onukie5e97272024-05-23 10:49:31 -0700317
318java_library {
319 name: "services.fakes.ravenwood-jarjar",
320 installable: false,
321 srcs: [":services.fakes-sources"],
322 libs: [
323 "ravenwood-framework",
324 "services.core.ravenwood",
325 ],
326 jarjar_rules: ":ravenwood-services-jarjar-rules",
327 visibility: ["//visibility:private"],
328}
329
330java_library {
331 name: "mockito-ravenwood-prebuilt",
332 installable: false,
333 static_libs: [
334 "mockito-robolectric-prebuilt",
335 ],
336}
337
338java_library {
339 name: "inline-mockito-ravenwood-prebuilt",
340 installable: false,
341 static_libs: [
342 "inline-mockito-robolectric-prebuilt",
343 ],
344}
345
John Wu2abff412024-10-10 21:58:26 +0000346// JARs in "ravenwood-runtime" are set to the classpath, sorted alphabetically.
347// Rename some of the dependencies to make sure they're included in the intended order.
348
349java_library {
350 name: "100-framework-minus-apex.ravenwood",
351 installable: false,
352 static_libs: ["framework-minus-apex.ravenwood"],
353 visibility: ["//visibility:private"],
354}
355
356java_library {
357 name: "200-kxml2-android",
358 installable: false,
359 static_libs: ["kxml2-android"],
360 visibility: ["//visibility:private"],
361}
362
363java_library {
364 name: "z00-all-updatable-modules-system-stubs",
365 installable: false,
366 static_libs: ["all-updatable-modules-system-stubs-for-host"],
367 visibility: ["//visibility:private"],
368}
369
Makoto Onukie5e97272024-05-23 10:49:31 -0700370android_ravenwood_libgroup {
371 name: "ravenwood-runtime",
Makoto Onukid619e432024-07-19 16:45:02 -0700372 data: [
John Wud0371fa2024-09-13 20:58:49 +0000373 ":framework-res",
374 ":ravenwood-empty-res",
Makoto Onuki8ca3b7f2024-09-17 09:45:39 -0700375 ":framework-platform-compat-config",
376 ":services-platform-compat-config",
Makoto Onukid619e432024-07-19 16:45:02 -0700377 ],
Makoto Onukie5e97272024-05-23 10:49:31 -0700378 libs: [
379 "100-framework-minus-apex.ravenwood",
380 "200-kxml2-android",
381
382 "ravenwood-runtime-common-ravenwood",
383
384 "android.test.mock.ravenwood",
385 "ravenwood-helper-runtime",
386 "hoststubgen-helper-runtime.ravenwood",
387 "services.core.ravenwood-jarjar",
388 "services.fakes.ravenwood-jarjar",
389
Makoto Onuki953445b2024-07-19 11:21:29 -0700390 // ICU
391 "core-icu4j-for-host.ravenwood",
392 "icu4j-icudata-jarjar",
393 "icu4j-icutzdata-jarjar",
394
Makoto Onukie5e97272024-05-23 10:49:31 -0700395 // Provide runtime versions of utils linked in below
396 "junit",
397 "truth",
398 "flag-junit",
399 "ravenwood-framework",
400 "ravenwood-junit-impl",
401 "ravenwood-junit-impl-flag",
402 "mockito-ravenwood-prebuilt",
403 "inline-mockito-ravenwood-prebuilt",
404
405 // It's a stub, so it should be towards the end.
406 "z00-all-updatable-modules-system-stubs",
407 ],
408 jni_libs: [
John Wu5e13e252024-09-25 00:43:28 +0000409 // Libraries has to be loaded in the following order
410 "libravenwood_sysprop",
Makoto Onukie5e97272024-05-23 10:49:31 -0700411 "libravenwood_runtime",
John Wu5e13e252024-09-25 00:43:28 +0000412 "libandroid_runtime",
Makoto Onukie5e97272024-05-23 10:49:31 -0700413 ],
414}
415
416android_ravenwood_libgroup {
417 name: "ravenwood-utils",
418 libs: [
419 "junit",
420 "truth",
421 "flag-junit",
422 "ravenwood-framework",
423 "ravenwood-junit",
424 "mockito-ravenwood-prebuilt",
425 "inline-mockito-ravenwood-prebuilt",
426 ],
427}
John Wu2abff412024-10-10 21:58:26 +0000428
429build = [
430 "Framework.bp",
431]