xref: /aosp_15_r20/build/soong/cmd/release_config/release_config_proto/build_flags_out.proto (revision 333d2b3687b3a337dbcca9d65000bca186795e39)
1//
2// Copyright (C) 2024 The Android Open-Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//   http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16syntax = "proto2";
17package android.release_config_proto;
18option go_package = "android/soong/release_config/release_config_proto";
19
20import "build_flags_src.proto";
21
22// This protobuf file defines messages used to represent the release config for
23// the android build system, delivered as a build artifact for use by tools such
24// as Gantry.
25//
26// The following format requirements apply across various message fields:
27//
28// # name: name of the flag
29//
30//    format: an uppercase string in SNAKE_CASE format starting with RELEASE_,
31//      no consecutive underscores, and no leading digit. For example
32//      RELEASE_MY_PACKAGE_FLAG is a valid name, while MY_PACKAGE_FLAG, and
33//      RELEASE_MY_PACKAGE__FLAG are invalid.
34//
35// # package: package to which the flag belongs
36//
37//    format: lowercase strings in snake_case format, delimited by dots, no
38//      consecutive underscores and no leading digit in each string. For example
39//      com.android.mypackage is a valid name while com.android.myPackage,
40//      com.android.1mypackage are invalid
41
42message Tracepoint {
43  // Path to declaration or value file relative to $TOP
44  optional string source = 1;
45  optional Value value = 201;
46}
47
48message FlagArtifact {
49  // The original declaration
50  optional FlagDeclaration flag_declaration = 1;
51
52  // Value for the flag
53  optional Value value = 201;
54
55  // Trace of where the flag value was assigned.
56  repeated Tracepoint traces = 8;
57}
58
59message FlagArtifacts {
60  // The artifacts
61  repeated FlagArtifact flags = 1;
62  reserved "flag_artifacts";
63}
64
65message ReleaseConfigArtifact {
66  // The name of the release config.
67  // See # name for format detail
68  optional string name = 1;
69
70  // Other names by which this release is known (for example, `next`)
71  repeated string other_names = 2;
72
73  // The complete set of build flags in this release config, after all
74  // inheritance and other processing is complete.
75  repeated FlagArtifact flags = 3;
76  reserved "flag_artifacts";
77
78  // The (complete) list of aconfig_value_sets Soong modules to use.
79  repeated string aconfig_value_sets = 4;
80
81  // The names of the release_config_artifacts from which we inherited.
82  // Included for reference only.
83  repeated string inherits = 5;
84
85  // The release config directories used for this config.  This includes
86  // directories that provide flag declarations, but do not provide any flag
87  // values specific to this release config.
88  // For example, "build/release".
89  repeated string directories = 6;
90
91  // Prior stage(s) for flag advancement (during development).
92  // Once a flag has met criteria in a prior stage, it can advance to this one.
93  repeated string prior_stages = 7;
94
95  // The release config directories that contribute directly to this release
96  // config.  The listed directories contain at least a `release_config` message
97  // for this release config.
98  repeated string value_directories = 8;
99
100  // The ReleaseConfigType of this release config.
101  optional ReleaseConfigType release_config_type = 9;
102}
103
104message ReleaseConfigsArtifact {
105  // The active release config for this build.
106  optional ReleaseConfigArtifact release_config = 1;
107
108  // All other release configs defined for this TARGET_PRODUCT.
109  repeated ReleaseConfigArtifact other_release_configs = 2;
110
111  // Map of release_config_artifact.directories to release_config_map message.
112  map<string, ReleaseConfigMap> release_config_maps_map = 3;
113}
114
115