Skip to content

Commit

Permalink
New XSD for Package Project template
Browse files Browse the repository at this point in the history
I've put the xsd files directly under XmlSchemas as I didn't saw an usecase where these need to be in a separate project (as they are only used in DIS to be made available for Visual Studio)
If necessary, a separate project can still be made afterwards as the content would remain the same anyway.
  • Loading branch information
MichielOda committed Dec 6, 2024
1 parent 5cbeccb commit 5947c26
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 51 deletions.
15 changes: 3 additions & 12 deletions Automation/Automation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,9 @@
</ItemGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\LICENSE.txt">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\icon.png" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
15 changes: 3 additions & 12 deletions Function/Function.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,9 @@
</ItemGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\LICENSE.txt">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\icon.png" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
15 changes: 3 additions & 12 deletions Protocol/Protocol.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,9 @@
</ItemGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\LICENSE.txt">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\icon.png" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
Expand Down
File renamed without changes.
91 changes: 91 additions & 0 deletions XmlSchemas/CatalogReferences.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cr="http://www.skyline.be/catalogReferences"
targetNamespace="http://www.skyline.be/catalogReferences"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:element name="CatalogReferences">
<xs:annotation>
<xs:documentation>Specifies the catalog artifacts to be included in the package.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="CatalogReference" maxOccurs="unbounded" minOccurs="0">
<xs:annotation>
<xs:documentation>Specifies the catalog artifact to be included in the package.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element type="cr:TypeNonEmptyString" name="Name" minOccurs="0">
<xs:annotation>
<xs:documentation>The name of the Catalog artifact.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Selection">
<xs:complexType>
<xs:choice>
<xs:element type="cr:TypeNonEmptyString" name="Specific">
<xs:annotation>
<xs:documentation>Specifies the version of the catalog artifact.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Range">
<xs:annotation>
<xs:documentation>This should be the name of the range (e.g. 1.0.0, 6.0.0, ...)</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="cr:TypeNonEmptyString">
<xs:attribute type="cr:EnumTrueFalse" name="allowPrerelease" use="optional">
<xs:annotation>
<xs:documentation>Specified whether the latest version from the range can be a pre-release version.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="cr:TypeGuid" name="id" use="required">
<xs:annotation>
<xs:documentation>The GUID of the catalog artifact.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="TypeNonEmptyString">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="EnumTrueFalse">
<xs:restriction base="xs:string">
<xs:enumeration value="true">
<xs:annotation>
<xs:documentation>True</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="false">
<xs:annotation>
<xs:documentation>False</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TypeGuid">
<xs:annotation>
<xs:documentation>The representation of a GUID.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs: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}\}"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
64 changes: 64 additions & 0 deletions XmlSchemas/ProjectReferences.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:pr="http://www.skyline.be/projectReferences"
targetNamespace="http://www.skyline.be/projectReferences"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:element name="ProjectReferences">
<xs:annotation>
<xs:documentation>Specifies the projects that need to be included or excluded for the package. </xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="ProjectReference">
<xs:complexType>
<xs:simpleContent>
<xs:attribute type="pr:TypeNonEmptyString" name="Include">
<xs:annotation>
<xs:documentation>
Specifies the relative path of the projects that need to be included. This path is relative to the project folder.
Wildcards (*) are supported.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute type="pr:TypeNonEmptyString" name="Exclude">
<xs:annotation>
<xs:documentation>
Specifies the relative path of the projects that need to be excluded. This path is relative to the project folder.
Wildcards (*) are supported.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:simpleContent>
</xs:complexType>
<xs:key name="attributeKey">
<!-- Needed to make sure that Include & Exclude are mutually exclusive -->
<xs:selector xpath="." />
<xs:field xpath="@Include|@Exclude" />
</xs:key>
</xs:element>
<xs:element name="SolutionFilter">
<xs:annotation>
<xs:documentation>Specifies a Visual Studio solution filter (.slnf). This can act as a bulk Include of ProjectReferences.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:attribute type="pr:TypeNonEmptyString" name="Include">
<xs:annotation>
<xs:documentation>Specifies the relative path to the solution filter file (.slnf). This path is relative to the project folder.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:simpleType name="TypeNonEmptyString">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
33 changes: 18 additions & 15 deletions XmlSchemas/XmlSchemas.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\LICENSE.txt">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\icon.png" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<None Remove="*.xsd" />
</ItemGroup>

<ItemGroup>
<Content Include="*.xsd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
<PackagePath>contentFiles\any\any\Skyline\XSD;content\Skyline\XSD</PackagePath>
</Content>
</ItemGroup>

<Target Name="IncludeXSD" BeforeTargets="_GetPackageFiles">
Expand All @@ -44,9 +47,9 @@
</Target>

<ItemGroup>
<ProjectReference Include="..\Automation\Automation.csproj" />
<ProjectReference Include="..\Function\Function.csproj" />
<ProjectReference Include="..\Protocol\Protocol.csproj" />
<ProjectReference Include="..\Automation\Automation.csproj" />
<ProjectReference Include="..\Function\Function.csproj" />
<ProjectReference Include="..\Protocol\Protocol.csproj" />
</ItemGroup>

</Project>

0 comments on commit 5947c26

Please sign in to comment.