blob: 4c8febf2aa2fdb80cd826e4a9aea9e821d415619 [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 {
Makoto Onukif38d5992024-05-30 10:40:50 -0700234 name: "ravenwood-framework-jarjar-rules",
235 srcs: ["texts/ravenwood-framework-jarjar-rules.txt"],
236 visibility: ["//frameworks/base"],
237}
238
239filegroup {
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700240 name: "ravenwood-services-jarjar-rules",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700241 srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
Jeff Sharkey3e91c2b2024-02-15 14:12:07 -0700242 visibility: ["//frameworks/base"],
243}
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700244
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700245cc_library_shared {
246 name: "libravenwood_runtime",
247 host_supported: true,
248
249 cflags: [
250 "-Wall",
251 "-Werror",
252 "-Wno-unused-parameter",
253 "-Wthread-safety",
254 ],
255
256 srcs: [
Makoto Onukidf9cd262024-05-16 15:44:38 -0700257 "runtime-jni/*.cpp",
Makoto Onukiaedf30b2024-05-01 11:16:50 -0700258 ],
259
260 shared_libs: [
261 "libbase",
262 "liblog",
263 "libnativehelper",
264 "libutils",
265 "libcutils",
266 ],
267 visibility: ["//frameworks/base"],
268}
269
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700270// For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/.
271// The "test" just shows the available stats filenames.
272sh_test_host {
273 name: "ravenwood-stats-checker",
Makoto Onukia3fe5622024-03-27 13:08:32 -0700274 src: "scripts/ravenwood-stats-checker.sh",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700275 test_suites: ["general-tests"],
276 data: [
277 ":framework-minus-apex.ravenwood.stats",
Makoto Onuki434d72822024-04-25 11:03:41 -0700278 ":framework-minus-apex.ravenwood.apis",
Makoto Onukie6ee0222024-05-14 10:26:07 -0700279 ":framework-minus-apex.ravenwood.keep_all",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700280 ":services.core.ravenwood.stats",
Makoto Onuki434d72822024-04-25 11:03:41 -0700281 ":services.core.ravenwood.apis",
Makoto Onukie6ee0222024-05-14 10:26:07 -0700282 ":services.core.ravenwood.keep_all",
Makoto Onuki3fb1f2b2024-03-27 13:08:32 -0700283 ],
284}
Makoto Onukie5e97272024-05-23 10:49:31 -0700285
286java_library {
287 name: "services.fakes.ravenwood-jarjar",
288 installable: false,
289 srcs: [":services.fakes-sources"],
290 libs: [
291 "ravenwood-framework",
292 "services.core.ravenwood",
293 ],
294 jarjar_rules: ":ravenwood-services-jarjar-rules",
295 visibility: ["//visibility:private"],
296}
297
298java_library {
299 name: "mockito-ravenwood-prebuilt",
300 installable: false,
301 static_libs: [
302 "mockito-robolectric-prebuilt",
303 ],
304}
305
306java_library {
307 name: "inline-mockito-ravenwood-prebuilt",
308 installable: false,
309 static_libs: [
310 "inline-mockito-robolectric-prebuilt",
311 ],
312}
313
314android_ravenwood_libgroup {
315 name: "ravenwood-runtime",
316 libs: [
317 "100-framework-minus-apex.ravenwood",
318 "200-kxml2-android",
319
320 "ravenwood-runtime-common-ravenwood",
321
322 "android.test.mock.ravenwood",
323 "ravenwood-helper-runtime",
324 "hoststubgen-helper-runtime.ravenwood",
325 "services.core.ravenwood-jarjar",
326 "services.fakes.ravenwood-jarjar",
327
328 // Provide runtime versions of utils linked in below
329 "junit",
330 "truth",
331 "flag-junit",
332 "ravenwood-framework",
333 "ravenwood-junit-impl",
334 "ravenwood-junit-impl-flag",
335 "mockito-ravenwood-prebuilt",
336 "inline-mockito-ravenwood-prebuilt",
337
338 // It's a stub, so it should be towards the end.
339 "z00-all-updatable-modules-system-stubs",
340 ],
341 jni_libs: [
342 "libandroid_runtime",
343 "libravenwood_runtime",
344 ],
345}
346
347android_ravenwood_libgroup {
348 name: "ravenwood-utils",
349 libs: [
350 "junit",
351 "truth",
352 "flag-junit",
353 "ravenwood-framework",
354 "ravenwood-junit",
355 "mockito-ravenwood-prebuilt",
356 "inline-mockito-ravenwood-prebuilt",
357 ],
358}