/*
 * Copyright (C) 2022 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 = "proto3";

package aapt.pb;

option java_package = "com.android.aapt";
option java_multiple_files = true;

message ResourceMappings {
  ShortenedPathsMap shortened_paths = 1;
  CollapsedNamesMap collapsed_names = 2;
}

// Metadata relating to "aapt2 optimize --shorten-resource-paths"
message ShortenedPathsMap {
  // Maps shorted paths (e.g. "res/foo.xml") to their original names (e.g.
  // "res/xml/file_with_long_name.xml").
  message ResourcePathMapping {
    string shortened_path = 1;
    string original_path = 2;
  }
  repeated ResourcePathMapping resource_paths = 1;
}

// Metadata relating to "aapt2 optimize --collapse-resource-names"
message CollapsedNamesMap {
  // Maps resource IDs (e.g. 0x7f123456) to their original names (e.g.
  // "package:type/entry").
  message ResourceNameMapping {
    uint32 id = 1;
    string name = 2;
  }
  repeated ResourceNameMapping resource_names = 1;
}
