Sun, 10 Sep 2023 12:52:10 +0200
some more code cleanup
29 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
3 | xmlns="http://unixwork.de/uwproj" | |
4 | targetNamespace="http://unixwork.de/uwproj" | |
41 | 5 | elementFormDefault="qualified" |
6 | version="0.1" | |
7 | > | |
29 | 8 | <xs:element name="project" type="ProjectType"/> |
9 | ||
10 | <xs:complexType name="ProjectType"> | |
11 | <xs:sequence> | |
12 | <xs:element name="config" type="ConfigType" minOccurs="0"/> | |
13 | <xs:element name="dependency" type="DependencyType" minOccurs="0" maxOccurs="unbounded"/> | |
14 | <xs:element name="target" type="TargetType" minOccurs="0" maxOccurs="unbounded"/> | |
15 | </xs:sequence> | |
16 | </xs:complexType> | |
17 | ||
18 | <xs:complexType name="ConfigType"> | |
19 | <xs:sequence> | |
20 | <xs:element name="var" type="ConfigVarType" minOccurs="0" maxOccurs="unbounded"/> | |
21 | </xs:sequence> | |
22 | </xs:complexType> | |
23 | ||
24 | <xs:complexType name="ConfigVarType"> | |
25 | <xs:simpleContent> | |
26 | <xs:extension base="xs:string"> | |
27 | <xs:attribute name="name" type="xs:string" use="required"/> | |
28 | <xs:attribute name="type" type="ExecType"/> | |
29 | </xs:extension> | |
30 | </xs:simpleContent> | |
31 | </xs:complexType> | |
32 | ||
33 | <!-- TODO: we should replace this type with a simple Boolean --> | |
34 | <xs:simpleType name="ExecType"> | |
35 | <xs:restriction base="xs:string"> | |
36 | <xs:enumeration value="exec"/> | |
37 | </xs:restriction> | |
38 | </xs:simpleType> | |
39 | ||
40 | <xs:complexType name="DependencyType"> | |
41 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | |
42 | <xs:element name="lang" type="xs:string"/> | |
43 | <xs:element name="cflags" type="FlagsType"/> | |
44 | <xs:element name="ldflags" type="FlagsType"/> | |
45 | <xs:element name="pkgconfig" type="xs:string"/> | |
46 | <xs:element name="test" type="xs:string"/> | |
47 | <xs:element name="make" type="xs:string"/> | |
48 | </xs:choice> | |
49 | <xs:attribute name="name" type="xs:string"/> | |
50 | <xs:attribute name="platform" type="xs:string"/> | |
51 | <xs:attribute name="not" type="xs:string"/> | |
52 | </xs:complexType> | |
53 | ||
54 | <xs:complexType name="FlagsType"> | |
55 | <xs:simpleContent> | |
56 | <xs:extension base="xs:string"> | |
57 | <xs:attribute name="type" type="ExecType"/> | |
58 | </xs:extension> | |
59 | </xs:simpleContent> | |
60 | </xs:complexType> | |
61 | ||
62 | <xs:complexType name="TargetType"> | |
63 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | |
64 | <xs:element name="feature" type="FeatureType"/> | |
65 | <xs:element name="option" type="OptionType"/> | |
66 | <xs:element name="define" type="DefineType"/> | |
67 | <xs:element name="dependencies" type="DependenciesType"/> | |
68 | <xs:element name="alldependencies"> | |
69 | <xs:complexType/> | |
70 | </xs:element> | |
71 | </xs:choice> | |
72 | <xs:attribute name="name" type="xs:string"/> | |
73 | </xs:complexType> | |
74 | ||
75 | <xs:complexType name="FeatureType"> | |
76 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | |
77 | <xs:group ref="TargetDataGroup"/> | |
78 | </xs:choice> | |
79 | <xs:attribute name="name" type="xs:string" use="required"/> | |
80 | <xs:attribute name="arg" type="xs:string"/> | |
81 | <xs:attribute name="default" default="false"> | |
82 | <!-- TODO: this should be just Boolean --> | |
83 | <xs:simpleType> | |
84 | <xs:restriction base="xs:string"> | |
85 | <xs:enumeration value="true"/> | |
86 | <xs:enumeration value="false"/> | |
87 | <xs:enumeration value="on"/> | |
88 | <xs:enumeration value="off"/> | |
89 | </xs:restriction> | |
90 | </xs:simpleType> | |
91 | </xs:attribute> | |
92 | </xs:complexType> | |
93 | ||
94 | <xs:complexType name="OptionType"> | |
95 | <xs:sequence> | |
96 | <xs:element name="value" type="OptionValueType" minOccurs="0" maxOccurs="unbounded"/> | |
97 | <xs:element name="default" type="OptionDefaultType" minOccurs="0" maxOccurs="unbounded"/> | |
98 | </xs:sequence> | |
99 | <xs:attribute name="arg" type="xs:string"/> | |
100 | </xs:complexType> | |
101 | ||
102 | <xs:complexType name="OptionValueType"> | |
103 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | |
104 | <xs:group ref="TargetDataGroup"/> | |
105 | </xs:choice> | |
106 | <xs:attribute name="str" type="xs:string" use="required"/> | |
107 | </xs:complexType> | |
108 | ||
109 | <xs:complexType name="OptionDefaultType"> | |
110 | <xs:attribute name="value" type="xs:string" use="required"/> | |
111 | <xs:attribute name="platform" type="xs:string"/> | |
112 | </xs:complexType> | |
113 | ||
114 | <xs:group name="TargetDataGroup"> | |
115 | <xs:choice> | |
116 | <xs:element name="define" type="DefineType" minOccurs="0" maxOccurs="unbounded"/> | |
117 | <xs:element name="dependencies" type="DependenciesType" minOccurs="0" maxOccurs="unbounded"/> | |
118 | <xs:element name="make" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> | |
119 | </xs:choice> | |
120 | </xs:group> | |
121 | ||
122 | <xs:complexType name="DefineType"> | |
123 | <xs:attribute name="name" type="xs:string" use="required"/> | |
124 | <xs:attribute name="value" type="xs:string"/> | |
125 | </xs:complexType> | |
126 | ||
127 | <xs:simpleType name="DependenciesType"> | |
128 | <xs:restriction base="xs:string"/> | |
129 | </xs:simpleType> | |
130 | </xs:schema> |