adding gomodh spec

This commit is contained in:
brent s 2020-09-04 02:08:57 -04:00
parent 9d24eceefc
commit 5f3be54ec8
Signed by: bts
GPG Key ID: 8C004C2F93481F6B
3 changed files with 78 additions and 10 deletions

View File

@ -46,7 +46,7 @@


<xs:simpleType name="t_git_uri"> <xs:simpleType name="t_git_uri">
<xs:restriction base="xs:anyURI"> <xs:restriction base="xs:anyURI">
<xs:pattern value="(https?|git|file)://.*"/> <xs:pattern value="(https?|git|file|ssh)://.*"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>



View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:x="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:include schemaLocation="./net.xsd"/>
<xs:include schemaLocation="./unix.xsd"/>

<xs:complexType name="t_gomodh_base">
<xs:attribute name="name" type="t_unix_portablePosixFilename" use="required"/>
<xs:attribute name="baseUrl" type="t_net_http_basic_uri" use="optional"/>
</xs:complexType>

<xs:complexType name="t_gomodh_pkg">
<xs:complexContent>
<xs:extension base="t_gomodh_base">
<xs:all>
<xs:element name="realUrl" type="t_gomodh_vcs_uri"/>
</xs:all>
<xs:attribute name="vcsType" type="t_gomodh_vcs" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="t_gomodh_mod">
<xs:complexContent>
<xs:extension base="t_gomodh_base">
<xs:all>
<xs:element name="realURL" type="t_net_http_basic_uri"/>
<xs:element name="releases">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="release">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:token">
<xs:attribute name="dir" type="t_unix_dirpath" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="baseDir" type="t_unix_dirpath" use="required"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<!-- VCS are also called SCM. -->
<xs:simpleType name="t_gomodh_vcs">
<xs:restriction base="xs:string">
<xs:enumeration value="bzr"/>
<xs:enumeration value="fossil"/>
<xs:enumeration value="git"/>
<xs:enumeration value="hg"/>
<xs:enumeration value="svn"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="t_gomodh_vcs_uri">
<xs:restriction base="xs:anyURI">
<!--
Some of the weird ones might be BZR.
http://doc.bazaar.canonical.com/development/en/user-reference/urlspec-help.html
-->
<xs:pattern value="(https?|bzr|aftp|bzr\+ssh|file|ftp|sftp|git|ssh|hg)://.+/?"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>

</xs:schema>

View File

@ -7,21 +7,16 @@
attributeFormDefault="unqualified"> attributeFormDefault="unqualified">


<xs:include schemaLocation="../lib/types/net.xsd"/> <xs:include schemaLocation="../lib/types/net.xsd"/>
<xs:include schemaLocation="../lib/types/unix.xsd"/> <xs:include schemaLocation="../lib/types/gomodh.xsd"/>


<xs:element name="gomodh"> <xs:element name="gomodh">
<xs:complexType> <xs:complexType>
<xs:choice minOccurs="1" maxOccurs="unbounded"> <xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="mod"> <xs:element name="mod" type="t_gomodh_mod"/>
<xs:complexType> <xs:element name="pkg" type="t_gomodh_pkg"/>
<xs:attribute name="name" type="t_unix_portablePosixFilename" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="pkg">

</xs:element>
</xs:choice> </xs:choice>
<xs:attribute name="baseURL" type="t_net_http_basic_uri" use="required"/> <xs:attribute name="baseURL" type="t_net_http_basic_uri" use="required"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>

</xs:schema> </xs:schema>