summaryrefslogtreecommitdiff
path: root/bundle2installable/src/proto/Format.proto
blob: 8b0f81da55d7a678687ddd7119b0b8b922cdd347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/*
 * Copyright (C) 2016 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";

// option optimize_for = LITE_RUNTIME;

package aapt.pb;

option java_package = "com.android.tools.aapt2";
option java_outer_classname = "FormatProto";

message ConfigDescription {
	optional bytes data = 1;
	optional string product = 2;
}

message StringPool {
	optional bytes data = 1;
}

message CompiledFile {
	message Symbol {
		optional string resource_name = 1;
		optional uint32 line_no = 2;
	}

	optional string resource_name = 1;
	optional ConfigDescription config = 2;
	optional string source_path = 3;
	repeated Symbol exported_symbols = 4;
}

message ResourceTable {
	optional StringPool string_pool = 1;
	optional StringPool source_pool = 2;
	optional StringPool symbol_pool = 3;
	repeated Package packages = 4;
}

message Package {
	optional uint32 package_id = 1;
	optional string package_name = 2;
	repeated Type types = 3;
}

message Type {	
	optional uint32 id = 1;
	optional string name = 2;
	repeated Entry entries = 3;
}

message SymbolStatus {
	enum Visibility {
		Unknown = 0;
		Private = 1;
		Public = 2;
	}
	optional Visibility visibility = 1;
	optional Source source = 2;
	optional string comment = 3;
	optional bool allow_new = 4;
}

message Entry {
	optional uint32 id = 1;
	optional string name = 2;
	optional SymbolStatus symbol_status = 3;
	repeated ConfigValue config_values = 4;
}

message ConfigValue {
	optional ConfigDescription config = 1;
	optional Value value = 2;
}

message Source {
	optional uint32 path_idx = 1;
	optional uint32 line_no = 2;
	optional uint32 col_no = 3;
}

message Reference {
	enum Type {
		Ref = 0;
		Attr = 1;
	}
	optional Type type = 1;
	optional uint32 id = 2;
	optional uint32 symbol_idx = 3;
	optional bool private = 4;
}

message Id {
}

message XString {
	optional uint32 idx = 1;
}

message RawString {
	optional uint32 idx = 1;
}

message FileReference {
	optional uint32 path_idx = 1;
}

message Primitive {
	optional uint32 type = 1;
	optional uint32 data = 2;
}

message Attribute {
	message Symbol {
		optional Source source = 1;
		optional string comment = 2;
		optional Reference name = 3;
		optional uint32 value = 4;
	}
	optional uint32 format_flags = 1;
	optional int32 min_int = 2;
	optional int32 max_int = 3;
	repeated Symbol symbols = 4;
}

message Style {
	message Entry {
		optional Source source = 1;
		optional string comment = 2;
		optional Reference key = 3;
		optional Item item = 4;
	}

	optional Reference parent = 1;
	optional Source parent_source = 2;
	repeated Entry entries = 3;
}

message Styleable {
	message Entry {
		optional Source source = 1;
		optional string comment = 2;
		optional Reference attr = 3;
	}
	repeated Entry entries = 1;
}

message Array {
	message Entry {
		optional Source source = 1;
		optional string comment = 2;
		optional Item item = 3;
	}
	repeated Entry entries = 1;
}

message Plural {
	enum Arity {
		Zero = 0;
		One = 1;
		Two = 2;
		Few = 3;
		Many = 4;
		Other = 5;
	}
		
	message Entry {
		optional Source source = 1;
		optional string comment = 2;
		optional Arity arity = 3;
		optional Item item = 4;
	}
	repeated Entry entries = 1;
}

message Item {
	optional Reference ref = 1;
	optional XString str = 2;
	optional RawString raw_str = 3;
	optional FileReference file = 4;
	optional Id id = 5;
	optional Primitive prim = 6;
}

message CompoundValue {
	optional Attribute attr = 1;
	optional Style style = 2;
	optional Styleable styleable = 3;
	optional Array array = 4;
	optional Plural plural = 5;
}

message Value {
	optional Source source = 1;
	optional string comment = 2;
	optional bool weak = 3;
	
	optional Item item = 4;
	optional CompoundValue compound_value = 5;	
}