commit | 8264c7e99644a8b87a9b542775eca45c2d485c34 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Thu Mar 19 04:38:35 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Mar 19 04:38:35 2020 +0000 |
tree | 3076d4e24dc4fab98944722cb0faf5115519391c | |
parent | 30cb617e544121cf4e34bf3b22f5450435f187ce [diff] | |
parent | 3b9b5c85e561c22b00ffbf136be7eb64a5e6be67 [diff] |
[automerger skipped] DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp@6304901 into stag-aosp-master am: e1d9857551 -s ours am: 3b9b5c85e5 Change-Id: I1d5b67fdb18a030d413acbe8d4526ce8170be45f
The ConfigFile as API is a formal Treble interface describing schemas of configuration files used across system and vendor partitions. The Java APIs in the current.txt file are not Java APIs for apps. It's a proxy for the schema of a xml file used between the system and vendor partition. The xml files are only ever parsed by apps on the system partition.
Add the schema (attribute, element or new complexType …) you want to add to the xsd file.
<xs:element name="class"> <xs:complexType> <xs:sequence> <xs:element name="student" type="xs:string"/> </xs:sequence> <xs:attribute name="name" type=”xs:string”/> </xs:complexType> </xs:element>
<xs:element name="class"> <xs:complexType> <xs:sequence> <xs:element name="student" type="xs:string"/> </xs:sequence> <xs:attribute name="name" type=”xs:string”/> <xs:attribute name="number" type="xs:int"/> </xs:complexType> </xs:element>
Then run "make {xsd_config module_name} .docs-update-current-api" or "make update-api" to update all the xsd_config modules.
In the above example, two functions are added as below.
To remove a tag, add an annotation tag with the name of "Deprecated" into the tag to be deleted. Partners are not allowed to create new vendor images using deprecated tags
<xs:element name="class"> <xs:complexType> <xs:sequence> <xs:element name="student" type="xs:string"/> </xs:sequence> <xs:attribute name="name" type=”xs:string”/> </xs:complexType> </xs:element>
<xs:element name="class"> <xs:complexType> <xs:sequence> <xs:element name="student" type="xs:string"> <annotation name=”Deprecated”/> </xs:element> </xs:sequence> <xs:attribute name="name" type=”xs:string”/> </xs:complexType> </xs:element>
After adding “Deprecated” annotation, we need to update the api or schema just like when adding a tag. In the above example, a @Deprecate annotation is added.
If there are any changes, we update last_current.txt and last_removed.txt before release by copying current.txt and removed.txt to last_current.txt and last_removed.txt.
Only the follow tags and attributes are allowed:
"xsd:schema" [
]
"xsd:element" [
"xsd:name" {
values: any valid java name
}
"xsd:type" {
values: built-in data type, simpleType or complexType
},
"xsd:ref" {
values: another element
},
"xsd:minOccurs" {
values: [ 0, maxOccurs ]
},
"xsd:maxOccurs" {
values: [ 1, unbounded ]
},
]
"xsd:attribute" [
"xsd:name" {
values: any valid java name
}
"xsd:type" {
values: built-in data type, simpleType or complexType
},
"xsd:ref" {
values: another element
},
]
"xsd:complexType" [
"xsd:name" {
values: any valid java name
}
]
"xsd:complexContent" [
]
"xsd:simpleContent" [
]
"xsd:restriction": [
"xsd:base" {
values: built-in data type
}
]
"xsd:extension": [
"xsd:base" {
values: built-in data type, simpleType or complexType
}
]
"xsd:simpleType": [
"xsd:name" {
values: any valid java name
}
]
"xsd:list": [
"xsd:itemType" {
values: built-in data type, or simpleType
}
]
"xsd:union": [
"xsd:memberTypes" {
values: built-in data type, or simpleType
}
]
"xsd:sequence": [
]
"xsd:choice": [
]
"xsd:all": [
]
"xsd:enumeration": [
"xsd:value" {
values: built-in data type
}
]