-
Notifications
You must be signed in to change notification settings - Fork 68
/
Directory.Build.targets
20 lines (20 loc) · 1.15 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<Project ToolsVersion="15.0">
<!--Workaround for https://github.com/Microsoft/vstest/issues/1129 from https://dasmulli.blog/2018/01/20/make-dotnet-test-work-on-solution-files/-->
<Target Name="VSTestIfTestProject">
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" />
</Target>
<Target Name="ComputePackageVersion" AfterTargets="MinVer" Condition=" '$(BUILD_PR)' != '' AND '$(BUILD_PR)' != '%24(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)' ">
<PropertyGroup>
<PackageVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)-pr.$(BUILD_PR)</PackageVersion>
<PackageVersion Condition="'$(MinVerPreRelease)' != ''">$(PackageVersion).$(MinVerPreRelease)</PackageVersion>
<PackageVersion Condition="'$(MinVerBuildMetadata)' != ''">$(PackageVersion)+$(MinVerBuildMetadata)</PackageVersion>
<Version>$(PackageVersion)</Version>
</PropertyGroup>
</Target>
<Target Name="ComputeFileVersion" AfterTargets="MinVer">
<PropertyGroup>
<BUILD_ID Condition="'$(BUILD_ID)' == ''">0</BUILD_ID>
<FileVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BUILD_ID)</FileVersion>
</PropertyGroup>
</Target>
</Project>