// ART APEX module // // Contains both the Android Managed Runtime (ART) and the Android Core Library // (Libcore). package { // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "art_license" // to get the below license kinds: // SPDX-license-identifier-Apache-2.0 default_applicable_licenses: ["art_license"], } soong_config_module_type_import { from: "art/build/SoongConfig.bp", module_types: [ "art_module_apex_defaults", "art_module_cc_defaults", "art_module_genrule_defaults", ], } // Modules listed in LOCAL_REQUIRED_MODULES for module art-runtime in art/Android.mk. // - Base requirements (binaries for which both 32- and 64-bit versions are built, if possible). art_runtime_base_binaries_both = [ "dalvikvm", ] art_runtime_base_binaries_both_on_device_first_on_host = [ "dex2oat", ] // - Base requirements (binaries for which the "first" version is preferred on device // (likely 64-bit) and on host). art_runtime_base_binaries_first_on_device_first_on_host = [ "dexoptanalyzer", "odrefresh", "profman", ] // - Base requirements (libraries). // // Note: ART on-device chroot-based testing and benchmarking is not yet using // the ART APEX, meaning that copies of some of these libraries have to be // installed in `/system` for the ART Buildbot set-up to work properly. This is // done by the `standalone-apex-files` Make phony target, used by the ART // Buildbot and Golem (see `art/Android.mk`). If you add libraries to this list, // you may have to also add them to `PRIVATE_ART_APEX_DEPENDENCY_LIBS` in // `art/Android.mk`. // TODO(b/121117762): Remove this note when both the ART Buildbot and Golem use // the ART APEX. art_runtime_base_native_shared_libs = [ // External API (having APEX stubs). "libdexfile", "libnativebridge", "libnativehelper", "libnativeloader", "libsigchain", // libadbconnection is internal and loaded with dlopen(), but it cannot use // "required" because of cyclic dependency (b/124505714). "libadbconnection", // TODO(b/124476339): Clean up the following libraries once "required" // dependencies work with APEX libraries. "libart", "libart-compiler", "libdt_fd_forward", "libdt_socket", "libjdwp", "libnpt", "libopenjdkjvm", "libopenjdkjvmti", ] art_runtime_base_native_device_only_shared_libs = [ "libperfetto_hprof", ] bionic_native_shared_libs = [ // External API (having APEX stubs). "libc", "libm", "libdl", ] bionic_binaries_both = [ "linker", // To validate the zip file generated by cloud server. "ziptool", ] // - Debug variants (binaries for which the "first" version is preferred on device // (likely 64-bit) and on host). art_runtime_debug_binaries_first_on_device_first_on_host = [ "dexoptanalyzerd", "profmand", ] art_runtime_debug_binaries_both_on_device_first_on_host = [ "dex2oatd", ] // - Debug variants (libraries). art_runtime_debug_native_shared_libs = [ "libadbconnectiond", "libartd", "libartd-compiler", "libdexfiled", "libopenjdkjvmd", "libopenjdkjvmtid", ] art_runtime_base_native_device_only_debug_shared_libs = [ "libperfetto_hprofd", ] // Libraries needed to execute ART run-tests. // TODO(b/124476339): When bug 124476339 is fixed, add these libraries as `runtime_libs` // dependencies of `libartd-compiler`, and remove `art_runtime_run_test_libs`. art_runtime_run_test_libs = [ "libart-disassembler", "libartd-disassembler", ] // Tools common to both device APEX and host APEX. Derived from art-tools in art/Android.mk. art_tools_common_binaries = [ "dexdump", "dexlist", ] // Tools common to both device and host debug APEXes. art_tools_debug_binaries = [ "dexanalyze", "dexdiag", "dexlayout", "dexlayoutd", ] art_tools_debug_binaries_both = [ "imgdiag", "imgdiagd", ] // Tools exclusively for the device APEX derived from art-tools in art/Android.mk. art_tools_device_only_binaries = [ // oatdump cannot link with host linux_bionic due to not using clang lld; // TODO: Make it work with clang lld. "oatdump", ] // Same, but for only for debug packages. art_tools_debug_device_only_binaries = [ // oatdumpd cannot link with host linux_bionic due to not using clang lld; // TODO: Make it work with clang lld. "oatdumpd", ] // Tools exclusively for the host APEX derived from art-tools in art/Android.mk. art_tools_host_only_binaries = [ // FIXME: Does not work as-is, because `ahat` is defined in tools/ahat/Android.mk // (same issue as for `libart_fake` above). //"ahat", "hprof-conv", ] // Core Java libraries. libcore_java_libs = [ "core-oj", "core-libart", "okhttp", "bouncycastle", "apache-xml", ] // Native libraries that support the core Java libraries. // // Note: ART on-device chroot-based testing and benchmarking is not yet using // the ART APEX, meaning that copies of some of these libraries have to be // installed in `/system` for the ART Buildbot set-up to work properly. This is // done by the `standalone-apex-files` Make phony target, used by the ART // Buildbot and Golem (see `art/Android.mk`). If you add libraries to this list, // you may have to also add them to `PRIVATE_ART_APEX_DEPENDENCY_LIBS` in // `art/Android.mk`. // TODO(b/121117762): Remove this note when both the ART Buildbot and Golem use // the ART APEX. libcore_native_shared_libs = [ // External API (having APEX stubs). "libandroidio", // TODO(b/124476339): Clean up the following libraries once "required" // dependencies work with APEX libraries. "libexpat", "libjavacore", "libopenjdk", ] libcore_debug_native_shared_libs = [ "libopenjdkd", ] // Temporary library includes for b/123591866 as all libraries are moved into the main art-apex. art_runtime_libraries_zipapex = [ "libnativebridge", "libnativeloader", "libnativehelper", "libcutils", ] android_app_certificate { name: "com.android.art.certificate", certificate: "com.android.art", } apex_key { name: "com.android.art.key", public_key: "com.android.art.avbpubkey", private_key: "com.android.art.pem", } art_module_apex_defaults { name: "com.android.art-defaults", // Enable if SOONG_CONFIG_art_module_source_build is true. enabled: false, soong_config_variables: { source_build: { enabled: true, }, }, target: { windows: { // When the Soong config variable above sets enabled:true, it // overrides the default false for targets, so we need to disable // windows explicitly. enabled: false, }, }, } // Default values shared by device ART APEXes. apex_defaults { name: "com.android.art-device-defaults", defaults: ["com.android.art-defaults"], compile_multilib: "both", manifest: "manifest-art.json", bootclasspath_fragments: ["art-bootclasspath-fragment"], compat_configs: ["libcore-platform-compat-config"], java_libs: libcore_java_libs, native_shared_libs: art_runtime_base_native_shared_libs + art_runtime_base_native_device_only_shared_libs + libcore_native_shared_libs, multilib: { both: { binaries: art_runtime_base_binaries_both + art_runtime_base_binaries_both_on_device_first_on_host, }, first: { binaries: art_runtime_base_binaries_first_on_device_first_on_host + art_tools_common_binaries + art_tools_device_only_binaries, }, }, key: "com.android.art.key", required: [ "com.android.i18n", ], prebuilts: [ "art-linker-config", "current_sdkinfo", ], // ART APEXes depend on bouncycastle which is disabled for PDK builds. // Since the dependency is disabled, ART APEXes can't be built either. // Disable the APEXes too. See b/157267166. product_variables: { pdk: { enabled: false, }, }, min_sdk_version: "S", // Indicates that pre-installed version of this apex can be compressed. // Whether it actually will be compressed is controlled on per-device basis. compressible: true, } // Default values shared by (device) Debug and Testing ART APEXes. apex_defaults { name: "com.android.art-devel-defaults", defaults: ["com.android.art-device-defaults"], native_shared_libs: art_runtime_base_native_device_only_debug_shared_libs + art_runtime_run_test_libs + art_runtime_debug_native_shared_libs + libcore_debug_native_shared_libs, multilib: { both: { binaries: art_tools_debug_binaries_both + art_runtime_debug_binaries_both_on_device_first_on_host, }, first: { binaries: art_runtime_debug_binaries_first_on_device_first_on_host + art_tools_debug_binaries + art_tools_debug_device_only_binaries, }, }, } apex_test { name: "test_com.android.art", defaults: ["com.android.art-devel-defaults"], manifest: "test_apex_manifest.json", file_contexts: ":com.android.art.debug-file_contexts", certificate: ":com.android.art.certificate", installable: false, } // Release version of the ART APEX module (not containing debug // variants nor tools), included in user builds. Also used for // storage-constrained devices in userdebug and eng builds. art_apex { name: "com.android.art", defaults: ["com.android.art-device-defaults"], certificate: ":com.android.art.certificate", } // "Debug" version of the ART APEX module (containing both release and // debug variants, as well as additional tools), included in userdebug and // eng build. art_apex { name: "com.android.art.debug", defaults: ["com.android.art-devel-defaults"], certificate: ":com.android.art.certificate", } // ART gtests with dependencies on internal ART APEX libraries. art_gtests = [ "art_cmdline_tests", "art_compiler_tests", "art_dex2oat_tests", "art_dexanalyze_tests", "art_dexdiag_tests", "art_dexdump_tests", "art_dexlayout_tests", "art_dexlist_tests", "art_dexoptanalyzer_tests", "art_imgdiag_tests", "art_libartbase_tests", "art_libartpalette_tests", "art_libdexfile_tests", "art_libdexfile_support_tests", "art_libprofile_tests", "art_oatdump_tests", "art_odrefresh_tests", "art_profman_tests", "art_runtime_compiler_tests", "art_runtime_tests", "art_sigchain_tests", ] // "Testing" version of the ART APEX module (containing both release // and debug variants, additional tools, and ART gtests), for testing // purposes only. art_apex_test { name: "com.android.art.testing", defaults: ["com.android.art-devel-defaults"], file_contexts: ":com.android.art.debug-file_contexts", certificate: ":com.android.art.certificate", tests: art_gtests, binaries: ["signal_dumper"], // Need signal_dumper for run-tests. updatable: false, } // TODO: Do this better. art_apex_test_host will disable host builds when // HOST_PREFER_32_BIT is set. We cannot simply use com.android.art.debug // because binaries have different multilib classes and 'multilib: {}' isn't // supported by target: { ... }. // See b/120617876 for more information. art_apex_test_host { name: "com.android.art.host", defaults: ["com.android.art-defaults"], compile_multilib: "both", payload_type: "zip", host_supported: true, device_supported: false, manifest: "manifest-art.json", updatable: false, java_libs: libcore_java_libs, ignore_system_library_special_case: true, native_shared_libs: art_runtime_base_native_shared_libs + art_runtime_debug_native_shared_libs + libcore_native_shared_libs + libcore_debug_native_shared_libs + art_runtime_libraries_zipapex + art_runtime_run_test_libs, multilib: { both: { binaries: art_runtime_base_binaries_both + art_tools_debug_binaries_both, }, first: { binaries: art_runtime_base_binaries_both_on_device_first_on_host + art_runtime_base_binaries_first_on_device_first_on_host + art_runtime_debug_binaries_first_on_device_first_on_host + art_runtime_debug_binaries_both_on_device_first_on_host + art_tools_common_binaries + art_tools_debug_binaries + // Host APEX is always debug. art_tools_host_only_binaries, }, }, key: "com.android.art.key", target: { darwin: { enabled: false, }, linux_bionic: { multilib: { both: { native_shared_libs: bionic_native_shared_libs, binaries: bionic_binaries_both, }, }, }, }, // ART APEXes depend on bouncycastle which is disabled for PDK builds. // Since the dependency is disabled, ART APEXes can't be built either. // Disable the APEXes too. See b/157267166. product_variables: { pdk: { enabled: false, }, }, } python_binary_host { name: "art-apex-tester", srcs: ["art_apex_test.py"], main: "art_apex_test.py", } // Genrules so we can run the checker, and empty Java library so that it gets executed. art_check_apex_gen_stem = "$(location art-apex-tester)" + " --deapexer $(location deapexer)" + " --debugfs $(location debugfs_static)" + " --tmpdir $(genDir)" // The non-flattened APEXes are always checked, as they are always generated // (even when APEX flattening is enabled). art_module_genrule_defaults { name: "art-check-apex-gen-defaults", // Enable if SOONG_CONFIG_art_module_source_build is true. enabled: false, soong_config_variables: { source_build: { enabled: true, }, }, tools: [ "art-apex-tester", "deapexer", "debugfs_static", ], } art_module_cc_defaults { name: "art-check-apex-gen-fakebin-defaults", host_supported: true, device_supported: false, // Enable if SOONG_CONFIG_art_module_source_build is true. enabled: false, soong_config_variables: { source_build: { enabled: true, }, }, target: { darwin: { enabled: false, // No python3. }, }, } genrule { name: "art-check-release-apex-gen", defaults: ["art-check-apex-gen-defaults"], srcs: [":com.android.art"], cmd: art_check_apex_gen_stem + " --flavor release" + " $(in)" + " && touch $(out)" + " && chmod a+x $(out)", out: ["art-check-release-apex-gen.unused"], } cc_prebuilt_binary { name: "art-check-release-apex-gen-fakebin", defaults: ["art-check-apex-gen-fakebin-defaults"], srcs: [":art-check-release-apex-gen"], } genrule { name: "art-check-debug-apex-gen", defaults: ["art-check-apex-gen-defaults"], srcs: [":com.android.art.debug"], cmd: art_check_apex_gen_stem + " --flavor debug" + " $(in)" + " && touch $(out)" + " && chmod a+x $(out)", out: ["art-check-debug-apex-gen.unused"], } cc_prebuilt_binary { name: "art-check-debug-apex-gen-fakebin", defaults: ["art-check-apex-gen-fakebin-defaults"], srcs: [":art-check-debug-apex-gen"], } genrule { name: "art-check-testing-apex-gen", defaults: ["art-check-apex-gen-defaults"], srcs: [":com.android.art.testing"], cmd: art_check_apex_gen_stem + " --flavor testing" + " $(in)" + " && touch $(out)" + " && chmod a+x $(out)", out: ["art-check-testing-apex-gen.unused"], } cc_prebuilt_binary { name: "art-check-testing-apex-gen-fakebin", defaults: ["art-check-apex-gen-fakebin-defaults"], srcs: [":art-check-testing-apex-gen"], } linker_config { name: "art-linker-config", src: "linker.config.json", installable: false, }