//
// Copyright (C) 2025 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.

syntax = "proto2";
package android.release_config_proto;
option go_package = "android/soong/release_config/release_config_proto";

message ReleaseConfigContributionsArtifact {
  // The name of the release config.
  optional string name = 1;

  // The release config contribution directories that may contribute to this
  // release config.
  repeated string contributing_directories = 2;
}

message ReleaseConfigContributionsArtifacts {
  // The artifacts
  repeated ReleaseConfigContributionsArtifact release_config_contributions_artifact_list = 1;
}

message ProductReleaseConfig {
  // The TARGET_PRODUCTs for which this is valid.
  repeated string products = 1;

  // The value of PRODUCT_RELEASE_CONFIG_MAPS.
  optional string ps_maps_value = 2;

  // Map from TARGET_BUILD_VARIANT to file with the ReleaseConfigsArtifact.
  // Key is TARGET_BUILD_VARIANT (one of "user". "userdebug", or "eng").
  map <string,string> release_configs_artifact_path_map = 3;

  // The path of the inheritance graph.
  optional string inheritance_graph_path = 4;

}

message ProductReleaseConfigsInfo {
  // Map of TARGET_PRODUCT to tag for artifact_map.
  map <string,string> product_to_tag_map = 1;

  // Map of PRODUCT_RELEASE_CONFIG_MAPS to tag for artifact map.
  map <string,string> ps_maps_to_tag_map = 2;

  // Release configs for each group of products.
  // All of the products in each group have the same value for
  // PRODUCT_RELEASE_CONFIG_MAPS.
  map <string, ProductReleaseConfig> tag_to_artifact_map = 3;
}
