-
Notifications
You must be signed in to change notification settings - Fork 34
/
Directory.Build.targets
43 lines (38 loc) · 1.67 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
<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="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</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>