blob: ad216b59c93d3f0fd56c2aec449c643fcdcecc97 [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"],
8}
9
10filegroup {
11 name: "ravenwood-annotations",
12 srcs: [
13 "annotations-src/**/*.java",
14 ],
Anton Hanssond82cbc72023-10-30 20:00:39 +000015 path: "annotations-src",
Makoto Onuki3aefe332023-10-06 10:02:07 -070016 visibility: ["//visibility:public"],
17}
18
Makoto Onukidfade842024-05-02 15:42:08 -070019filegroup {
20 name: "ravenwood-services-policies",
21 srcs: [
22 "texts/ravenwood-services-policies.txt",
23 ],
24 visibility: ["//visibility:public"],
25}
26
27filegroup {
28 name: "ravenwood-framework-policies",
29 srcs: [
30 "texts/ravenwood-framework-policies.txt",
31 ],
32 visibility: ["//visibility:public"],
33}
34
35filegroup {
36 name: "ravenwood-standard-options",
37 srcs: [
38 "texts/ravenwood-standard-options.txt",
39 ],
40 visibility: ["//visibility:public"],
41}
42
43filegroup {
44 name: "ravenwood-annotation-allowed-classes",
45 srcs: [
46 "texts/ravenwood-annotation-allowed-classes.txt",
47 ],
48 visibility: ["//visibility:public"],
49}
50
Makoto Onuki3aefe332023-10-06 10:02:07 -070051java_library {
52 name: "ravenwood-annotations-lib",
53 srcs: [":ravenwood-annotations"],
54 sdk_version: "core_current",
55 host_supported: true,
56 visibility: ["//visibility:public"],
57}
Jeff Sharkey91f414e2023-11-07 15:43:59 -070058
Makoto Onukidf9cd262024-05-16 15:44:38 -070059// This and the next module contain the same classes with different implementations.
60// "ravenwood-runtime-common-device" will be statically linked in device side tests.
61// "ravenwood-runtime-common-ravenwood" will only exist in ravenwood-runtime, which will take
62// precedence even if the test jar (accidentally) contains "ravenwood-runtime-common-device".
63// "ravenwood-runtime-common" uses it to detect if the rutime is Ravenwood or not.
64java_library {
65 name: "ravenwood-runtime-common-ravenwood",
66 host_supported: true,
67 sdk_version: "core_current",
68 srcs: [
69 "runtime-common-ravenwood-src/**/*.java",
70 ],
71 visibility: ["//frameworks/base"],
72}
73
74java_library {
75 name: "ravenwood-runtime-common-device",
76 host_supported: true,
77 sdk_version: "core_current",
78 srcs: [
79 "runtime-common-device-src/**/*.java",
80 ],
81 visibility: ["//visibility:private"],
82}
83
84java_library {
85 name: "ravenwood-runtime-common",
86 host_supported: true,
87 sdk_version: "core_current",
88 srcs: [
89 "runtime-common-src/**/*.java",
90 ],
91 libs: [
92 "ravenwood-runtime-common-ravenwood",
93 ],
94 visibility: ["//visibility:private"],
95}
96
Makoto Onuki053eac82024-02-13 10:31:18 -080097java_library_host {
98 name: "ravenwood-helper-libcore-runtime.host",
99 srcs: [
100 "runtime-helper-src/libcore-fake/**/*.java",
101 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700102 static_libs: [
103 "ravenwood-runtime-common",
104 ],
Makoto Onuki053eac82024-02-13 10:31:18 -0800105 visibility: ["//visibility:private"],
106}
107
108java_host_for_device {
109 name: "ravenwood-helper-libcore-runtime",
110 libs: [
111 "ravenwood-helper-libcore-runtime.host",
112 ],
113 visibility: ["//visibility:private"],
114}
115
116java_library {
117 name: "ravenwood-helper-framework-runtime",
118 srcs: [
119 "runtime-helper-src/framework/**/*.java",
120 ],
Makoto Onukidf9cd262024-05-16 15:44:38 -0700121 static_libs: [
122 "ravenwood-runtime-common",
123 ],
Makoto Onuki053eac82024-02-13 10:31:18 -0800124 libs: [
125 "framework-minus-apex.ravenwood",
Makoto Onuki50276f02024-02-13 14:58:56 -0800126 "ravenwood-junit",
Makoto Onuki053eac82024-02-13 10:31:18 -0800127 ],
128 visibility: ["//visibility:private"],
129}
130
131// Combine ravenwood-helper-*-runtime and create a single library, which we include
132// in the ravenwood runtime.
133// We do it this way rather than including the individual jars in the runtime, because
134// for some reason we couldn't include a java_host_for_device module in the ravenwood runtime.
135java_library {
136 name: "ravenwood-helper-runtime",
137 defaults: ["ravenwood-internal-only-visibility-java"],
138 static_libs: [
139 "ravenwood-helper-framework-runtime",
140 "ravenwood-helper-libcore-runtime",
141 ],
142}
143
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700144java_library {
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700145 name: "ravenwood-junit-impl",
146 srcs: [
147 "junit-src/**/*.java",
148 "junit-impl-src/**/*.java",
149 ],
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700150 static_libs: [
151 "androidx.test.monitor-for-device",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700152 "ravenwood-runtime-common",
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700153 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700154 libs: [
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700155 "android.test.mock",
Jeff Sharkey5e210d72023-11-10 11:22:05 -0700156 "framework-minus-apex.ravenwood",
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700157 "ravenwood-framework",
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700158 "services.core.ravenwood",
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700159 "junit",
160 ],
Makoto Onukia8bcba12023-11-22 14:00:24 -0800161 sdk_version: "core_current",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700162 visibility: ["//frameworks/base"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700163 jarjar_rules: ":ravenwood-services-jarjar-rules",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700164}
165
Jeff Sharkey7037e352024-02-27 14:22:24 -0700166// Separated out from ravenwood-junit-impl since it needs to compile
167// against `module_current`
168java_library {
169 name: "ravenwood-junit-impl-flag",
170 srcs: [
171 "junit-flag-src/**/*.java",
172 ],
Liana Kazanova0c16dd32024-06-25 20:40:04 +0000173 sdk_version: "module_current",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700174 libs: [
175 "junit",
176 "flag-junit",
177 ],
178 visibility: ["//visibility:public"],
179}
180
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700181// Carefully compiles against only test_current to support tests that
182// want to verify they're unbundled. The "impl" library above is what
183// ships inside the Ravenwood environment to actually drive any API
184// access to implementation details.
185java_library {
186 name: "ravenwood-junit",
187 srcs: [
188 "junit-src/**/*.java",
189 "junit-stub-src/**/*.java",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700190 "junit-flag-src/**/*.java",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700191 ],
192 sdk_version: "test_current",
Makoto Onukidf9cd262024-05-16 15:44:38 -0700193 static_libs: [
194 "ravenwood-runtime-common",
195 "ravenwood-runtime-common-device",
196 ],
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700197 libs: [
198 "junit",
Jeff Sharkey7037e352024-02-27 14:22:24 -0700199 "flag-junit",
Jeff Sharkey41cfbb32023-11-16 09:26:28 -0700200 ],
Jeff Sharkey91f414e2023-11-07 15:43:59 -0700201 visibility: ["//visibility:public"],
202}
Jeff Sharkey4ee8a652023-11-14 08:45:56 -0700203
Jeff Sharkey8a922ec2024-02-27 12:36:36 -0700204// Library used to publish a handful of `android.ravenwood` APIs into
205// the Ravenwood BCP; we don't want to publish these APIs into the BCP
206// on physical devices, which is why this is a separate library
207java_library {
208 name: "ravenwood-framework",
209 srcs: [
210 "framework-src/**/*.java",
211 ],
212 libs: [
213 "framework-minus-apex.ravenwood",
214 ],
215 sdk_version: "core_current",
216 visibility: ["//visibility:public"],
217}
218
Jeff Sharkeyc91451a2024-01-29 10:55:45 -0700219java_host_for_device {
220 name: "androidx.test.monitor-for-device",
221 libs: [
222 "androidx.test.monitor-for-host",
223 ],
224}
225
226java_device_for_host {
227 name: "androidx.test.monitor-for-host",
228 libs: [
229 "androidx.test.monitor",
230 ],
231}
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700232
233filegroup {
234 name: "ravenwood-services-jarjar-rules",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700235 srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700236 visibility: ["//frameworks/base"],
237}
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700238
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700239cc_library_shared {
240 name: "libravenwood_runtime",
241 host_supported: true,
242
243 cflags: [
244 "-Wall",
245 "-Werror",
246 "-Wno-unused-parameter",
247 "-Wthread-safety",
248 ],
249
250 srcs: [
Makoto Onukidf9cd262024-05-16 15:44:38 -0700251 "runtime-jni/*.cpp",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700252 ],
253
254 shared_libs: [
255 "libbase",
256 "liblog",
257 "libnativehelper",
258 "libutils",
259 "libcutils",
260 ],
261 visibility: ["//frameworks/base"],
262}
263
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700264// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
265// The "test" just shows the available stats filenames.
266sh_test_host {
267 name: "ravenwood-stats-checker",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700268 src: "scripts/ravenwood-stats-checker.sh",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700269 test_suites: ["general-tests"],
270 data: [
271 ":framework-minus-apex.ravenwood.stats",
Makoto Onuki434d72822024-04-25 11:03:41 -0700272 ":framework-minus-apex.ravenwood.apis",
Makoto Onukie6ee0222024-05-14 10:26:07 -0700273 ":framework-minus-apex.ravenwood.keep_all",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700274 ":services.core.ravenwood.stats",
Makoto Onuki434d72822024-04-25 11:03:41 -0700275 ":services.core.ravenwood.apis",
Makoto Onukie6ee0222024-05-14 10:26:07 -0700276 ":services.core.ravenwood.keep_all",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700277 ],
278}
Makoto Onukie5e97272024-05-23 10:49:31 -0700279
280java_library {
281 name: "services.fakes.ravenwood-jarjar",
282 installable: false,
283 srcs: [":services.fakes-sources"],
284 libs: [
285 "ravenwood-framework",
286 "services.core.ravenwood",
287 ],
288 jarjar_rules: ":ravenwood-services-jarjar-rules",
289 visibility: ["//visibility:private"],
290}
291
292java_library {
293 name: "mockito-ravenwood-prebuilt",
294 installable: false,
295 static_libs: [
296 "mockito-robolectric-prebuilt",
297 ],
298}
299
300java_library {
301 name: "inline-mockito-ravenwood-prebuilt",
302 installable: false,
303 static_libs: [
304 "inline-mockito-robolectric-prebuilt",
305 ],
306}
307
308android_ravenwood_libgroup {
309 name: "ravenwood-runtime",
310 libs: [
311 "100-framework-minus-apex.ravenwood",
312 "200-kxml2-android",
313
314 "ravenwood-runtime-common-ravenwood",
315
316 "android.test.mock.ravenwood",
317 "ravenwood-helper-runtime",
318 "hoststubgen-helper-runtime.ravenwood",
319 "services.core.ravenwood-jarjar",
320 "services.fakes.ravenwood-jarjar",
321
322 // Provide runtime versions of utils linked in below
323 "junit",
324 "truth",
325 "flag-junit",
326 "ravenwood-framework",
327 "ravenwood-junit-impl",
328 "ravenwood-junit-impl-flag",
329 "mockito-ravenwood-prebuilt",
330 "inline-mockito-ravenwood-prebuilt",
331
332 // It's a stub, so it should be towards the end.
333 "z00-all-updatable-modules-system-stubs",
334 ],
335 jni_libs: [
336 "libandroid_runtime",
337 "libravenwood_runtime",
338 ],
339}
340
341android_ravenwood_libgroup {
342 name: "ravenwood-utils",
343 libs: [
344 "junit",
345 "truth",
346 "flag-junit",
347 "ravenwood-framework",
348 "ravenwood-junit",
349 "mockito-ravenwood-prebuilt",
350 "inline-mockito-ravenwood-prebuilt",
351 ],
352}