package { // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" // to get the below license kinds: // SPDX-license-identifier-Apache-2.0 default_applicable_licenses: ["frameworks_base_license"], } filegroup { name: "ravenwood-annotations", srcs: [ "annotations-src/**/*.java", ], path: "annotations-src", visibility: ["//visibility:public"], } filegroup { name: "ravenwood-services-policies", srcs: [ "texts/ravenwood-services-policies.txt", ], visibility: ["//visibility:public"], } filegroup { name: "ravenwood-framework-policies", srcs: [ "texts/ravenwood-framework-policies.txt", ], visibility: ["//visibility:public"], } filegroup { name: "ravenwood-standard-options", srcs: [ "texts/ravenwood-standard-options.txt", ], visibility: ["//visibility:public"], } filegroup { name: "ravenwood-annotation-allowed-classes", srcs: [ "texts/ravenwood-annotation-allowed-classes.txt", ], visibility: ["//visibility:public"], } java_library { name: "ravenwood-annotations-lib", srcs: [":ravenwood-annotations"], sdk_version: "core_current", host_supported: true, visibility: ["//visibility:public"], } // This and the next module contain the same classes with different implementations. // "ravenwood-runtime-common-device" will be statically linked in device side tests. // "ravenwood-runtime-common-ravenwood" will only exist in ravenwood-runtime, which will take // precedence even if the test jar (accidentally) contains "ravenwood-runtime-common-device". // "ravenwood-runtime-common" uses it to detect if the rutime is Ravenwood or not. java_library { name: "ravenwood-runtime-common-ravenwood", host_supported: true, sdk_version: "core_current", srcs: [ "runtime-common-ravenwood-src/**/*.java", ], visibility: [ // Some tests need to access the utilities. ":__subpackages__", ], } java_library { name: "ravenwood-runtime-common-device", host_supported: true, sdk_version: "core_current", srcs: [ "runtime-common-device-src/**/*.java", ], visibility: ["//visibility:private"], } java_library { name: "ravenwood-runtime-common", host_supported: true, sdk_version: "core_current", srcs: [ "runtime-common-src/**/*.java", ], libs: [ "ravenwood-runtime-common-ravenwood", ], visibility: ["//visibility:private"], } java_library_host { name: "ravenwood-helper-libcore-runtime.host", srcs: [ "runtime-helper-src/libcore-fake/**/*.java", ], static_libs: [ "ravenwood-runtime-common", ], visibility: ["//visibility:private"], } java_host_for_device { name: "ravenwood-helper-libcore-runtime", libs: [ "ravenwood-helper-libcore-runtime.host", ], visibility: ["//visibility:private"], } java_library { name: "ravenwood-helper-framework-runtime", srcs: [ "runtime-helper-src/framework/**/*.java", ], static_libs: [ "ravenwood-runtime-common", ], libs: [ "framework-minus-apex.ravenwood", "ravenwood-junit", ], visibility: ["//visibility:private"], } // Combine ravenwood-helper-*-runtime and create a single library, which we include // in the ravenwood runtime. // We do it this way rather than including the individual jars in the runtime, because // for some reason we couldn't include a java_host_for_device module in the ravenwood runtime. java_library { name: "ravenwood-helper-runtime", defaults: ["ravenwood-internal-only-visibility-java"], static_libs: [ "ravenwood-helper-framework-runtime", "ravenwood-helper-libcore-runtime", ], } java_library { name: "ravenwood-junit-impl", srcs: [ "junit-src/**/*.java", "junit-impl-src/**/*.java", ], static_libs: [ "androidx.test.monitor-for-device", "ravenwood-runtime-common", ], libs: [ "android.test.mock", "framework-minus-apex.ravenwood", "ravenwood-framework", "services.core.ravenwood", "junit", "framework-annotations-lib", ], sdk_version: "core_current", visibility: ["//frameworks/base"], jarjar_rules: ":ravenwood-services-jarjar-rules", } java_device_for_host { name: "ravenwood-junit-impl-for-ravenizer", libs: [ "ravenwood-junit-impl", ], visibility: [":__subpackages__"], } // Separated out from ravenwood-junit-impl since it needs to compile // against `module_current` java_library { name: "ravenwood-junit-impl-flag", srcs: [ "junit-flag-src/**/*.java", ], sdk_version: "module_current", libs: [ "junit", "flag-junit", ], visibility: ["//visibility:public"], } // Carefully compiles against only module_current to support tests that // want to verify they're unbundled. The "impl" library above is what // ships inside the Ravenwood environment to actually drive any API // access to implementation details. // We can't use test_current here because this library needs to be statically // linked to mainline tests as well, which can't use test APIs because they // need to be able to run on multiple API levels. java_library { name: "ravenwood-junit", srcs: [ "junit-src/**/*.java", "junit-stub-src/**/*.java", "junit-flag-src/**/*.java", ], sdk_version: "module_current", static_libs: [ "ravenwood-runtime-common", "ravenwood-runtime-common-device", ], libs: [ "junit", "flag-junit", "framework-annotations-lib", ], visibility: ["//visibility:public"], } // Library used to publish a handful of `android.ravenwood` APIs into // the Ravenwood BCP; we don't want to publish these APIs into the BCP // on physical devices, which is why this is a separate library java_library { name: "ravenwood-framework", srcs: [ "framework-src/**/*.java", ], libs: [ "framework-minus-apex.ravenwood", ], sdk_version: "core_current", visibility: ["//visibility:public"], } java_host_for_device { name: "androidx.test.monitor-for-device", libs: [ "androidx.test.monitor-for-host", ], } java_device_for_host { name: "androidx.test.monitor-for-host", libs: [ "androidx.test.monitor", ], } filegroup { name: "ravenwood-framework-jarjar-rules", srcs: ["texts/ravenwood-framework-jarjar-rules.txt"], visibility: ["//frameworks/base"], } filegroup { name: "ravenwood-services-jarjar-rules", srcs: ["texts/ravenwood-services-jarjar-rules.txt"], visibility: ["//frameworks/base"], } cc_library_shared { name: "libravenwood_runtime", host_supported: true, cflags: [ "-Wall", "-Werror", "-Wno-unused-parameter", "-Wthread-safety", ], srcs: [ "runtime-jni/*.cpp", ], shared_libs: [ "libbase", "liblog", "libnativehelper", "libutils", "libcutils", ], visibility: ["//frameworks/base"], } // For collecting the *stats.csv files in a known directory under out/host/linux-x86/testcases/. // The "test" just shows the available stats filenames. sh_test_host { name: "ravenwood-stats-checker", src: "scripts/ravenwood-stats-checker.sh", test_suites: ["general-tests"], data: [ ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_stats.csv}", ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_apis.csv}", ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_keep_all.txt}", ":framework-minus-apex.ravenwood-base_all{hoststubgen_framework-minus-apex_dump.txt}", ":services.core.ravenwood-base{hoststubgen_services.core_stats.csv}", ":services.core.ravenwood-base{hoststubgen_services.core_apis.csv}", ":services.core.ravenwood-base{hoststubgen_services.core_keep_all.txt}", ":services.core.ravenwood-base{hoststubgen_services.core_dump.txt}", ], } java_library { name: "services.fakes.ravenwood-jarjar", installable: false, srcs: [":services.fakes-sources"], libs: [ "ravenwood-framework", "services.core.ravenwood", ], jarjar_rules: ":ravenwood-services-jarjar-rules", visibility: ["//visibility:private"], } java_library { name: "mockito-ravenwood-prebuilt", installable: false, static_libs: [ "mockito-robolectric-prebuilt", ], } java_library { name: "inline-mockito-ravenwood-prebuilt", installable: false, static_libs: [ "inline-mockito-robolectric-prebuilt", ], } android_ravenwood_libgroup { name: "ravenwood-runtime", data: [ "framework-res", "ravenwood-empty-res", ], libs: [ "100-framework-minus-apex.ravenwood", "200-kxml2-android", "ravenwood-runtime-common-ravenwood", "android.test.mock.ravenwood", "ravenwood-helper-runtime", "hoststubgen-helper-runtime.ravenwood", "services.core.ravenwood-jarjar", "services.fakes.ravenwood-jarjar", // ICU "core-icu4j-for-host.ravenwood", "icu4j-icudata-jarjar", "icu4j-icutzdata-jarjar", // Provide runtime versions of utils linked in below "junit", "truth", "flag-junit", "ravenwood-framework", "ravenwood-junit-impl", "ravenwood-junit-impl-flag", "mockito-ravenwood-prebuilt", "inline-mockito-ravenwood-prebuilt", // It's a stub, so it should be towards the end. "z00-all-updatable-modules-system-stubs", ], jni_libs: [ "libandroid_runtime", "libravenwood_runtime", ], } android_ravenwood_libgroup { name: "ravenwood-utils", libs: [ "junit", "truth", "flag-junit", "ravenwood-framework", "ravenwood-junit", "mockito-ravenwood-prebuilt", "inline-mockito-ravenwood-prebuilt", ], }