Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Created September 1, 2013 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpluimers/6406985 to your computer and use it in GitHub Desktop.
Save jpluimers/6406985 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<!-- This very small subset of "http://schemas.microsoft.com/developer/msbuild/2003".
Normally that namespace is defined in Microsoft.Build.xsd/Microsoft.Build.Core.xsd/Microsoft.Build.Commontypes.xsd.
Actually this subset is not a trimmed down version of the original, but started from scracth to
only contains types used by Delphi/RAD Studio/C++ Builder.
In the future, I might add some better restrictions here and there, but so far it is sufficient engough to
- validate .groupproj documents
- use the Delphi XML Data Binding Wizard to generate a Delphi unit that allows generation and reading of .groupproj files.
The default values for `minOccurs` and `maxOccurs` are 1, so make `maxOccurs` larger to allow `repeating` in the Delphi XML Data Binding Wizard.
-->
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0"
targetNamespace="http://schemas.microsoft.com/developer/msbuild/2003"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Project" type="ProjectType"/>
<xsd:complexType name="ProjectType">
<xsd:sequence>
<xsd:element name="PropertyGroup" type="PropertyGroupType"/>
<!-- Delphi XE2 sometimes has an empty `ItemGroup` element -->
<xsd:element name="ItemGroup" type="ItemGroupType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="ProjectExtensions" type="ProjectExtensionsType"/>
<xsd:element name="Target" type="TargetType" maxOccurs="unbounded"/>
<xsd:element name="Import" type="ImportType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ImportType">
<xsd:attribute name="Project" type="xsd:string"/>
<xsd:attribute name="Condition" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="TargetType">
<xsd:sequence>
<xsd:choice>
<xsd:element name="MSBuild" type="MSBuildType"/>
<xsd:element name="CallTarget" type="CallTargetType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="DependsOnTargets" type="xsd:string" use="optional"/>
<xsd:attribute name="Name" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="MSBuildType">
<xsd:attribute name="Projects" type="xsd:string"/>
<!-- http://www.infopathdev.com/blogs/greg/archive/2004/09/16/The-Difference-Between-Optional-and-Not-Required.aspx -->
<xsd:attribute name="Targets" type="xsd:string" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CallTargetType">
<xsd:attribute name="Targets" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="ProjectExtensionsType">
<xsd:sequence>
<xsd:element name="Borland.Personality" type="xsd:string"/>
<xsd:element name="Borland.ProjectType" type="xsd:string"/>
<xsd:element name="BorlandProject" type="BorlandProjectType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="BorlandProjectType">
<xsd:choice>
<xsd:sequence>
<xsd:element name="Default.Personality" type="xsd:string"/>
</xsd:sequence>
<!-- Delphi 2010 can have a nested `BorlandProject` element -->
<xsd:element name="BorlandProject" type="BorlandProjectType"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="ItemGroupType">
<xsd:sequence>
<xsd:element name="Projects" type="ProjectsType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ProjectsType">
<xsd:sequence>
<xsd:element name="Dependencies" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="Include" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="PropertyGroupType">
<xsd:sequence>
<xsd:element name="ProjectGuid" type="guid"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="guid">
<xsd:annotation>
<xsd:documentation xml:lang="en">
The representation of a GUID, generally the id of an element.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment