blob: 0859ba1c50a0d3e680092ab7fe7b92a0762cf585 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
Targets schema for the Brillo Developer Kit.
-->
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start combine="choice">
<ref name="Targets"/>
</start>
<define name="TargetName">
<data type="token">
<param name="pattern">[_\w]+</param>
<param name="maxLength">128</param>
</data>
</define>
<define name="OsName">
<choice>
<value type="token">brillo</value>
</choice>
</define>
<define name="Version">
<!-- git commit or number.number.number -->
<choice>
<data type="token">
<param name="pattern">[0-9][0-9]*.[0-9][0-9]*.[0-9][0-9]*</param>
<param name="maxLength">12</param>
</data>
<data type="hexBinary">
<param name="minLength">3</param>
<param name="maxLength">20</param>
</data>
</choice>
</define>
<define name="BoardName">
<data type="token">
<param name="pattern">([_\w]+)*</param>
<param name="maxLength">128</param>
</data>
</define>
<!-- When updating TargetPackName, also update packs.rng:PackName. -->
<define name="TargetPackName">
<data type="token">
<param name="pattern">([_\w]+\.)*([_\w]+)</param>
<param name="maxLength">128</param>
</data>
</define>
<define name="TargetBuildType">
<choice>
<value type="token">user</value>
<value type="token">userdebug</value>
<value type="token">eng</value>
</choice>
</define>
<define name="Target">
<element name="target">
<!-- If no name is given, the TargetPackName will be assumed. -->
<optional>
<attribute name="name">
<ref name="TargetName"/>
</attribute>
</optional>
<!--
A target specifies system characteristics and a root resource
pack required for the 'bdk' to generate the partition images
for a specific Brillo device.
-->
<attribute name="os">
<ref name="OsName"/>
</attribute>
<attribute name="os-version">
<ref name="Version"/>
</attribute>
<attribute name="board">
<ref name="BoardName"/>
</attribute>
<attribute name="board-version">
<ref name="Version"/>
</attribute>
<optional>
<attribute name="build">
<ref name="TargetBuildType"/>
</attribute>
</optional>
<attribute name="pack">
<ref name="TargetPackName"/>
</attribute>
</element>
</define>
<define name="Targets">
<element name="targets">
<optional>
<attribute name="version">
<choice>
<value type="integer">1</value>
</choice>
</attribute>
</optional>
<choice>
<oneOrMore>
<ref name="Target"/>
</oneOrMore>
<attribute name="path">
<data type="token">
<!-- TODO(wad): Move to a common data type. -->
<param name="maxLength">4096</param>
</data>
</attribute>
</choice>
</element>
</define>
</grammar>