-
Notifications
You must be signed in to change notification settings - Fork 3
/
Directory.Build.targets
24 lines (22 loc) · 1.06 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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Powerwash">
<!-- Delete the bin directory -->
<RemoveDir Directories="$(MSBuildProjectDirectory)\$(BaseOutputPath)" />
<!-- Delete the obj directory -->
<RemoveDir Directories="$(MSBuildProjectDirectory)\$(BaseIntermediateOutputPath)" />
</Target>
<Target Name="VSTestIfTestProject">
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" />
</Target>
<Target Name="CalculateGitCommitCount" BeforeTargets="CoreCompile;GenerateNuspec">
<Exec Command="git rev-list --count HEAD" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitCount" />
</Exec>
<CreateProperty Value="$(VersionPrefix).$([MSBuild]::Subtract($(GitCommitCount), $(GitCommitCountOffset)))">
<!-- Used in the assembly version -->
<Output TaskParameter="Value" PropertyName="Version"/>
<!-- Used by NuGet -->
<Output TaskParameter="Value" PropertyName="PackageVersion"/>
</CreateProperty>
</Target>
</Project>