-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathDirectory.Build.targets
20 lines (18 loc) · 1.48 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>
<Target Name="FailBuildIfReleaseVersionWrong" BeforeTargets="Pack" Condition=" $(ReleaseBuild) == 'true' and '$(IsPreview)' == 'false' ">
<Error Text="The supplied Version for packaging does not match what version has been used. Expected: '$(AspireMajorVersion).$(ToolkitMinorVersion).$(ToolkitPatchVersion)', received: '$(PackageVersion)'" Condition="'$(PackageVersion)' != '$(AspireMajorVersion).$(ToolkitMinorVersion).$(ToolkitPatchVersion)'" />
</Target>
<Target Name="FailBuildIfPreviewVersionWrong" BeforeTargets="Pack" Condition=" $(ReleaseBuild) == 'true' and '$(IsPreview)' == 'true' ">
<Error Text="The supplied Version for packaging does not match what version has been used. Expected: '$(AspireMajorVersion).$(ToolkitMinorVersion).$(ToolkitPatchVersion)-$(ToolkitPreviewVersion)', received: '$(PackageVersion)'" Condition="'$(PackageVersion)' != '$(AspireMajorVersion).$(ToolkitMinorVersion).$(ToolkitPatchVersion)-$(ToolkitPreviewVersion)'" />
</Target>
<Target Name="EnsurePreviewVersionSet" BeforeTargets="GenerateNuspec" Condition=" $(ReleaseBuild) == 'true' and '$(IsPreview)' == 'true' ">
<!--
Preview package suffixes
-->
<PropertyGroup>
<_VersionSuffix>$([System.DateTime]::Now.ToString(yyMMdd-HHmm))</_VersionSuffix>
<ToolkitPreviewVersion>$(ToolkitPreviewVersion).$(_VersionSuffix)</ToolkitPreviewVersion>
<PackageVersion>$(PackageVersion)-$(ToolkitPreviewVersion)</PackageVersion>
</PropertyGroup>
</Target>
</Project>