Merge "Add RELEASE_BUILD_FLAGS_IN_PROTOBUF" into main
diff --git a/build_config/protobuf_flags.scl b/build_config/protobuf_flags.scl
new file mode 100644
index 0000000..9c0c796
--- /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 0000000..e69de29
--- /dev/null
+++ b/build_config/protobuf_flags=proto
diff --git a/build_flags.scl b/build_flags.scl
index 230aad2..44fc4f2 100644
--- a/build_flags.scl
+++ b/build_flags.scl
@@ -93,6 +93,11 @@
     # Set to True to freeze the board API level with vendor FRC
     flag("RELEASE_BOARD_API_LEVEL_FROZEN", ALL, False),
 
+    # 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),
 
diff --git a/release_config_map.mk b/release_config_map.mk
index eb7c91d..4185fe3 100644
--- a/release_config_map.mk
+++ b/release_config_map.mk
@@ -25,4 +25,7 @@
 $(call declare-release-config, trunk_food, $(local_dir)build_config/trunk_food.scl, trunk)
 $(call declare-release-config, trunk_staging, $(local_dir)build_config/trunk_staging.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 :=