Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 1 | package { |
| 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 | |
| 10 | filegroup { |
| 11 | name: "ravenwood-annotations", |
| 12 | srcs: [ |
| 13 | "annotations-src/**/*.java", |
| 14 | ], |
Anton Hansson | d82cbc7 | 2023-10-30 20:00:39 +0000 | [diff] [blame] | 15 | path: "annotations-src", |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 16 | visibility: ["//visibility:public"], |
| 17 | } |
| 18 | |
Makoto Onuki | dfade84 | 2024-05-02 15:42:08 -0700 | [diff] [blame] | 19 | filegroup { |
| 20 | name: "ravenwood-services-policies", |
| 21 | srcs: [ |
| 22 | "texts/ravenwood-services-policies.txt", |
| 23 | ], |
| 24 | visibility: ["//visibility:public"], |
| 25 | } |
| 26 | |
| 27 | filegroup { |
| 28 | name: "ravenwood-framework-policies", |
| 29 | srcs: [ |
| 30 | "texts/ravenwood-framework-policies.txt", |
| 31 | ], |
| 32 | visibility: ["//visibility:public"], |
| 33 | } |
| 34 | |
| 35 | filegroup { |
| 36 | name: "ravenwood-standard-options", |
| 37 | srcs: [ |
| 38 | "texts/ravenwood-standard-options.txt", |
| 39 | ], |
| 40 | visibility: ["//visibility:public"], |
| 41 | } |
| 42 | |
| 43 | filegroup { |
| 44 | name: "ravenwood-annotation-allowed-classes", |
| 45 | srcs: [ |
| 46 | "texts/ravenwood-annotation-allowed-classes.txt", |
| 47 | ], |
| 48 | visibility: ["//visibility:public"], |
| 49 | } |
| 50 | |
Makoto Onuki | 3aefe33 | 2023-10-06 10:02:07 -0700 | [diff] [blame] | 51 | java_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 Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 58 | |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 59 | // 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. |
| 64 | java_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 | ], |
Makoto Onuki | e49a772 | 2024-07-19 16:45:02 -0700 | [diff] [blame] | 71 | visibility: [ |
| 72 | // Some tests need to access the utilities. |
| 73 | ":__subpackages__", |
| 74 | ], |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | java_library { |
| 78 | name: "ravenwood-runtime-common-device", |
| 79 | host_supported: true, |
| 80 | sdk_version: "core_current", |
| 81 | srcs: [ |
| 82 | "runtime-common-device-src/**/*.java", |
| 83 | ], |
| 84 | visibility: ["//visibility:private"], |
| 85 | } |
| 86 | |
| 87 | java_library { |
| 88 | name: "ravenwood-runtime-common", |
| 89 | host_supported: true, |
| 90 | sdk_version: "core_current", |
| 91 | srcs: [ |
| 92 | "runtime-common-src/**/*.java", |
| 93 | ], |
| 94 | libs: [ |
| 95 | "ravenwood-runtime-common-ravenwood", |
| 96 | ], |
| 97 | visibility: ["//visibility:private"], |
| 98 | } |
| 99 | |
Makoto Onuki | 053eac8 | 2024-02-13 10:31:18 -0800 | [diff] [blame] | 100 | java_library_host { |
| 101 | name: "ravenwood-helper-libcore-runtime.host", |
| 102 | srcs: [ |
| 103 | "runtime-helper-src/libcore-fake/**/*.java", |
| 104 | ], |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 105 | static_libs: [ |
| 106 | "ravenwood-runtime-common", |
| 107 | ], |
Makoto Onuki | 053eac8 | 2024-02-13 10:31:18 -0800 | [diff] [blame] | 108 | visibility: ["//visibility:private"], |
| 109 | } |
| 110 | |
| 111 | java_host_for_device { |
| 112 | name: "ravenwood-helper-libcore-runtime", |
| 113 | libs: [ |
| 114 | "ravenwood-helper-libcore-runtime.host", |
| 115 | ], |
| 116 | visibility: ["//visibility:private"], |
| 117 | } |
| 118 | |
| 119 | java_library { |
| 120 | name: "ravenwood-helper-framework-runtime", |
| 121 | srcs: [ |
| 122 | "runtime-helper-src/framework/**/*.java", |
| 123 | ], |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 124 | static_libs: [ |
| 125 | "ravenwood-runtime-common", |
| 126 | ], |
Makoto Onuki | 053eac8 | 2024-02-13 10:31:18 -0800 | [diff] [blame] | 127 | libs: [ |
| 128 | "framework-minus-apex.ravenwood", |
Makoto Onuki | 50276f0 | 2024-02-13 14:58:56 -0800 | [diff] [blame] | 129 | "ravenwood-junit", |
Makoto Onuki | 053eac8 | 2024-02-13 10:31:18 -0800 | [diff] [blame] | 130 | ], |
| 131 | visibility: ["//visibility:private"], |
| 132 | } |
| 133 | |
| 134 | // Combine ravenwood-helper-*-runtime and create a single library, which we include |
| 135 | // in the ravenwood runtime. |
| 136 | // We do it this way rather than including the individual jars in the runtime, because |
| 137 | // for some reason we couldn't include a java_host_for_device module in the ravenwood runtime. |
| 138 | java_library { |
| 139 | name: "ravenwood-helper-runtime", |
| 140 | defaults: ["ravenwood-internal-only-visibility-java"], |
| 141 | static_libs: [ |
| 142 | "ravenwood-helper-framework-runtime", |
| 143 | "ravenwood-helper-libcore-runtime", |
| 144 | ], |
| 145 | } |
| 146 | |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 147 | java_library { |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 148 | name: "ravenwood-junit-impl", |
| 149 | srcs: [ |
| 150 | "junit-src/**/*.java", |
| 151 | "junit-impl-src/**/*.java", |
| 152 | ], |
Jeff Sharkey | c91451a | 2024-01-29 10:55:45 -0700 | [diff] [blame] | 153 | static_libs: [ |
| 154 | "androidx.test.monitor-for-device", |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 155 | "ravenwood-runtime-common", |
Jeff Sharkey | c91451a | 2024-01-29 10:55:45 -0700 | [diff] [blame] | 156 | ], |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 157 | libs: [ |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 158 | "android.test.mock", |
Jeff Sharkey | 5e210d7 | 2023-11-10 11:22:05 -0700 | [diff] [blame] | 159 | "framework-minus-apex.ravenwood", |
Jeff Sharkey | 8a922ec | 2024-02-27 12:36:36 -0700 | [diff] [blame] | 160 | "ravenwood-framework", |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 161 | "services.core.ravenwood", |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 162 | "junit", |
| 163 | ], |
Makoto Onuki | a8bcba1 | 2023-11-22 14:00:24 -0800 | [diff] [blame] | 164 | sdk_version: "core_current", |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 165 | visibility: ["//frameworks/base"], |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 166 | jarjar_rules: ":ravenwood-services-jarjar-rules", |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 167 | } |
| 168 | |
Jeff Sharkey | 7037e35 | 2024-02-27 14:22:24 -0700 | [diff] [blame] | 169 | // Separated out from ravenwood-junit-impl since it needs to compile |
| 170 | // against `module_current` |
| 171 | java_library { |
| 172 | name: "ravenwood-junit-impl-flag", |
| 173 | srcs: [ |
| 174 | "junit-flag-src/**/*.java", |
| 175 | ], |
Liana Kazanova | 0c16dd3 | 2024-06-25 20:40:04 +0000 | [diff] [blame] | 176 | sdk_version: "module_current", |
Jeff Sharkey | 7037e35 | 2024-02-27 14:22:24 -0700 | [diff] [blame] | 177 | libs: [ |
| 178 | "junit", |
| 179 | "flag-junit", |
| 180 | ], |
| 181 | visibility: ["//visibility:public"], |
| 182 | } |
| 183 | |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 184 | // Carefully compiles against only test_current to support tests that |
| 185 | // want to verify they're unbundled. The "impl" library above is what |
| 186 | // ships inside the Ravenwood environment to actually drive any API |
| 187 | // access to implementation details. |
Felipe Leme | dfbfb23 | 2024-07-23 05:31:38 +0000 | [diff] [blame] | 188 | // This library needs to be statically linked to mainline tests as well, |
| 189 | // which need to be able to run on multiple API levels, so we can't use |
| 190 | // test APIs in this module. |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 191 | java_library { |
| 192 | name: "ravenwood-junit", |
| 193 | srcs: [ |
| 194 | "junit-src/**/*.java", |
| 195 | "junit-stub-src/**/*.java", |
Jeff Sharkey | 7037e35 | 2024-02-27 14:22:24 -0700 | [diff] [blame] | 196 | "junit-flag-src/**/*.java", |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 197 | ], |
Felipe Leme | dfbfb23 | 2024-07-23 05:31:38 +0000 | [diff] [blame] | 198 | sdk_version: "module_current", |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 199 | static_libs: [ |
| 200 | "ravenwood-runtime-common", |
| 201 | "ravenwood-runtime-common-device", |
| 202 | ], |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 203 | libs: [ |
| 204 | "junit", |
Jeff Sharkey | 7037e35 | 2024-02-27 14:22:24 -0700 | [diff] [blame] | 205 | "flag-junit", |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 206 | ], |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 207 | visibility: ["//visibility:public"], |
| 208 | } |
Jeff Sharkey | 4ee8a65 | 2023-11-14 08:45:56 -0700 | [diff] [blame] | 209 | |
Jeff Sharkey | 8a922ec | 2024-02-27 12:36:36 -0700 | [diff] [blame] | 210 | // Library used to publish a handful of `android.ravenwood` APIs into |
| 211 | // the Ravenwood BCP; we don't want to publish these APIs into the BCP |
| 212 | // on physical devices, which is why this is a separate library |
| 213 | java_library { |
| 214 | name: "ravenwood-framework", |
| 215 | srcs: [ |
| 216 | "framework-src/**/*.java", |
| 217 | ], |
| 218 | libs: [ |
| 219 | "framework-minus-apex.ravenwood", |
| 220 | ], |
| 221 | sdk_version: "core_current", |
| 222 | visibility: ["//visibility:public"], |
| 223 | } |
| 224 | |
Jeff Sharkey | c91451a | 2024-01-29 10:55:45 -0700 | [diff] [blame] | 225 | java_host_for_device { |
| 226 | name: "androidx.test.monitor-for-device", |
| 227 | libs: [ |
| 228 | "androidx.test.monitor-for-host", |
| 229 | ], |
| 230 | } |
| 231 | |
| 232 | java_device_for_host { |
| 233 | name: "androidx.test.monitor-for-host", |
| 234 | libs: [ |
| 235 | "androidx.test.monitor", |
| 236 | ], |
| 237 | } |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 238 | |
| 239 | filegroup { |
Makoto Onuki | f38d599 | 2024-05-30 10:40:50 -0700 | [diff] [blame] | 240 | name: "ravenwood-framework-jarjar-rules", |
| 241 | srcs: ["texts/ravenwood-framework-jarjar-rules.txt"], |
| 242 | visibility: ["//frameworks/base"], |
| 243 | } |
| 244 | |
| 245 | filegroup { |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 246 | name: "ravenwood-services-jarjar-rules", |
Makoto Onuki | a3fe562 | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 247 | srcs: ["texts/ravenwood-services-jarjar-rules.txt"], |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 248 | visibility: ["//frameworks/base"], |
| 249 | } |
Makoto Onuki | 3fb1f2b | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 250 | |
Makoto Onuki | aedf30b | 2024-05-01 11:16:50 -0700 | [diff] [blame] | 251 | cc_library_shared { |
| 252 | name: "libravenwood_runtime", |
| 253 | host_supported: true, |
| 254 | |
| 255 | cflags: [ |
| 256 | "-Wall", |
| 257 | "-Werror", |
| 258 | "-Wno-unused-parameter", |
| 259 | "-Wthread-safety", |
| 260 | ], |
| 261 | |
| 262 | srcs: [ |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 263 | "runtime-jni/*.cpp", |
Makoto Onuki | aedf30b | 2024-05-01 11:16:50 -0700 | [diff] [blame] | 264 | ], |
| 265 | |
| 266 | shared_libs: [ |
| 267 | "libbase", |
| 268 | "liblog", |
| 269 | "libnativehelper", |
| 270 | "libutils", |
| 271 | "libcutils", |
| 272 | ], |
| 273 | visibility: ["//frameworks/base"], |
| 274 | } |
| 275 | |
Makoto Onuki | 3fb1f2b | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 276 | // For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/. |
| 277 | // The "test" just shows the available stats filenames. |
| 278 | sh_test_host { |
| 279 | name: "ravenwood-stats-checker", |
Makoto Onuki | a3fe562 | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 280 | src: "scripts/ravenwood-stats-checker.sh", |
Makoto Onuki | 3fb1f2b | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 281 | test_suites: ["general-tests"], |
| 282 | data: [ |
Makoto Onuki | 134a415 | 2024-06-26 14:21:12 -0700 | [diff] [blame] | 283 | ":framework-minus-apex.ravenwood-base{hoststubgen_framework-minus-apex_stats.csv}", |
| 284 | ":framework-minus-apex.ravenwood-base{hoststubgen_framework-minus-apex_apis.csv}", |
| 285 | ":framework-minus-apex.ravenwood-base{hoststubgen_framework-minus-apex_keep_all.txt}", |
| 286 | ":framework-minus-apex.ravenwood-base{hoststubgen_framework-minus-apex_dump.txt}", |
| 287 | ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}", |
| 288 | ":services.core.ravenwood-base{hoststubgen_services.core_apis.csv}", |
| 289 | ":services.core.ravenwood-base{hoststubgen_services.core_keep_all.txt}", |
| 290 | ":services.core.ravenwood-base{hoststubgen_services.core_dump.txt}", |
Makoto Onuki | 3fb1f2b | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 291 | ], |
| 292 | } |
Makoto Onuki | e5e9727 | 2024-05-23 10:49:31 -0700 | [diff] [blame] | 293 | |
| 294 | java_library { |
| 295 | name: "services.fakes.ravenwood-jarjar", |
| 296 | installable: false, |
| 297 | srcs: [":services.fakes-sources"], |
| 298 | libs: [ |
| 299 | "ravenwood-framework", |
| 300 | "services.core.ravenwood", |
| 301 | ], |
| 302 | jarjar_rules: ":ravenwood-services-jarjar-rules", |
| 303 | visibility: ["//visibility:private"], |
| 304 | } |
| 305 | |
| 306 | java_library { |
| 307 | name: "mockito-ravenwood-prebuilt", |
| 308 | installable: false, |
| 309 | static_libs: [ |
| 310 | "mockito-robolectric-prebuilt", |
| 311 | ], |
| 312 | } |
| 313 | |
| 314 | java_library { |
| 315 | name: "inline-mockito-ravenwood-prebuilt", |
| 316 | installable: false, |
| 317 | static_libs: [ |
| 318 | "inline-mockito-robolectric-prebuilt", |
| 319 | ], |
| 320 | } |
| 321 | |
| 322 | android_ravenwood_libgroup { |
| 323 | name: "ravenwood-runtime", |
Makoto Onuki | e49a772 | 2024-07-19 16:45:02 -0700 | [diff] [blame] | 324 | data: [ |
| 325 | "framework-res", |
| 326 | ], |
Makoto Onuki | e5e9727 | 2024-05-23 10:49:31 -0700 | [diff] [blame] | 327 | libs: [ |
| 328 | "100-framework-minus-apex.ravenwood", |
| 329 | "200-kxml2-android", |
| 330 | |
| 331 | "ravenwood-runtime-common-ravenwood", |
| 332 | |
| 333 | "android.test.mock.ravenwood", |
| 334 | "ravenwood-helper-runtime", |
| 335 | "hoststubgen-helper-runtime.ravenwood", |
| 336 | "services.core.ravenwood-jarjar", |
| 337 | "services.fakes.ravenwood-jarjar", |
| 338 | |
Makoto Onuki | 953445b | 2024-07-19 11:21:29 -0700 | [diff] [blame] | 339 | // ICU |
| 340 | "core-icu4j-for-host.ravenwood", |
| 341 | "icu4j-icudata-jarjar", |
| 342 | "icu4j-icutzdata-jarjar", |
| 343 | |
Makoto Onuki | e5e9727 | 2024-05-23 10:49:31 -0700 | [diff] [blame] | 344 | // Provide runtime versions of utils linked in below |
| 345 | "junit", |
| 346 | "truth", |
| 347 | "flag-junit", |
| 348 | "ravenwood-framework", |
| 349 | "ravenwood-junit-impl", |
| 350 | "ravenwood-junit-impl-flag", |
| 351 | "mockito-ravenwood-prebuilt", |
| 352 | "inline-mockito-ravenwood-prebuilt", |
| 353 | |
| 354 | // It's a stub, so it should be towards the end. |
| 355 | "z00-all-updatable-modules-system-stubs", |
| 356 | ], |
| 357 | jni_libs: [ |
| 358 | "libandroid_runtime", |
| 359 | "libravenwood_runtime", |
| 360 | ], |
| 361 | } |
| 362 | |
| 363 | android_ravenwood_libgroup { |
| 364 | name: "ravenwood-utils", |
| 365 | libs: [ |
| 366 | "junit", |
| 367 | "truth", |
| 368 | "flag-junit", |
| 369 | "ravenwood-framework", |
| 370 | "ravenwood-junit", |
| 371 | "mockito-ravenwood-prebuilt", |
| 372 | "inline-mockito-ravenwood-prebuilt", |
| 373 | ], |
| 374 | } |