blob: 10e4f3820cd7fad9e693524af3e2d6d8a973211b [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
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700270cc_library_shared {
271 name: "libravenwood_runtime",
272 host_supported: true,
273
274 cflags: [
275 "-Wall",
276 "-Werror",
277 "-Wno-unused-parameter",
278 "-Wthread-safety",
279 ],
280
281 srcs: [
Makoto Onukidf9cd262024-05-16 15:44:38 -0700282 "runtime-jni/*.cpp",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700283 ],
284
285 shared_libs: [
286 "libbase",
287 "liblog",
288 "libnativehelper",
289 "libutils",
290 "libcutils",
291 ],
292 visibility: ["//frameworks/base"],
293}
294
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700295// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
296// The "test" just shows the available stats filenames.
297sh_test_host {
298 name: "ravenwood-stats-checker",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700299 src: "scripts/ravenwood-stats-checker.sh",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700300 test_suites: ["general-tests"],
301 data: [
John Wu98346162024-09-26 22:59:40 +0000302 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_stats.csv}",
303 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_apis.csv}",
304 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_keep_all.txt}",
305 ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_dump.txt}",
Makoto Onuki134a4152024-06-26 14:21:12 -0700306 ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}",
307 ":services.core.ravenwood-base{hoststubgen_services.core_apis.csv}",
308 ":services.core.ravenwood-base{hoststubgen_services.core_keep_all.txt}",
309 ":services.core.ravenwood-base{hoststubgen_services.core_dump.txt}",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700310 ],
311}
Makoto Onukie5e97272024-05-23 10:49:31 -0700312
313java_library {
314 name: "services.fakes.ravenwood-jarjar",
315 installable: false,
316 srcs: [":services.fakes-sources"],
317 libs: [
318 "ravenwood-framework",
319 "services.core.ravenwood",
320 ],
321 jarjar_rules: ":ravenwood-services-jarjar-rules",
322 visibility: ["//visibility:private"],
323}
324
325java_library {
326 name: "mockito-ravenwood-prebuilt",
327 installable: false,
328 static_libs: [
329 "mockito-robolectric-prebuilt",
330 ],
331}
332
333java_library {
334 name: "inline-mockito-ravenwood-prebuilt",
335 installable: false,
336 static_libs: [
337 "inline-mockito-robolectric-prebuilt",
338 ],
339}
340
341android_ravenwood_libgroup {
342 name: "ravenwood-runtime",
Makoto Onukid619e432024-07-19 16:45:02 -0700343 data: [
John Wud0371fa2024-09-13 20:58:49 +0000344 ":framework-res",
345 ":ravenwood-empty-res",
Makoto Onuki8ca3b7f2024-09-17 09:45:39 -0700346 ":framework-platform-compat-config",
347 ":services-platform-compat-config",
Makoto Onukid619e432024-07-19 16:45:02 -0700348 ],
Makoto Onukie5e97272024-05-23 10:49:31 -0700349 libs: [
350 "100-framework-minus-apex.ravenwood",
351 "200-kxml2-android",
352
353 "ravenwood-runtime-common-ravenwood",
354
355 "android.test.mock.ravenwood",
356 "ravenwood-helper-runtime",
357 "hoststubgen-helper-runtime.ravenwood",
358 "services.core.ravenwood-jarjar",
359 "services.fakes.ravenwood-jarjar",
360
Makoto Onuki953445b2024-07-19 11:21:29 -0700361 // ICU
362 "core-icu4j-for-host.ravenwood",
363 "icu4j-icudata-jarjar",
364 "icu4j-icutzdata-jarjar",
365
Makoto Onukie5e97272024-05-23 10:49:31 -0700366 // Provide runtime versions of utils linked in below
367 "junit",
368 "truth",
369 "flag-junit",
370 "ravenwood-framework",
371 "ravenwood-junit-impl",
372 "ravenwood-junit-impl-flag",
373 "mockito-ravenwood-prebuilt",
374 "inline-mockito-ravenwood-prebuilt",
375
376 // It's a stub, so it should be towards the end.
377 "z00-all-updatable-modules-system-stubs",
378 ],
379 jni_libs: [
380 "libandroid_runtime",
381 "libravenwood_runtime",
382 ],
383}
384
385android_ravenwood_libgroup {
386 name: "ravenwood-utils",
387 libs: [
388 "junit",
389 "truth",
390 "flag-junit",
391 "ravenwood-framework",
392 "ravenwood-junit",
393 "mockito-ravenwood-prebuilt",
394 "inline-mockito-ravenwood-prebuilt",
395 ],
396}