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 | ], |
| 71 | visibility: ["//frameworks/base"], |
| 72 | } |
| 73 | |
| 74 | java_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 | |
| 84 | java_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 Onuki | 053eac8 | 2024-02-13 10:31:18 -0800 | [diff] [blame] | 97 | java_library_host { |
| 98 | name: "ravenwood-helper-libcore-runtime.host", |
| 99 | srcs: [ |
| 100 | "runtime-helper-src/libcore-fake/**/*.java", |
| 101 | ], |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 102 | static_libs: [ |
| 103 | "ravenwood-runtime-common", |
| 104 | ], |
Makoto Onuki | 053eac8 | 2024-02-13 10:31:18 -0800 | [diff] [blame] | 105 | visibility: ["//visibility:private"], |
| 106 | } |
| 107 | |
| 108 | java_host_for_device { |
| 109 | name: "ravenwood-helper-libcore-runtime", |
| 110 | libs: [ |
| 111 | "ravenwood-helper-libcore-runtime.host", |
| 112 | ], |
| 113 | visibility: ["//visibility:private"], |
| 114 | } |
| 115 | |
| 116 | java_library { |
| 117 | name: "ravenwood-helper-framework-runtime", |
| 118 | srcs: [ |
| 119 | "runtime-helper-src/framework/**/*.java", |
| 120 | ], |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 121 | static_libs: [ |
| 122 | "ravenwood-runtime-common", |
| 123 | ], |
Makoto Onuki | 053eac8 | 2024-02-13 10:31:18 -0800 | [diff] [blame] | 124 | libs: [ |
| 125 | "framework-minus-apex.ravenwood", |
Makoto Onuki | 50276f0 | 2024-02-13 14:58:56 -0800 | [diff] [blame] | 126 | "ravenwood-junit", |
Makoto Onuki | 053eac8 | 2024-02-13 10:31:18 -0800 | [diff] [blame] | 127 | ], |
| 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. |
| 135 | java_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 Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 144 | java_library { |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 145 | name: "ravenwood-junit-impl", |
| 146 | srcs: [ |
| 147 | "junit-src/**/*.java", |
| 148 | "junit-impl-src/**/*.java", |
| 149 | ], |
Jeff Sharkey | c91451a | 2024-01-29 10:55:45 -0700 | [diff] [blame] | 150 | static_libs: [ |
| 151 | "androidx.test.monitor-for-device", |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 152 | "ravenwood-runtime-common", |
Jeff Sharkey | c91451a | 2024-01-29 10:55:45 -0700 | [diff] [blame] | 153 | ], |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 154 | libs: [ |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 155 | "android.test.mock", |
Jeff Sharkey | 5e210d7 | 2023-11-10 11:22:05 -0700 | [diff] [blame] | 156 | "framework-minus-apex.ravenwood", |
Jeff Sharkey | 8a922ec | 2024-02-27 12:36:36 -0700 | [diff] [blame] | 157 | "ravenwood-framework", |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 158 | "services.core.ravenwood", |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 159 | "junit", |
| 160 | ], |
Makoto Onuki | a8bcba1 | 2023-11-22 14:00:24 -0800 | [diff] [blame] | 161 | sdk_version: "core_current", |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 162 | visibility: ["//frameworks/base"], |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 163 | jarjar_rules: ":ravenwood-services-jarjar-rules", |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 164 | } |
| 165 | |
Jeff Sharkey | 7037e35 | 2024-02-27 14:22:24 -0700 | [diff] [blame] | 166 | // Separated out from ravenwood-junit-impl since it needs to compile |
| 167 | // against `module_current` |
| 168 | java_library { |
| 169 | name: "ravenwood-junit-impl-flag", |
| 170 | srcs: [ |
| 171 | "junit-flag-src/**/*.java", |
| 172 | ], |
Liana Kazanova | 0c16dd3 | 2024-06-25 20:40:04 +0000 | [diff] [blame] | 173 | sdk_version: "module_current", |
Jeff Sharkey | 7037e35 | 2024-02-27 14:22:24 -0700 | [diff] [blame] | 174 | libs: [ |
| 175 | "junit", |
| 176 | "flag-junit", |
| 177 | ], |
| 178 | visibility: ["//visibility:public"], |
| 179 | } |
| 180 | |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 181 | // 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. |
| 185 | java_library { |
| 186 | name: "ravenwood-junit", |
| 187 | srcs: [ |
| 188 | "junit-src/**/*.java", |
| 189 | "junit-stub-src/**/*.java", |
Jeff Sharkey | 7037e35 | 2024-02-27 14:22:24 -0700 | [diff] [blame] | 190 | "junit-flag-src/**/*.java", |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 191 | ], |
| 192 | sdk_version: "test_current", |
Makoto Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 193 | static_libs: [ |
| 194 | "ravenwood-runtime-common", |
| 195 | "ravenwood-runtime-common-device", |
| 196 | ], |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 197 | libs: [ |
| 198 | "junit", |
Jeff Sharkey | 7037e35 | 2024-02-27 14:22:24 -0700 | [diff] [blame] | 199 | "flag-junit", |
Jeff Sharkey | 41cfbb3 | 2023-11-16 09:26:28 -0700 | [diff] [blame] | 200 | ], |
Jeff Sharkey | 91f414e | 2023-11-07 15:43:59 -0700 | [diff] [blame] | 201 | visibility: ["//visibility:public"], |
| 202 | } |
Jeff Sharkey | 4ee8a65 | 2023-11-14 08:45:56 -0700 | [diff] [blame] | 203 | |
Jeff Sharkey | 8a922ec | 2024-02-27 12:36:36 -0700 | [diff] [blame] | 204 | // 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 |
| 207 | java_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 Sharkey | c91451a | 2024-01-29 10:55:45 -0700 | [diff] [blame] | 219 | java_host_for_device { |
| 220 | name: "androidx.test.monitor-for-device", |
| 221 | libs: [ |
| 222 | "androidx.test.monitor-for-host", |
| 223 | ], |
| 224 | } |
| 225 | |
| 226 | java_device_for_host { |
| 227 | name: "androidx.test.monitor-for-host", |
| 228 | libs: [ |
| 229 | "androidx.test.monitor", |
| 230 | ], |
| 231 | } |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 232 | |
| 233 | filegroup { |
Makoto Onuki | f38d599 | 2024-05-30 10:40:50 -0700 | [diff] [blame^] | 234 | name: "ravenwood-framework-jarjar-rules", |
| 235 | srcs: ["texts/ravenwood-framework-jarjar-rules.txt"], |
| 236 | visibility: ["//frameworks/base"], |
| 237 | } |
| 238 | |
| 239 | filegroup { |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 240 | name: "ravenwood-services-jarjar-rules", |
Makoto Onuki | a3fe562 | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 241 | srcs: ["texts/ravenwood-services-jarjar-rules.txt"], |
Jeff Sharkey | 3e91c2b | 2024-02-15 14:12:07 -0700 | [diff] [blame] | 242 | visibility: ["//frameworks/base"], |
| 243 | } |
Makoto Onuki | 3fb1f2b | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 244 | |
Makoto Onuki | aedf30b | 2024-05-01 11:16:50 -0700 | [diff] [blame] | 245 | cc_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 Onuki | df9cd26 | 2024-05-16 15:44:38 -0700 | [diff] [blame] | 257 | "runtime-jni/*.cpp", |
Makoto Onuki | aedf30b | 2024-05-01 11:16:50 -0700 | [diff] [blame] | 258 | ], |
| 259 | |
| 260 | shared_libs: [ |
| 261 | "libbase", |
| 262 | "liblog", |
| 263 | "libnativehelper", |
| 264 | "libutils", |
| 265 | "libcutils", |
| 266 | ], |
| 267 | visibility: ["//frameworks/base"], |
| 268 | } |
| 269 | |
Makoto Onuki | 3fb1f2b | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 270 | // 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. |
| 272 | sh_test_host { |
| 273 | name: "ravenwood-stats-checker", |
Makoto Onuki | a3fe562 | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 274 | src: "scripts/ravenwood-stats-checker.sh", |
Makoto Onuki | 3fb1f2b | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 275 | test_suites: ["general-tests"], |
| 276 | data: [ |
| 277 | ":framework-minus-apex.ravenwood.stats", |
Makoto Onuki | 434d7282 | 2024-04-25 11:03:41 -0700 | [diff] [blame] | 278 | ":framework-minus-apex.ravenwood.apis", |
Makoto Onuki | e6ee022 | 2024-05-14 10:26:07 -0700 | [diff] [blame] | 279 | ":framework-minus-apex.ravenwood.keep_all", |
Makoto Onuki | 3fb1f2b | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 280 | ":services.core.ravenwood.stats", |
Makoto Onuki | 434d7282 | 2024-04-25 11:03:41 -0700 | [diff] [blame] | 281 | ":services.core.ravenwood.apis", |
Makoto Onuki | e6ee022 | 2024-05-14 10:26:07 -0700 | [diff] [blame] | 282 | ":services.core.ravenwood.keep_all", |
Makoto Onuki | 3fb1f2b | 2024-03-27 13:08:32 -0700 | [diff] [blame] | 283 | ], |
| 284 | } |
Makoto Onuki | e5e9727 | 2024-05-23 10:49:31 -0700 | [diff] [blame] | 285 | |
| 286 | java_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 | |
| 298 | java_library { |
| 299 | name: "mockito-ravenwood-prebuilt", |
| 300 | installable: false, |
| 301 | static_libs: [ |
| 302 | "mockito-robolectric-prebuilt", |
| 303 | ], |
| 304 | } |
| 305 | |
| 306 | java_library { |
| 307 | name: "inline-mockito-ravenwood-prebuilt", |
| 308 | installable: false, |
| 309 | static_libs: [ |
| 310 | "inline-mockito-robolectric-prebuilt", |
| 311 | ], |
| 312 | } |
| 313 | |
| 314 | android_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 | |
| 347 | android_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 | } |