summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nelson Li <nelsonli@google.com> 2024-07-19 15:46:17 +0800
committer Nelson Li <nelsonli@google.com> 2024-07-26 12:53:45 +0800
commitc7031c2acf7ecaa2054ee1cf78d3d23bf7c6a461 (patch)
tree442ca3afae8f2057014e435cd970c05cdf769832
parente1dcb8a8e087eba56d7ba40b8290d83ced8ece66 (diff)
Convert `art-tools` to Android.bp
Use the `select` syntax to conditionally include the necessary modules in the `art-tools` dependencies based on the value of `HOST_PREFER_32_BIT`. Additionally, the check `ifneq ($(HOST_OS),darwin)` in this Android.mk can be ignored because Android no longer supports building on macOS after June 22, 2021 (Android 11). Bug: 346702835 Test: m -j art-tools Change-Id: Ic202c08a9198bfc302c43658127b97572d246a93
-rw-r--r--Android.bp24
-rw-r--r--Android.mk30
2 files changed, 24 insertions, 30 deletions
diff --git a/Android.bp b/Android.bp
index 83d72d1bcc..8b26e9454c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -16,3 +16,27 @@ license {
"NOTICE",
],
}
+
+// The art-tools package depends on helpers and tools that are useful for
+// developers. Similar dependencies exist for the APEX builds for these tools
+// (see build/apex/Android.bp).
+phony {
+ name: "art-tools",
+ // If the dependencies have changed, please sync them to
+ // build/core/target/product/base_system.mk as well.
+ required: [
+ "ahat",
+ "dexdump",
+ "hprof-conv",
+ // A subset of the tools are disabled when HOST_PREFER_32_BIT is
+ // defined as make reports that they are not supported on host
+ // (b/129323791). This is likely due to art_apex disabling host APEX
+ // builds when HOST_PREFER_32_BIT is set (b/120617876).
+ ] + select(soong_config_variable("art_module", "host_prefer_32_bit"), {
+ true: [],
+ default: [
+ "dexlist",
+ "oatdump",
+ ],
+ }),
+}
diff --git a/Android.mk b/Android.mk
index 6ab2fb5cbe..9842851f6b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -26,36 +26,6 @@ include $(art_path)/build/Android.common_path.mk
include $(art_path)/build/Android.cpplint.mk
########################################################################
-# The art-tools package depends on helpers and tools that are useful for developers. Similar
-# dependencies exist for the APEX builds for these tools (see build/apex/Android.bp).
-
-ifneq ($(HOST_OS),darwin)
-include $(CLEAR_VARS)
-LOCAL_MODULE := art-tools
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
-LOCAL_IS_HOST_MODULE := true
-
-LOCAL_REQUIRED_MODULES := \
- ahat \
- dexdump \
- hprof-conv \
-
-# A subset of the tools are disabled when HOST_PREFER_32_BIT is defined as make reports that
-# they are not supported on host (b/129323791). This is likely due to art_apex disabling host
-# APEX builds when HOST_PREFER_32_BIT is set (b/120617876).
-ifneq ($(HOST_PREFER_32_BIT),true)
-LOCAL_REQUIRED_MODULES += \
- dexlist \
- oatdump \
-
-endif
-
-include $(BUILD_PHONY_PACKAGE)
-endif # HOST_OS != darwin
-
-########################################################################
# product rules
include $(art_path)/tools/ahat/Android.mk