Use ART_MODULE_BUILD_FROM_SOURCE instead soong config variable
When product configuration is converted to Starlark, soong config
variables will be stored in a dictionary and won't be able to be
specified directly on the command line. Use a regular variable
that controls the soong config variable.
Bug: 220940864
Test: Presubmits
Change-Id: I5622d9e626e2cf84afe67cd2a214530e64cefc3e
diff --git a/Android.mk b/Android.mk
index 47d0a2b..dc5b0c8 100644
--- a/Android.mk
+++ b/Android.mk
@@ -100,7 +100,7 @@
########################################################################
# Everything below is only available in ART source builds
-# (SOONG_CONFIG_art_module_source_build=true).
+# (ART_MODULE_BUILD_FROM_SOURCE=true).
########################################################################
# TODO(b/172480617): Clean up the platform dependencies on everything above and
@@ -394,10 +394,10 @@
# Reference the libraries and binaries in the appropriate APEX module, because
# they don't have platform variants. However if
-# SOONG_CONFIG_art_module_source_build isn't true then the APEX modules are
-# disabled, so Soong won't apply the APEX mutators to them, and then they are
-# available with their plain names.
-ifeq (true,$(SOONG_CONFIG_art_module_source_build))
+# ART_MODULE_BUILD_FROM_SOURCE isn't true then the APEX
+# modules are disabled, so Soong won't apply the APEX mutators to them, and
+# then they are available with their plain names.
+ifeq (true,$(ART_MODULE_BUILD_FROM_SOURCE))
art_module_lib = $(1).com.android.art
art_module_debug_lib = $(1).com.android.art.debug
else
diff --git a/build/Android.common_path.mk b/build/Android.common_path.mk
index 962f691..6ab002a 100644
--- a/build/Android.common_path.mk
+++ b/build/Android.common_path.mk
@@ -22,12 +22,12 @@
# relate to them, because `m checkbuild` complains on rules with nonexisting
# dependencies, even if they won't get called.
# TODO(b/172480617): Remove this when ART sources are no longer in platform manifests.
-ifeq (true,$(SOONG_CONFIG_art_module_source_build))
+ifeq (true,$(ART_MODULE_BUILD_FROM_SOURCE))
my_art_module_source_build := true
-else ifeq (false,$(SOONG_CONFIG_art_module_source_build))
+else ifeq (false,$(ART_MODULE_BUILD_FROM_SOURCE))
my_art_module_source_build := false
else
- $(error SOONG_CONFIG_art_module_source_build is neither true nor false - mk file ordering problem?)
+ $(error ART_MODULE_BUILD_FROM_SOURCE is neither true nor false - mk file ordering problem?)
endif
ifeq (true,$(my_art_module_source_build))
diff --git a/build/README.md b/build/README.md
index 807d6d5..22726ee 100644
--- a/build/README.md
+++ b/build/README.md
@@ -82,7 +82,7 @@
2. Ensure the ART Module is built from source:
```
- export SOONG_CONFIG_art_module_source_build=true
+ export ART_MODULE_BUILD_FROM_SOURCE=true
```
If this isn't set then the build may use prebuilts of the ART Module that
diff --git a/build/SoongConfig.bp b/build/SoongConfig.bp
index 657f136..a37721d 100644
--- a/build/SoongConfig.bp
+++ b/build/SoongConfig.bp
@@ -2,8 +2,9 @@
// https://android.googlesource.com/platform/build/soong/+/master/README.md#soong-config-variables
// The source_build variable in the art_module namespace is used to enable the
-// apex, sdk, and module_exports modules that make up the ART Module by setting
-// SOONG_CONFIG_art_module_source_build in make.
+// apex, sdk, and module_exports modules that make up the ART Module by calling
+// $(call soong_config_set,art_module,source_build,true) in make. (which is
+// set to the value of the ART_MODULE_BUILD_FROM_SOURCE variable)
// TODO(b/172480617): Clean up when ART source is no longer in the platform
// manifest.
soong_config_bool_variable {
diff --git a/build/apex/Android.bp b/build/apex/Android.bp
index 880397a..8d3b7ac 100644
--- a/build/apex/Android.bp
+++ b/build/apex/Android.bp
@@ -233,7 +233,7 @@
art_module_apex_defaults {
name: "com.android.art-defaults",
- // Enable if SOONG_CONFIG_art_module_source_build is true.
+ // Enable if ART_MODULE_BUILD_FROM_SOURCE is true
enabled: false,
soong_config_variables: {
source_build: {
@@ -519,7 +519,7 @@
host_supported: true,
device_supported: false,
- // Enable if SOONG_CONFIG_art_module_source_build is true.
+ // Enable if ART_MODULE_BUILD_FROM_SOURCE is true
enabled: false,
soong_config_variables: {
source_build: {
diff --git a/build/sdk/Android.bp b/build/sdk/Android.bp
index a4171b3..a9ee675 100644
--- a/build/sdk/Android.bp
+++ b/build/sdk/Android.bp
@@ -43,7 +43,7 @@
name: "art-module-sdk",
host_supported: true,
- // Enable if SOONG_CONFIG_art_module_source_build is true.
+ // Enable if ART_MODULE_BUILD_FROM_SOURCE is true
enabled: false,
soong_config_variables: {
source_build: {
@@ -157,7 +157,7 @@
name: "art-module-host-exports",
host_supported: true,
- // Enable if SOONG_CONFIG_art_module_source_build is true.
+ // Enable if ART_MODULE_BUILD_FROM_SOURCE is true
enabled: false,
soong_config_variables: {
source_build: {
@@ -216,7 +216,7 @@
art_module_exports {
name: "art-module-test-exports",
- // Enable if SOONG_CONFIG_art_module_source_build is true.
+ // Enable if ART_MODULE_BUILD_FROM_SOURCE is true
enabled: false,
soong_config_variables: {
source_build: {