-
Notifications
You must be signed in to change notification settings - Fork 0
/
SubSolution.Builders.csproj
39 lines (33 loc) · 1.56 KB
/
SubSolution.Builders.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net461</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
<Description>Library used to build solutions from SubSolution configurations (.subsln files).</Description>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="5.0.0" />
<PackageReference Include="XObjectsCore" Version="3.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SubSolution\SubSolution.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="subsln.xsd">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<!-- Inspired from: https://gist.github.com/KirillOsenkov/f20cb84d37a89b01db63f8aafe03f19b -->
<Target Name="GenerateCSharpFromXsd" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)subsln.xsd.cs">
<PropertyGroup>
<GeneratedFilePath>$(IntermediateOutputPath)subsln.xsd.cs</GeneratedFilePath>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(GeneratedFilePath)" />
<FileWrites Include="$(GeneratedFilePath)" />
</ItemGroup>
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet tool restore" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet tool run LinqToXsd gen "subsln.xsd" -c "subsln.xsd.config" -o "$(GeneratedFilePath)"" />
</Target>
</Project>