|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<Project DefaultTargets="Test;Publish" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 3 | + <PropertyGroup> |
| 4 | + <Root>$(MSBuildProjectDirectory)\</Root> |
| 5 | + <BuildPlatform Condition="$(BuildPlatform) == ''">Any CPU</BuildPlatform> |
| 6 | + <Configuration Condition="$(Configuration) == ''">Release</Configuration> |
| 7 | + <MSBuildCommunityTasksPath>$(Root)tools\MSBuildCommunityTasks</MSBuildCommunityTasksPath> |
| 8 | + </PropertyGroup> |
| 9 | + <ItemGroup> |
| 10 | + <NUnit Include="$(Root)packages\NUnit.Runners.*\tools\nunit-console.exe" /> |
| 11 | + <NuGet Include="$(Root)packages\NuGet.CommandLine.*\tools\NuGet.exe" /> |
| 12 | + </ItemGroup> |
| 13 | + |
| 14 | + <Target Name="Cleanup"> |
| 15 | + <Error Condition="$(Root) == ''" Text="Root variable must be defined" /> |
| 16 | + <Error Condition="@(NUnit) == ''" Text="Cannot find nUnit runner" /> |
| 17 | + <Error Condition="@(NuGet) == ''" Text="Cannot find NuGet command line tool" /> |
| 18 | + |
| 19 | + <!-- Diagnostics --> |
| 20 | + <Message Text="Diagnostics:"/> |
| 21 | + <Message Text="Project root: $(Root)" /> |
| 22 | + <Message Text="Drop path: build\Artifacts" /> |
| 23 | + |
| 24 | + <!-- Clean up --> |
| 25 | + <ItemGroup> |
| 26 | + <FilesToDelete Include="$(Root)**\bin\**\*.*" /> |
| 27 | + <FilesToDelete Include="$(Root)**\obj\**\*.*" /> |
| 28 | + <FilesToDelete Include="$(Root)build\Artifacts\**\*.*" /> |
| 29 | + </ItemGroup> |
| 30 | + <Delete Files="@(FilesToDelete)" ContinueOnError="true" /> |
| 31 | + <Delete Files="$(Root)build\Artifacts" /> |
| 32 | + </Target> |
| 33 | + |
| 34 | + <Target Name="Build" DependsOnTargets="Cleanup"> |
| 35 | + <MSBuild Projects="$(Root)ConventionTests.sln" Properties="Configuration=$(Configuration);Platform=$(BuildPlatform)" /> |
| 36 | + </Target> |
| 37 | + |
| 38 | + <Target Name="Test" DependsOnTargets="Build"> |
| 39 | + <Exec Command="@(NUnit) $(Root)TestStack.ConventionTests.Tests\bin\$(Configuration)\TestStack.ConventionTests.Tests.dll" /> |
| 40 | + </Target> |
| 41 | + |
| 42 | + <Target Name="Publish"> |
| 43 | + <PropertyGroup> |
| 44 | + <Version Condition="'$(Version)' == ''">0.0.0.0</Version> |
| 45 | + </PropertyGroup> |
| 46 | + <MakeDir Directories="$(Root)build\Artifacts" /> |
| 47 | + <Exec Command="@(NuGet) pack $(Root)TestStack.ConventionTests\TestStack.ConventionTests.nuspec -Version $(Version) -OutputDir $(Root)build\Artifacts -BasePath $(Root)TestStack.ConventionTests\bin\$(Configuration)" /> |
| 48 | + </Target> |
| 49 | +</Project> |
0 commit comments