Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ccc3a5f authored by Joe Onorato's avatar Joe Onorato Committed by Automerger Merge Worker
Browse files

Merge "Allow and merge multiple release configs with the same name" am:...

Merge "Allow and merge multiple release configs with the same name" am: ac57d98b am: caee07b9 am: 6f23f126

Original change: https://android-review.googlesource.com/c/platform/build/+/2622584



Change-Id: If75b68308bfe08717d616345c0c882e812ad7b99
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7f184021 6f23f126
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ def release_config(all_flags, all_values):
                partitions.setdefault(partition, []).append(flag["name"])

    # Validate values
    # TODO(joeo): Disallow duplicate values after we've split AOSP and vendor flags.
    values = {}
    for value in all_values:
        if value["name"] not in flag_names:
+18 −7
Original line number Diff line number Diff line
@@ -16,6 +16,22 @@
# -----------------------------------------------------------------
# Choose the flag files
# -----------------------------------------------------------------
# Release configs are defined in reflease_config_map files, which map
# the short name (e.g. -next) used in lunch to the starlark files
# defining the build flag values.
#
# (If you're thinking about aconfig flags, there is one build flag,
# RELEASE_DEVICE_CONFIG_VALUE_SETS, that sets which device_config_value_set
# module to use to set the aconfig flag values.)
#
# The short release config names *can* appear multiple times, to allow
# for AOSP and vendor specific flags under the same name, but the
# individual flag values must appear in exactly one config.  Vendor
# does not override AOSP, or anything like that.  This is because
# vendor code usually includes prebuilts, and having vendor compile
# with different flags from AOSP increases the likelihood of flag
# mismatch.

# Do this first, because we're going to unset TARGET_RELEASE before
# including anyone, so they don't start making conditionals based on it.
# This logic is in make because starlark doesn't understand optional
@@ -39,17 +55,12 @@ config_map_files := $(wildcard build/release/release_config_map.mk) \
# $1 config name
# $2 release config files
define declare-release-config
    $(eval # No duplicates)
    $(if $(filter $(_all_release_configs), $(strip $(1))), \
        $(error declare-release-config: config $(strip $(1)) declared in: $(_included) Previously declared here: $(_all_release_configs.$(strip $(1)).DECLARED_IN)) \
    )
    $(eval # Must have release config files)
    $(if $(strip $(2)),,  \
        $(error declare-release-config: config $(strip $(1)) must have release config files) \
    )
    $(eval _all_release_configs := $(sort $(_all_release_configs) $(strip $(1))))
    $(eval _all_release_configs.$(strip $(1)).DECLARED_IN := $(_included))
    $(eval _all_release_configs.$(strip $(1)).FILES := $(strip $(2)))
    $(eval _all_release_configs.$(strip $(1)).DECLARED_IN := $(_included) $(_all_release_configs.$(strip $(1)).DECLARED_IN))
    $(eval _all_release_configs.$(strip $(1)).FILES := $(_all_release_configs.$(strip $(1)).FILES) $(strip $(2)))
endef

# Include the config map files