summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author LaMont Jones <lamontjones@google.com> 2024-05-01 09:24:47 -0700
committer LaMont Jones <lamontjones@google.com> 2024-05-01 15:03:45 -0700
commitec1553ee5a663cb75bc209b4414cbe45d97d988d (patch)
tree1029e4ebf84d41d0a7632d7da0f7af73ea6fe9ea
parentf1596094cc657ddb7fe61fe312079ed3f25a7805 (diff)
Add RELEASE_BUILD_FLAGS_IN_PROTOBUF
This will guard the conversion to using protobufs for build flags. To ease testing for those working on the migration, add a temporary release config "protobuf_flags" which is === "trunk_staging", with RELEASE_BUILD_FLAGS_IN_PROTOBUF=true. Bug: 328495189 Test: manual Ignore-AOSP-First: cherry-pick due to merge conflict Change-Id: I7d40e5bb923cf84609e2f3a3cbd47c5a5d03a983
-rw-r--r--build_config/protobuf_flags.scl39
-rw-r--r--build_config/protobuf_flags=proto0
-rw-r--r--build_flags.scl5
-rw-r--r--release_config_map.mk3
4 files changed, 47 insertions, 0 deletions
diff --git a/build_config/protobuf_flags.scl b/build_config/protobuf_flags.scl
new file mode 100644
index 00000000..9c0c7967
--- /dev/null
+++ b/build_config/protobuf_flags.scl
@@ -0,0 +1,39 @@
+"""
+Build flag values for release config protobuf_flags.
+"""
+# Copyright (C) 2023 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Build system flag configuration for `lunch <product>-protobuf_flags-<variant>` builds
+# ^^^^^^^^^^^^^^
+# See go/build-system-flags
+#
+
+load("//build/make/core/release_config.scl", "value")
+
+################################################################################
+#
+# DO NOT EDIT THIS FILE
+#
+# Flag values should be changed in `trunk_staging.scl`, not here. This file should
+# only be used where protobuf_flags differs from trunk_staging:
+# RELEASE_BUILD_FLAGS_IN_PROTOBUF is the only difference at this time.
+################################################################################
+values = [
+ # keep-sorted start numeric=yes
+ value("RELEASE_BUILD_FLAGS_IN_PROTOBUF", True),
+ # keep-sorted end
+]
+# Flags should be alphabetical by flag name to reduce merge conflifcts
diff --git a/build_config/protobuf_flags=proto b/build_config/protobuf_flags=proto
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/build_config/protobuf_flags=proto
diff --git a/build_flags.scl b/build_flags.scl
index 29aa5f77..74fdc9d0 100644
--- a/build_flags.scl
+++ b/build_flags.scl
@@ -129,6 +129,11 @@ flags = [
# Set to True to freeze the board API level with vendor FRC
flag("RELEASE_BOARD_API_LEVEL_FROZEN", ALL, False, origin="aosp"),
+ # Enable protobuf version of build flag processing.
+ # When true, the canonical source of truth for build flags is in the
+ # protobuf version of the data.
+ flag("RELEASE_BUILD_FLAGS_IN_PROTOBUF", ALL, False, origin="aosp"),
+
# If true, then crashrecovery module is enabled as an apex
flag("RELEASE_CRASHRECOVERY_MODULE", ALL, False, origin="aosp"),
diff --git a/release_config_map.mk b/release_config_map.mk
index 72871a38..16d27760 100644
--- a/release_config_map.mk
+++ b/release_config_map.mk
@@ -28,4 +28,7 @@ $(call declare-release-config, trunk_staging, $(local_dir)build_config/trunk_sta
# 24Q2, aka AP2A
$(call declare-release-config, ap2a, $(local_dir)build_config/ap2a.scl)
+# Temporary config to ease testing build flag migration to protobuf
+$(call declare-release-config, protobuf_flags, $(local_dir)build_config/protobuf_flags.scl, trunk_staging)
+
local_dir :=