Skip to content

Commit 5aa29cc

Browse files
Adds version comment to UmbracoVersion.txt and makes it possible to overrule by adding arguments to build.bat
1 parent 9be3bdb commit 5aa29cc

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

build/Build.bat

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
IF NOT EXIST UmbracoVersion.txt (
33
ECHO UmbracoVersion.txt missing!
44
GOTO :showerror
5-
)
6-
SET /p release=<UmbracoVersion.txt
7-
SET comment=
5+
)
6+
7+
REM Get the version and comment from UmbracoVersion.txt lines 2 and 3
8+
SET "release="
9+
SET "comment="
10+
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i"
11+
FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i"
12+
13+
REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version
14+
IF [%1] NEQ [] (SET release=%1)
15+
IF [%2] NEQ [] (SET comment=%2) ELSE (SET "comment=")
16+
817
SET version=%release%
918

1019
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
@@ -33,21 +42,22 @@ ECHO Performing MSBuild and producing Umbraco binaries zip files
3342
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%
3443

3544
ECHO Adding dummy files to include in the NuGet package so that empty folders actually get created
36-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Code\dummy.txt
37-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Data\dummy.txt
38-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Plugins\dummy.txt
39-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\css\dummy.txt
40-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\masterpages\dummy.txt
41-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\media\dummy.txt
42-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\scripts\dummy.txt
43-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\usercontrols\dummy.txt
44-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\Views\Partials\dummy.txt
45-
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\Views\MacroPartials\dummy.txt
45+
SET dummytext=This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete.
46+
ECHO %dummytext% > .\_BuildOutput\WebApp\App_Code\dummy.txt
47+
ECHO %dummytext% > .\_BuildOutput\WebApp\App_Data\dummy.txt
48+
ECHO %dummytext% > .\_BuildOutput\WebApp\App_Plugins\dummy.txt
49+
ECHO %dummytext% > .\_BuildOutput\WebApp\css\dummy.txt
50+
ECHO %dummytext% > .\_BuildOutput\WebApp\masterpages\dummy.txt
51+
ECHO %dummytext% > .\_BuildOutput\WebApp\media\dummy.txt
52+
ECHO %dummytext% > .\_BuildOutput\WebApp\scripts\dummy.txt
53+
ECHO %dummytext% > .\_BuildOutput\WebApp\usercontrols\dummy.txt
54+
ECHO %dummytext% > .\_BuildOutput\WebApp\Views\Partials\dummy.txt
55+
ECHO %dummytext% > .\_BuildOutput\WebApp\Views\MacroPartials\dummy.txt
4656

4757
ECHO Adding Web.config transform files to the NuGet package
48-
ren .\_BuildOutput\WebApp\MacroScripts\Web.config Web.config.transform
49-
ren .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
50-
ren .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform
58+
REN .\_BuildOutput\WebApp\MacroScripts\Web.config Web.config.transform
59+
REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
60+
REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform
5161

5262
ECHO Packing the NuGet release files
5363
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%

build/UmbracoVersion.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
12
7.1.9

0 commit comments

Comments
 (0)