Merge pull request #900 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / tools / xbuild / data / MSBuild / Microsoft.Build.Core.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xs:schema targetNamespace="http://schemas.microsoft.com/developer/msbuild/2003" xmlns:msb="http://schemas.microsoft.com/developer/msbuild/2003" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
3     <!-- ======================================================================================= -->
4     <xs:element name="Project">
5         <xs:complexType>
6             <xs:sequence>
7                 <xs:group ref="msb:ProjectLevelTagExceptTargetOrImportType" minOccurs="0" maxOccurs="unbounded"/>
8                 <!-- must be at least one Target or Import tag-->
9                 <xs:group ref="msb:TargetOrImportType"/>
10                 <xs:group ref="msb:ProjectLevelTagType" minOccurs="0" maxOccurs="unbounded"/>
11             </xs:sequence>
12             <xs:attribute name="DefaultTargets" type="xs:string" use="optional">
13                 <xs:annotation>
14                     <xs:documentation>Optional semi-colon separated list of one or more targets that will be built if no targets are otherwise specified</xs:documentation>
15                 </xs:annotation>
16             </xs:attribute>
17         </xs:complexType>
18     </xs:element>
19     <!-- ======================================================================================= -->
20     <xs:group name="ProjectLevelTagExceptTargetOrImportType">
21         <xs:choice>
22             <xs:element name="PropertyGroup" type="msb:PropertyGroupType"/>
23             <xs:element name="ItemGroup" type="msb:ItemGroupType"/>
24             <xs:element name="Choose" type="msb:ChooseType"/>
25             <xs:element name="Error" type="msb:WarningErrorOutsideTargetType">
26                 <xs:annotation>
27                     <xs:documentation>Logs an Error event</xs:documentation>
28                 </xs:annotation>
29             </xs:element>
30             <xs:element name="Warning" type="msb:WarningErrorOutsideTargetType">
31                 <xs:annotation>
32                     <xs:documentation>Logs a Warning event</xs:documentation>
33                 </xs:annotation>
34             </xs:element>
35             <xs:element name="Message" type="msb:MessageOutsideTargetType"/>
36             <xs:element name="UsingTask" type="msb:UsingTaskType"/>
37             <xs:element name="ProjectExtensions" type="msb:ProjectExtensionsType"/>
38         </xs:choice>
39     </xs:group>
40     <!-- ======================================================================================= -->
41     <xs:group name="ProjectLevelTagType">
42         <xs:choice>
43             <xs:element name="PropertyGroup" type="msb:PropertyGroupType"/>
44             <xs:element name="ItemGroup" type="msb:ItemGroupType"/>
45             <xs:element name="Choose" type="msb:ChooseType"/>
46             <xs:element name="Error" type="msb:WarningErrorOutsideTargetType">
47                 <xs:annotation>
48                     <xs:documentation>Logs an Error event</xs:documentation>
49                 </xs:annotation>
50             </xs:element>
51             <xs:element name="Warning" type="msb:WarningErrorOutsideTargetType">
52                 <xs:annotation>
53                     <xs:documentation>Logs a Warning event</xs:documentation>
54                 </xs:annotation>
55             </xs:element>
56             <xs:element name="Message" type="msb:MessageOutsideTargetType"/>
57             <xs:element name="UsingTask" type="msb:UsingTaskType"/>
58             <xs:element name="Target" type="msb:TargetType"/>
59             <xs:element name="Import" type="msb:ImportType"/>
60             <xs:element name="ProjectExtensions" type="msb:ProjectExtensionsType"/>
61         </xs:choice>
62     </xs:group>
63     <!-- ======================================================================================= -->
64     <xs:group name="TargetOrImportType">
65         <xs:choice>
66             <xs:element name="Target" type="msb:TargetType"/>
67             <xs:element name="Import" type="msb:ImportType"/>
68         </xs:choice>
69     </xs:group>
70     <!-- ======================================================================================= -->
71     <xs:complexType name="TargetType">
72         <xs:annotation>
73             <xs:documentation>Groups tasks into a section of the build process</xs:documentation>
74         </xs:annotation>
75         <xs:sequence>
76             <xs:choice minOccurs="0" maxOccurs="unbounded">
77                 <xs:element ref="msb:Task"/>
78             </xs:choice>
79             <xs:element name="OnError" type="msb:OnErrorType" minOccurs="0" maxOccurs="unbounded"/>
80             <!-- no elements are allowed under Target after an OnError element-->
81         </xs:sequence>
82         <xs:attribute name="Name" type="msb:non_empty_string" use="required">
83             <xs:annotation>
84                 <xs:documentation>Name of the target</xs:documentation>
85             </xs:annotation>
86         </xs:attribute>
87         <xs:attribute name="DependsOnTargets" type="xs:string" use="optional">
88             <xs:annotation>
89                 <xs:documentation>Optional semi-colon separated list of targets that should be run before this target</xs:documentation>
90             </xs:annotation>
91         </xs:attribute>
92         <xs:attribute name="Inputs" type="xs:string" use="optional">
93             <xs:annotation>
94                 <xs:documentation>Optional semi-colon separated list of files that form inputs into this target. Their timestamps will be compared with the timestamps of files in Outputs to determine whether the Target is up to date</xs:documentation>
95             </xs:annotation>
96         </xs:attribute>
97         <xs:attribute name="Outputs" type="xs:string" use="optional">
98             <xs:annotation>
99                 <xs:documentation>Optional semi-colon separated list of files that form outputs into this target. Their timestamps will be compared with the timestamps of files in Inputs to determine whether the Target is up to date</xs:documentation>
100             </xs:annotation>
101         </xs:attribute>
102         <xs:attribute name="Condition" type="xs:string" use="optional">
103             <xs:annotation>
104                 <xs:documentation>Optional expression evaluated to determine whether the Target and the targets it depends on should be run</xs:documentation>
105             </xs:annotation>
106         </xs:attribute>
107     </xs:complexType>
108     <!-- ======================================================================================= -->
109     <xs:complexType name="PropertyGroupType">
110         <xs:annotation>
111             <xs:documentation>Groups property definitions</xs:documentation>
112         </xs:annotation>
113         <xs:sequence minOccurs="0" maxOccurs="unbounded">
114             <xs:element ref="msb:Property"/>
115         </xs:sequence>
116         <xs:attribute name="Condition" type="xs:string" use="optional">
117             <xs:annotation>
118                 <xs:documentation>Optional expression evaluated to determine whether the PropertyGroup should be used</xs:documentation>
119             </xs:annotation>
120         </xs:attribute>
121     </xs:complexType>
122     <!-- ======================================================================================= -->
123     <xs:complexType name="ItemGroupType">
124         <xs:annotation>
125             <xs:documentation>Groups item list definitions</xs:documentation>
126         </xs:annotation>
127         <xs:sequence minOccurs="0" maxOccurs="unbounded">
128             <xs:element ref="msb:Item"/>
129         </xs:sequence>
130         <xs:attribute name="Condition" type="xs:string" use="optional">
131             <xs:annotation>
132                 <xs:documentation>Optional expression evaluated to determine whether the ItemGroup should be used</xs:documentation>
133             </xs:annotation>
134         </xs:attribute>
135     </xs:complexType>
136     <!-- ======================================================================================= -->
137     <xs:complexType name="ChooseType">
138         <xs:annotation>
139             <xs:documentation>Groups When and Otherwise elements</xs:documentation>
140         </xs:annotation>
141         <xs:sequence>
142             <xs:element name="When" type="msb:WhenType" maxOccurs="unbounded"/>
143             <xs:element name="Otherwise" type="msb:OtherwiseType" minOccurs="0"/>
144         </xs:sequence>
145     </xs:complexType>
146     <!-- ======================================================================================= -->
147     <xs:complexType name="WhenType">
148         <xs:annotation>
149             <xs:documentation>Groups PropertyGroup and/or ItemGroup elements</xs:documentation>
150         </xs:annotation>
151         <xs:sequence minOccurs="0" maxOccurs="unbounded">
152             <xs:choice>
153                 <xs:element name="PropertyGroup" type="msb:PropertyGroupType"/>
154                 <xs:element name="ItemGroup" type="msb:ItemGroupType"/>
155                 <xs:element name="Choose" type="msb:ChooseType"/>
156             </xs:choice>
157         </xs:sequence>
158         <xs:attribute name="Condition" type="xs:string" use="required">
159             <xs:annotation>
160                 <xs:documentation>Optional expression evaluated to determine whether the child PropertyGroups and/or ItemGroups should be used</xs:documentation>
161             </xs:annotation>
162         </xs:attribute>
163     </xs:complexType>
164     <!-- ======================================================================================= -->
165     <xs:complexType name="OtherwiseType">
166         <xs:annotation>
167             <xs:documentation>Groups PropertyGroup and/or ItemGroup elements that are used if no Conditions on sibling When elements evaluate to true</xs:documentation>
168         </xs:annotation>
169         <xs:sequence minOccurs="0" maxOccurs="unbounded">
170             <xs:choice>
171                 <xs:element name="PropertyGroup" type="msb:PropertyGroupType"/>
172                 <xs:element name="ItemGroup" type="msb:ItemGroupType"/>
173                 <xs:element name="Choose" type="msb:ChooseType"/>
174             </xs:choice>
175         </xs:sequence>
176     </xs:complexType>
177     <!-- ======================================================================================= -->
178     <xs:complexType name="OnErrorType">
179         <xs:annotation>
180             <xs:documentation>Specifies targets to execute in the event of a recoverable error</xs:documentation>
181         </xs:annotation>
182         <xs:attribute name="Condition" type="xs:string" use="optional">
183             <xs:annotation>
184                 <xs:documentation>Optional expression evaluated to determine whether the targets should be executed</xs:documentation>
185             </xs:annotation>
186         </xs:attribute>
187         <xs:attribute name="ExecuteTargets" type="msb:non_empty_string" use="required">
188             <xs:annotation>
189                 <xs:documentation>Semi-colon separated list of targets to execute</xs:documentation>
190             </xs:annotation>
191         </xs:attribute>
192     </xs:complexType>
193     <!-- ======================================================================================= -->
194     <xs:complexType name="MessageOutsideTargetType">
195         <xs:annotation>
196             <xs:documentation>Logs an informational Message event, with an optional Importance</xs:documentation>
197         </xs:annotation>
198         <xs:attribute name="Condition" type="xs:string" use="optional">
199             <xs:annotation>
200                 <xs:documentation>Optional expression evaluated to determine whether the Message should be logged</xs:documentation>
201             </xs:annotation>
202         </xs:attribute>
203         <xs:attribute name="Importance" type="xs:string" use="optional">
204             <xs:annotation>
205                 <xs:documentation>Optional priority level. Allowed values are Low, Normal (default), and High</xs:documentation>
206             </xs:annotation>
207         </xs:attribute>
208         <xs:attribute name="Text" type="xs:string" use="optional">
209             <xs:annotation>
210                 <xs:documentation>Text to log</xs:documentation>
211             </xs:annotation>
212         </xs:attribute>
213     </xs:complexType>
214     <!-- ======================================================================================= -->
215     <xs:complexType name="WarningErrorOutsideTargetType">
216         <xs:attribute name="Condition" type="xs:string" use="optional">
217             <xs:annotation>
218                 <xs:documentation>Optional expression evaluated to determine whether the text should be logged</xs:documentation>
219             </xs:annotation>
220         </xs:attribute>
221         <xs:attribute name="Text" type="xs:string" use="optional">
222             <xs:annotation>
223                 <xs:documentation>Text to log</xs:documentation>
224             </xs:annotation>
225         </xs:attribute>
226     </xs:complexType>
227     <!-- ======================================================================================= -->
228     <xs:complexType name="UsingTaskType">
229         <xs:annotation>
230             <xs:documentation>Declares where to load a task that will be used in the project</xs:documentation>
231         </xs:annotation>
232         <xs:attribute name="Condition" type="xs:string" use="optional">
233             <xs:annotation>
234                 <xs:documentation>Optional expression evaluated to determine whether the declaration should be evaluated</xs:documentation>
235             </xs:annotation>
236         </xs:attribute>
237         <xs:attribute name="AssemblyName" type="msb:non_empty_string" use="optional">
238             <xs:annotation>
239                 <xs:documentation>Optional name of assembly containing the task. Either AssemblyName or AssemblyFile must be used</xs:documentation>
240             </xs:annotation>
241         </xs:attribute>
242         <xs:attribute name="AssemblyFile" type="msb:non_empty_string" use="optional">
243             <xs:annotation>
244                 <xs:documentation>Optional path to assembly containing the task. Either AssemblyName or AssemblyFile must be used</xs:documentation>
245             </xs:annotation>
246         </xs:attribute>
247         <xs:attribute name="TaskName" type="msb:non_empty_string" use="required">
248             <xs:annotation>
249                 <xs:documentation>Name of task class in the assembly</xs:documentation>
250             </xs:annotation>
251         </xs:attribute>
252     </xs:complexType>
253     <!-- ======================================================================================= -->
254     <xs:complexType name="ImportType">
255         <xs:annotation>
256             <xs:documentation>Declares that the contents of another project file should be inserted at this location</xs:documentation>
257         </xs:annotation>
258         <xs:attribute name="Condition" type="xs:string" use="optional">
259             <xs:annotation>
260                 <xs:documentation>Optional expression evaluated to determine whether the import should occur</xs:documentation>
261             </xs:annotation>
262         </xs:attribute>
263         <xs:attribute name="Project" type="msb:non_empty_string" use="required">
264             <xs:annotation>
265                 <xs:documentation>Project file to import</xs:documentation>
266             </xs:annotation>
267         </xs:attribute>
268     </xs:complexType>
269     <!-- ======================================================================================= -->
270     <xs:complexType name="ProjectExtensionsType" mixed="true">
271         <xs:annotation>
272             <xs:documentation>Optional section used by MSBuild hosts, that may contain arbitrary XML content that is ignored by MSBuild itself</xs:documentation>
273         </xs:annotation>
274         <xs:sequence minOccurs="0" maxOccurs="unbounded">
275             <xs:any processContents="skip"/>
276         </xs:sequence>
277     </xs:complexType>
278     <!-- ======================================================================================= -->
279     <xs:element name="Item" type="msb:SimpleItemType" abstract="true"/>
280     <!-- ======================================================================================= -->
281     <!-- convenience type for items that have no meta-data-->
282     <xs:complexType name="SimpleItemType">
283         <xs:attribute name="Condition" type="xs:string" use="optional">
284             <xs:annotation>
285                 <xs:documentation>Optional expression evaluated to determine whether the items should be evaluated</xs:documentation>
286             </xs:annotation>
287         </xs:attribute>
288         <xs:attribute name="Include" type="xs:string" use="required">
289             <xs:annotation>
290                 <xs:documentation>Semi-colon separated list of files (wildcards are allowed) or other item names to include in this item list</xs:documentation>
291             </xs:annotation>
292         </xs:attribute>
293         <xs:attribute name="Exclude" type="xs:string" use="optional">
294             <xs:annotation>
295                 <xs:documentation>Semi-colon separated list of files (wildcards are allowed) or other item names to exclude from the Include list</xs:documentation>
296             </xs:annotation>
297         </xs:attribute>
298     </xs:complexType>
299     <!-- ======================================================================================= -->
300     <!-- general utility type allowing an item type to be defined but not its child meta-data-->
301     <xs:complexType name="GenericItemType">
302         <xs:complexContent>
303             <xs:extension base="msb:SimpleItemType">
304                 <xs:sequence minOccurs="0" maxOccurs="unbounded">
305                     <xs:any namespace="##any" processContents="skip"/>
306                 </xs:sequence>
307             </xs:extension>
308         </xs:complexContent>
309     </xs:complexType>
310     <!-- ======================================================================================= -->
311     <!-- no type declared on this abstract element, so either a simple or complex type can be substituted for it.-->
312     <xs:element name="Property" abstract="true"/>
313     <!-- ======================================================================================= -->
314     <!-- convenience type for properties that just want to allow text and no elements in them-->
315     <xs:complexType name="StringPropertyType">
316         <xs:simpleContent>
317             <xs:extension base="xs:string">
318                 <xs:attribute name="Condition" type="xs:string" use="optional">
319                     <xs:annotation>
320                         <xs:documentation>Optional expression evaluated to determine whether the property should be evaluated</xs:documentation>
321                     </xs:annotation>
322                 </xs:attribute>
323             </xs:extension>
324         </xs:simpleContent>
325     </xs:complexType>
326     <!-- ======================================================================================= -->
327     <!-- general utility type allowing text and/or elements inside-->
328     <xs:complexType name="GenericPropertyType" mixed="true">
329         <xs:sequence minOccurs="0" maxOccurs="unbounded">
330             <xs:any namespace="##any" processContents="skip"/>
331         </xs:sequence>
332         <xs:attribute name="Condition" type="xs:string" use="optional">
333             <xs:annotation>
334                 <xs:documentation>Optional expression evaluated to determine whether the property should be evaluated</xs:documentation>
335             </xs:annotation>
336         </xs:attribute>
337     </xs:complexType>
338     <!-- ======================================================================================= -->
339     <xs:element name="Task" type="msb:TaskType" abstract="true"/>
340     <!-- ======================================================================================= -->
341     <xs:complexType name="TaskType">
342         <xs:sequence minOccurs="0" maxOccurs="unbounded">
343             <xs:element name="Output">
344                 <xs:annotation>
345                     <xs:documentation>Optional element specifying a specific task output to be gathered</xs:documentation>
346                 </xs:annotation>
347                 <xs:complexType>
348                     <xs:attribute name="TaskParameter" type="msb:non_empty_string" use="required">
349                         <xs:annotation>
350                             <xs:documentation>Task parameter to gather. Matches the name of a .NET Property on the task class that has an [Output] attribute</xs:documentation>
351                         </xs:annotation>
352                     </xs:attribute>
353                     <xs:attribute name="ItemName" type="msb:non_empty_string" use="optional">
354                         <xs:annotation>
355                             <xs:documentation>Optional name of an item list to put the gathered outputs into. Either ItemName or PropertyName must be specified</xs:documentation>
356                         </xs:annotation>
357                     </xs:attribute>
358                     <xs:attribute name="PropertyName" type="msb:non_empty_string" use="optional">
359                         <xs:annotation>
360                             <xs:documentation>Optional name of a property to put the gathered output into. Either PropertyName or ItemName must be specified</xs:documentation>
361                         </xs:annotation>
362                     </xs:attribute>
363                     <xs:attribute name="Condition" type="xs:string" use="optional">
364                         <xs:annotation>
365                             <xs:documentation>Optional expression evaluated to determine whether the output should be gathered</xs:documentation>
366                         </xs:annotation>
367                     </xs:attribute>
368                 </xs:complexType>
369             </xs:element>
370         </xs:sequence>
371         <xs:attribute name="Condition" type="xs:string" use="optional">
372             <xs:annotation>
373                 <xs:documentation>Optional expression evaluated to determine whether the task should be executed</xs:documentation>
374             </xs:annotation>
375         </xs:attribute>
376         <xs:attribute name="ContinueOnError" type="msb:non_empty_string" use="optional">
377             <xs:annotation>
378                 <xs:documentation>Optional boolean indicating whether a recoverable task error should be ignored. Default false</xs:documentation>
379             </xs:annotation>
380         </xs:attribute>
381         <!-- We don't need the anyAttribute here because other types deriving from this type will add the right attributes.-->
382     </xs:complexType>
383     <!-- ======================================================================================= -->
384     <!-- XSD considers an empty-valued attribute to satisfy use="required", but we want it to have a non-empty value in most cases, hence this utility type. -->
385     <xs:simpleType name="non_empty_string">
386         <xs:restriction base="xs:string">
387             <xs:minLength value="1"/>
388         </xs:restriction>
389     </xs:simpleType>
390 </xs:schema>