Merge "Strip values of soong_config_set calls" am: e5e5642ba5
Original change: https://android-review.googlesource.com/c/platform/build/+/2592246 Change-Id: I72bafd788fbffee43c6a09637ef8f73e20c63a42 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -271,7 +271,7 @@ SOONG_CONFIG_NAMESPACES :=
|
|||||||
# Ex: $(call add_soong_config_namespace,acme)
|
# Ex: $(call add_soong_config_namespace,acme)
|
||||||
|
|
||||||
define add_soong_config_namespace
|
define add_soong_config_namespace
|
||||||
$(eval SOONG_CONFIG_NAMESPACES += $1) \
|
$(eval SOONG_CONFIG_NAMESPACES += $(strip $1)) \
|
||||||
$(eval SOONG_CONFIG_$(strip $1) :=)
|
$(eval SOONG_CONFIG_$(strip $1) :=)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -281,8 +281,8 @@ endef
|
|||||||
# $1 is the namespace. $2 is the list of variables.
|
# $1 is the namespace. $2 is the list of variables.
|
||||||
# Ex: $(call add_soong_config_var,acme,COOL_FEATURE_A COOL_FEATURE_B)
|
# Ex: $(call add_soong_config_var,acme,COOL_FEATURE_A COOL_FEATURE_B)
|
||||||
define add_soong_config_var
|
define add_soong_config_var
|
||||||
$(eval SOONG_CONFIG_$(strip $1) += $2) \
|
$(eval SOONG_CONFIG_$(strip $1) += $(strip $2)) \
|
||||||
$(foreach v,$(strip $2),$(eval SOONG_CONFIG_$(strip $1)_$v := $($v)))
|
$(foreach v,$(strip $2),$(eval SOONG_CONFIG_$(strip $1)_$v := $(strip $($v))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# The add_soong_config_var_value function defines a make variable and also adds
|
# The add_soong_config_var_value function defines a make variable and also adds
|
||||||
@@ -291,7 +291,7 @@ endef
|
|||||||
# Ex: $(call add_soong_config_var_value,acme,COOL_FEATURE,true)
|
# Ex: $(call add_soong_config_var_value,acme,COOL_FEATURE,true)
|
||||||
|
|
||||||
define add_soong_config_var_value
|
define add_soong_config_var_value
|
||||||
$(eval $2 := $3) \
|
$(eval $(strip $2) := $(strip $3)) \
|
||||||
$(call add_soong_config_var,$1,$2)
|
$(call add_soong_config_var,$1,$2)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@@ -299,8 +299,8 @@ endef
|
|||||||
#
|
#
|
||||||
# internal utility to define a namespace and a variable in it.
|
# internal utility to define a namespace and a variable in it.
|
||||||
define soong_config_define_internal
|
define soong_config_define_internal
|
||||||
$(if $(filter $1,$(SOONG_CONFIG_NAMESPACES)),,$(eval SOONG_CONFIG_NAMESPACES:=$(SOONG_CONFIG_NAMESPACES) $1)) \
|
$(if $(filter $1,$(SOONG_CONFIG_NAMESPACES)),,$(eval SOONG_CONFIG_NAMESPACES:=$(SOONG_CONFIG_NAMESPACES) $(strip $1))) \
|
||||||
$(if $(filter $2,$(SOONG_CONFIG_$(strip $1))),,$(eval SOONG_CONFIG_$(strip $1):=$(SOONG_CONFIG_$(strip $1)) $2))
|
$(if $(filter $2,$(SOONG_CONFIG_$(strip $1))),,$(eval SOONG_CONFIG_$(strip $1):=$(SOONG_CONFIG_$(strip $1)) $(strip $2)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# soong_config_set defines the variable in the given Soong config namespace
|
# soong_config_set defines the variable in the given Soong config namespace
|
||||||
@@ -309,7 +309,7 @@ endef
|
|||||||
# Ex: $(call soong_config_set,acme,COOL_FEATURE,true)
|
# Ex: $(call soong_config_set,acme,COOL_FEATURE,true)
|
||||||
define soong_config_set
|
define soong_config_set
|
||||||
$(call soong_config_define_internal,$1,$2) \
|
$(call soong_config_define_internal,$1,$2) \
|
||||||
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$3)
|
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(strip $3))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# soong_config_append appends to the value of the variable in the given Soong
|
# soong_config_append appends to the value of the variable in the given Soong
|
||||||
@@ -318,7 +318,7 @@ endef
|
|||||||
# $1 is the namespace, $2 is the variable name, $3 is the value
|
# $1 is the namespace, $2 is the variable name, $3 is the value
|
||||||
define soong_config_append
|
define soong_config_append
|
||||||
$(call soong_config_define_internal,$1,$2) \
|
$(call soong_config_define_internal,$1,$2) \
|
||||||
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(SOONG_CONFIG_$(strip $1)_$(strip $2)) $3)
|
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(SOONG_CONFIG_$(strip $1)_$(strip $2)) $(strip $3))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# soong_config_append gets to the value of the variable in the given Soong
|
# soong_config_append gets to the value of the variable in the given Soong
|
||||||
|
@@ -379,11 +379,7 @@ def _soong_config_namespace(g, nsname):
|
|||||||
def _soong_config_set(g, nsname, var, value):
|
def _soong_config_set(g, nsname, var, value):
|
||||||
"""Assigns the value to the variable in the namespace."""
|
"""Assigns the value to the variable in the namespace."""
|
||||||
_soong_config_namespace(g, nsname)
|
_soong_config_namespace(g, nsname)
|
||||||
if type(value) == "string":
|
g[_soong_config_namespaces_key][nsname][var]=_mkstrip(value)
|
||||||
# Trim right spaces, because in make the variable is set in an $(eval),
|
|
||||||
# which will ignore trailing spaces.
|
|
||||||
value = value.rstrip(" ")
|
|
||||||
g[_soong_config_namespaces_key][nsname][var]=value
|
|
||||||
|
|
||||||
def _soong_config_append(g, nsname, var, value):
|
def _soong_config_append(g, nsname, var, value):
|
||||||
"""Appends to the value of the variable in the namespace."""
|
"""Appends to the value of the variable in the namespace."""
|
||||||
@@ -391,9 +387,9 @@ def _soong_config_append(g, nsname, var, value):
|
|||||||
ns = g[_soong_config_namespaces_key][nsname]
|
ns = g[_soong_config_namespaces_key][nsname]
|
||||||
oldv = ns.get(var)
|
oldv = ns.get(var)
|
||||||
if oldv == None:
|
if oldv == None:
|
||||||
ns[var] = value
|
ns[var] = _mkstrip(value)
|
||||||
else:
|
else:
|
||||||
ns[var] += " " + value
|
ns[var] += " " + _mkstrip(value)
|
||||||
|
|
||||||
|
|
||||||
def _soong_config_get(g, nsname, var):
|
def _soong_config_get(g, nsname, var):
|
||||||
|
Reference in New Issue
Block a user