forked from coverlet-coverage/coverlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
34 lines (27 loc) · 1.82 KB
/
build.proj
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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NuspecFile>$(MSBuildThisFileDirectory)coverlet.msbuild.nuspec</NuspecFile>
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
<OutputPath>$(MSBuildThisFileDirectory)build\$(Configuration)</OutputPath>
</PropertyGroup>
<Target Name="BuildAllProjects">
<RemoveDir Directories="$(OutputPath)" Condition="Exists('$(MSBuildThisFileDirectory)\build')" />
<Exec Command="dotnet build $(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj -c $(Configuration)" />
</Target>
<Target Name="PublishMSBuildTaskProject" AfterTargets="BuildAllProjects">
<Exec Command="dotnet publish $(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj -c $(Configuration) -o $(OutputPath)" />
</Target>
<Target Name="CopyMSBuildScripts" AfterTargets="PublishMSBuildTaskProject">
<ItemGroup>
<BuildScript Include="$(MSBuildThisFileDirectory)src\coverlet.msbuild\coverlet.msbuild.props" />
<BuildScript Include="$(MSBuildThisFileDirectory)src\coverlet.msbuild\coverlet.msbuild.targets" />
</ItemGroup>
<Copy SourceFiles="@(BuildScript)" DestinationFolder="$(OutputPath)" />
</Target>
<Target Name="RunTests" AfterTargets="CopyMSBuildScripts">
<Exec Command="dotnet test $(MSBuildThisFileDirectory)test\coverlet.core.tests\coverlet.core.tests.csproj -c $(Configuration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover" />
</Target>
<Target Name="CreateNuGetPackage" AfterTargets="RunTests" Condition="$(Configuration) == 'Release'">
<Exec Command="dotnet pack $(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj -c $(Configuration) -o $(OutputPath) /p:NuspecFile=$(NuspecFile)" />
</Target>
</Project>