Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | */ |
| 16 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 17 | syntax = "proto3"; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 18 | |
Adam Lesinski | b58c3ef | 2017-09-12 17:39:52 -0700 | [diff] [blame] | 19 | import "frameworks/base/tools/aapt2/Configuration.proto"; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 20 | import "frameworks/base/tools/aapt2/Resources.proto"; |
| 21 | |
| 22 | package aapt.pb.internal; |
| 23 | |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 24 | option java_package = "android.aapt.pb.internal"; |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 25 | |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 26 | // The top level message representing an external resource file (layout XML, PNG, etc). |
| 27 | // This is used to represent a compiled file before it is linked. Only useful to aapt2. |
| 28 | message CompiledFile { |
| 29 | message Symbol { |
| 30 | // The name of the symbol (in the form package:type/name). |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 31 | string resource_name = 1; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 32 | |
| 33 | // The position in the file at which this symbol is defined. For debug use. |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 34 | aapt.pb.SourcePosition source = 2; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | // The name of the resource (in the form package:type/name). |
Adam Lesinski | 5bd4423 | 2017-09-07 09:39:07 -0700 | [diff] [blame] | 38 | string resource_name = 1; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 39 | |
| 40 | // The configuration for which the resource is defined. |
Adam Lesinski | b58c3ef | 2017-09-12 17:39:52 -0700 | [diff] [blame] | 41 | aapt.pb.Configuration config = 2; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 42 | |
Adam Lesinski | e59f0d8 | 2017-10-13 09:36:53 -0700 | [diff] [blame] | 43 | // The type of the file. |
| 44 | aapt.pb.FileReference.Type type = 3; |
Adam Lesinski | 0045116 | 2017-10-03 07:44:08 -0700 | [diff] [blame] | 45 | |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 46 | // The filesystem path to where the source file originated. |
| 47 | // Mainly used to display helpful error messages. |
Adam Lesinski | 0045116 | 2017-10-03 07:44:08 -0700 | [diff] [blame] | 48 | string source_path = 4; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 49 | |
| 50 | // Any symbols this file auto-generates/exports (eg. @+id/foo in an XML file). |
Adam Lesinski | 0045116 | 2017-10-03 07:44:08 -0700 | [diff] [blame] | 51 | repeated Symbol exported_symbol = 5; |
Adam Lesinski | 4ffea04 | 2017-08-10 15:37:28 -0700 | [diff] [blame] | 52 | } |