Skip to content

Commit 6452779

Browse files
Allow for version comment in build script
1 parent 5bfeeb4 commit 6452779

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

build/Package.build.cmd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
SETLOCAL
33
:: SETLOCAL is on, so changes to the path not persist to the actual user's path
44

5-
REM Get the version and comment from Version.txt lines 2 and 3
6-
SET "release=1.0.0"
7-
SET "comment="
5+
SET "release=1.0.19"
6+
SET "comment=alpha"
87

98
REM If there's arguments on the command line use that as the version
109
IF [%1] NEQ [] (SET release=%1)
@@ -28,4 +27,4 @@ ECHO Restore NuGet packages
2827
SET msbuild="%programfiles(x86)%\MSBuild\14.0\Bin\MsBuild.exe"
2928

3029
ECHO Build the library and produce NuGet package
31-
%msbuild% Package.build.xml /p:ProductVersion=%version%
30+
%msbuild% Package.build.xml /p:ProductVersion=%release% /p:ProductComment=%comment%

build/Package.build.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@
4848
<BuildNuGetDir>$(MSBuildProjectDirectory)\_nuget</BuildNuGetDir>
4949
<CoreProjectDir>$(RootDir)\..\src\Umbraco.Deploy.Contrib.Connectors\</CoreProjectDir>
5050
<SolutionRootDir>$(RootDir)\..\src</SolutionRootDir>
51+
<FullVersion>$(ProductVersion)</FullVersion>
52+
<FullVersion Condition="'$(ProductComment)' != ''">$(ProductVersion)-$(ProductComment)</FullVersion>
5153
</PropertyGroup>
52-
54+
5355
<!-- TARGETS -->
5456

5557
<!-- CLEAN -->
@@ -99,7 +101,7 @@
99101
Title="$(NugetPackageName)"
100102
Description="$(Readme)"
101103
Summary="$(Summary)"
102-
Version="$(ProductVersion)"
104+
Version="$(FullVersion)"
103105
MinimumRequiredUmbracoVersion ="$(MinUmbracoVersion)"
104106
Authors="$(AuthorName)"
105107
Owners="$(Owners)"
@@ -119,15 +121,15 @@
119121
<MSBuild.NuGet.Tasks.Pack NuGetExePath="$(RootDir)\Tools\NuGet.exe"
120122
ManifestFile="$(BuildNuGetDir)\package.nuspec"
121123
BasePath="$(BuildNuGetDir)"
122-
Version="$(ProductVersion)"
124+
Version="$(FullVersion)"
123125
OutputDirectory="$(PackageDir)"
124126
Symbols="true" />
125127
</Target>
126128

127129
<Target Name="ZipPackage" DependsOnTargets="Package">
128130
<Message Text="Starting to zip the package" Importance="high" />
129-
<Exec Command="$(RootDir)\Tools\7za.exe a %22$(PackageDir)\$(PackageId).$(ProductVersion).zip%22 %22$(CoreProjectDir)\bin\$(BuildConfiguration)\Umbraco.Deploy.Contrib.Connectors.dll%22" />
130-
<Message Text="Finished zipping to Release\$(PackageId).$(ProductVersion).zip" Importance="high" />
131+
<Exec Command="$(RootDir)\Tools\7za.exe a %22$(PackageDir)\$(PackageId).$(FullVersion).zip%22 %22$(CoreProjectDir)\bin\$(BuildConfiguration)\Umbraco.Deploy.Contrib.Connectors.dll%22" />
132+
<Message Text="Finished zipping to Release\$(PackageId).$(FullVersion).zip" Importance="high" />
131133
</Target>
132134

133135
<Target Name="PostClean" DependsOnTargets="ZipPackage">

0 commit comments

Comments
 (0)