-
Notifications
You must be signed in to change notification settings - Fork 30
/
Directory.Build.targets
46 lines (41 loc) · 1.87 KB
/
Directory.Build.targets
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
40
41
42
43
44
45
46
<Project>
<PropertyGroup>
<PackageTags>$(PackageTags);.NET;Sylvan</PackageTags>
</PropertyGroup>
<Target Name="PrepareNupkg" BeforeTargets="ResolvePackageAssets">
<!-- the package folder must exist before nuget restore runs -->
<MakeDir Condition="!Exists($(PackageOutputPath))" Directories="$(PackageOutputPath)" />
</Target>
<PropertyGroup>
<ReportsDirectory>$(MSBuildThisFileDirectory)/reports</ReportsDirectory>
<CoverletOutput>$(ReportsDirectory)\$(MSBuildProjectName)\</CoverletOutput>
<CoverletOutputFormat>json,cobertura</CoverletOutputFormat>
</PropertyGroup>
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageReference Include="Coverlet.Collector" Version="1.3.0"/>
<PackageReference Include="Coverlet.MSBuild" Version="2.9.0"/>
<PackageReference Include="ReportGenerator" Version="4.5.0"/>
</ItemGroup>
<Target
Condition="$(VersionSuffix) == ''"
Name="PackValidations" BeforeTargets="GenerateNuspec">
<!--
Attempt to prevent myself from accidentally releaseing a debug build.
These are disabled for pre-release builds.
-->
<Error Condition="$(Configuration) != 'Release'" Text="Attempting to pack a debug build."/>
<Error Condition="$(SourceRevisionId.Contains('-dirty'))" Text="Attempting to pack from a dirty repository."/>
</Target>
<Target Name="InitializeSourceControlInformation" BeforeTargets="PackValidations">
<Exec
Command="git describe --long --always --dirty --exclude=*"
ConsoleToMsBuild="True"
IgnoreExitCode="False"
>
<Output PropertyName="SourceRevisionId" TaskParameter="ConsoleOutput"/>
</Exec>
</Target>
</Project>