1// Copyright 2021 Google Inc. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//   http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
17package build_license_metadata;
18option go_package = "android/soong/compliance/license_metadata_proto";
19
20message LicenseMetadata {
21  // package_name identifies the source package. License texts are named relative to the package name.
22  optional string package_name = 1;
23
24  // module_name identifies the target
25  optional string module_name = 14;
26
27  repeated string module_types = 2;
28
29  repeated string module_classes = 3;
30
31  // projects identifies the git project(s) containing the associated source code.
32  repeated string projects = 4;
33
34  // license_kinds lists the kinds of licenses. e.g. SPDX-license-identifier-Apache-2.0 or legacy_notice.
35  repeated string license_kinds = 5;
36
37  // license_conditions lists the conditions that apply to the license kinds. e.g. notice or restricted.
38  repeated string license_conditions = 6;
39
40  // license_texts lists the filenames of the associated license text(s).
41  repeated string license_texts = 7;
42
43  // is_container is true for target types that merely aggregate. e.g. .img or .zip files.
44  optional bool is_container = 8;
45
46  // built lists the built targets.
47  repeated string built = 9;
48
49  // installed lists the installed targets.
50  repeated string installed = 10;
51
52  // installMap identifies the substitutions to make to path names when moving into installed location.
53  repeated InstallMap install_map = 11;
54
55  // sources lists the targets depended on.
56  repeated string sources = 12;
57
58  // deps lists the license metadata files depended on.
59  repeated AnnotatedDependency deps = 13;
60
61  // next id: 15
62
63}
64
65// InstallMap messages describe the mapping from an input filesystem file to the path to the file
66// in a container.
67message InstallMap {
68  // The input path on the filesystem.
69  optional string from_path = 1;
70
71  // The path to the file inside the container or installed location.
72  optional string container_path = 2;
73}
74
75// AnnotateDepencency messages describe edges in the build graph.
76message AnnotatedDependency {
77  // The path to the dependency license metadata file.
78  optional string file = 1;
79
80  // The annotations attached to the dependency.
81  repeated string annotations = 2;
82}
83