Skip to content

Commit f898104

Browse files
committed
Updating all the build scripts
1 parent b6891a1 commit f898104

File tree

8 files changed

+128
-119
lines changed

8 files changed

+128
-119
lines changed

appveyor.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
1-
os: Visual Studio 2017
2-
3-
# Version format
41
version: 2.0.0.{build}
52

3+
os: Visual Studio 2017
4+
65
cache:
76
- src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
87

9-
# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
10-
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta
11-
init:
12-
- set UMBRACO_PACKAGE_PRERELEASE_SUFFIX=alpha3
8+
configuration: Release
9+
10+
environment:
11+
# Version Suffix
12+
version_suffix: alpha3
1313

1414
install:
15+
- ps: .\build\appveyor-semver.ps1
16+
- ps: .\build\check-release-version.ps1
17+
- ps: Update-AppveyorBuild -Version $Env:appveyor_version
1518
- ps: >-
1619
$msiPath = "$($env:USERPROFILE)\MicrosoftAzureStorageEmulator.msi"
1720
1821
(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/F/3/8/F3857A38-D344-43B4-8E5B-2D03489909B9/MicrosoftAzureStorageEmulator.msi', $msiPath)
1922
2023
cmd /c start /wait msiexec /i $msiPath /quiet
2124
25+
assembly_info:
26+
patch: true
27+
file: 'src\UmbracoFileSystemProviders.Azure**\AssemblyInfo.*'
28+
assembly_version: '$(appveyor_file_version)'
29+
assembly_file_version: '$(appveyor_file_version)'
30+
assembly_informational_version: '$(mssemver)'
31+
2232
build_script:
23-
- build-appveyor.cmd
33+
- cmd: >-
34+
build-appveyor.cmd
35+
36+
cd..
2437
2538
before_test:
2639
- cmd: '"%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start'

build-appveyor.cmd

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ ECHO APPVEYOR_REPO_BRANCH: %APPVEYOR_REPO_BRANCH%
22
ECHO APPVEYOR_REPO_TAG: %APPVEYOR_REPO_TAG%
33
ECHO APPVEYOR_BUILD_NUMBER : %APPVEYOR_BUILD_NUMBER%
44
ECHO APPVEYOR_BUILD_VERSION : %APPVEYOR_BUILD_VERSION%
5+
ECHO CONFIGURATION : %CONFIGURATION%
56

67
CALL NuGet.exe restore src\UmbracoFileSystemProviders.Azure.sln
78

@@ -14,24 +15,28 @@ IF NOT EXIST "%toolsFolder%" (
1415

1516
IF NOT EXIST "%toolsFolder%vswhere.exe" (
1617
ECHO vswhere not found - fetching now
17-
tools\nuget.exe install vswhere -Version 2.5.9 -Source nuget.org -OutputDirectory tools
18+
nuget install vswhere -Version 2.6.7 -Source nuget.org -OutputDirectory tools
1819
)
1920

2021
FOR /f "delims=" %%A in ('dir "%toolsFolder%vswhere.*" /b') DO SET "vswhereExePath=%toolsFolder%%%A\"
2122
MOVE "%vswhereExePath%tools\vswhere.exe" "%toolsFolder%vswhere.exe"
2223

23-
for /f "usebackq tokens=1* delims=: " %%i in (`"%CD%\tools\vswhere.exe" -latest -requires Microsoft.Component.MSBuild`) do (
24-
if /i "%%i"=="installationPath" set InstallDir=%%j
25-
)
24+
SETLOCAL EnableDelayedExpansion
25+
26+
:: This string specifies vs 2019
27+
:: set vswherestr=^"!%CD%\tools\vswhere.exe^" -version [16.0,17.0^^) -latest -prerelease -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
2628

27-
SET VSWherePath="%InstallDir%\MSBuild"
29+
set vswherestr=^"!%CD%\tools\vswhere.exe^" -latest -prerelease -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
30+
for /f "usebackq tokens=*" %%i in (`!vswherestr!`) do (
31+
set MsBuildDir=%%i
32+
)
2833

2934
ECHO.
30-
ECHO Visual Studio is installed in: %InstallDir%
35+
ECHO MsBuild is installed in: %MsBuildDir%
3136

32-
CALL "%InstallDir%\MSBuild\15.0\Bin\amd64\MsBuild.exe" package.proj %~1
37+
CALL "%MsBuildDir%" package.proj %~1
3338

3439
@IF %ERRORLEVEL% NEQ 0 GOTO err
3540
@EXIT /B 0
3641
:err
37-
@EXIT /B 1
42+
@EXIT /B 1

build.cmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ECHO off
22

33
SET /P APPVEYOR_BUILD_NUMBER=Please enter a build number (e.g. 134):
44
SET /P PACKAGE_VERISON=Please enter your package version (e.g. 1.0.5):
5-
SET /P UMBRACO_PACKAGE_PRERELEASE_SUFFIX=Please enter your package release suffix or leave empty (e.g. beta):
5+
SET /P version_suffix=Please enter your package release suffix or leave empty (e.g. beta):
66

77
SET /P APPVEYOR_REPO_TAG=If you want to simulate a GitHub tag for a release (e.g. true):
88

@@ -13,7 +13,9 @@ if "%PACKAGE_VERISON%" == "" (
1313
SET PACKAGE_VERISON=0.1.0
1414
)
1515

16-
SET APPVEYOR_BUILD_VERSION=%PACKAGE_VERISON%.%APPVEYOR_BUILD_NUMBER%
16+
SET mssemver=%PACKAGE_VERISON%-beta-%APPVEYOR_BUILD_NUMBER%
17+
18+
SET CONFIGURATION=Debug
1719

1820
build-appveyor.cmd
1921

build/UmbracoFileSystemProviders.Azure.proj

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
1313
<Import Project="$(MSBuildUmbracoTasksPath)\MSBuild.Umbraco.Tasks.Targets" />
1414
<Import Project="$(MSBuildNugetTasksPath)\MSBuild.NuGet.Tasks.Targets" />
15-
<Import Project="$(AppVeyorUmbracoPath)\AppVeyorUmbraco.Targets" />
1615

1716
<!-- SHARED PROPERTIES -->
1817
<PropertyGroup>
@@ -40,37 +39,12 @@
4039

4140
<!-- APPVEYOR PROPERTIES -->
4241
<PropertyGroup>
43-
<FileVersion>$(APPVEYOR_BUILD_VERSION)</FileVersion>
42+
<FileVersion>$(mssemver)</FileVersion>
4443
</PropertyGroup>
45-
<Choose>
46-
<When Condition="$(APPVEYOR_BUILD_NUMBER) != '' And $(APPVEYOR_REPO_TAG) != 'true' ">
47-
<PropertyGroup>
48-
<Release>false</Release>
49-
</PropertyGroup>
50-
</When>
51-
<Otherwise>
52-
<PropertyGroup>
53-
<Release>true</Release>
54-
</PropertyGroup>
55-
</Otherwise>
56-
</Choose>
57-
58-
<Choose>
59-
<When Condition="$(Release) == 'false' And $(UMBRACO_PACKAGE_PRERELEASE_SUFFIX) == 'rtm'">
60-
<PropertyGroup>
61-
<AbortBuild>true</AbortBuild>
62-
</PropertyGroup>
63-
</When>
64-
<Otherwise>
65-
<PropertyGroup>
66-
<AbortBuild>false</AbortBuild>
67-
</PropertyGroup>
68-
</Otherwise>
69-
</Choose>
70-
44+
7145
<!-- PATHS -->
7246
<PropertyGroup>
73-
<BuildConfig>Release</BuildConfig>
47+
<BuildConfig>$(CONFIGURATION)</BuildConfig>
7448
<RootDir>$(MSBuildProjectDirectory)\..</RootDir>
7549
<BuildDir>$(MSBuildProjectDirectory)\_core</BuildDir>
7650
<BuildUmbDir>$(BuildDir)\_umbraco</BuildUmbDir>
@@ -81,16 +55,8 @@
8155
<TestsProjectDir>$(RootDir)\src\UmbracoFileSystemProviders.Azure.Tests</TestsProjectDir>
8256
</PropertyGroup>
8357

84-
<!-- TARGETS -->
85-
<Target Name="GetProductVersion">
86-
<Error Condition="$(AbortBuild) == 'true'" Text="Aborting the build as the UMBRACO_PACKAGE_PRERELEASE_SUFFIX suffix is set 'rtm' but APPVEYOR_REPO_TAG is not 'true'" />
87-
<GetProductVersion BuildVersion="$(APPVEYOR_BUILD_VERSION)" BuildSuffix="$(UMBRACO_PACKAGE_PRERELEASE_SUFFIX)" Release="$(Release)">
88-
<Output TaskParameter="ProductVersion" PropertyName="ProductVersion"/>
89-
</GetProductVersion>
90-
</Target>
91-
9258
<!-- CLEAN -->
93-
<Target Name="Clean" DependsOnTargets="GetProductVersion">
59+
<Target Name="Clean">
9460
<RemoveDir Directories="$(BuildDir)" Condition="Exists('$(BuildDir)')" />
9561
<RemoveDir Directories="$(ArtifactsDir)" Condition="Exists('$(ArtifactsDir)')" />
9662
<MakeDir Directories="$(BuildDir)" />
@@ -99,19 +65,8 @@
9965
<MakeDir Directories="$(ArtifactsDir)" />
10066
</Target>
10167

102-
<!-- UPDATE PROJECT ASSEMBLEY VERSION -->
103-
<Target Name="UpdateAssemblyInfo" DependsOnTargets="Clean">
104-
<FileUpdate Encoding="ASCII" Files="$(ProjectDir)\Properties\VersionInfo.cs" Regex="AssemblyVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyVersion(&quot;$(FileVersion)&quot;)]" />
105-
<FileUpdate Encoding="ASCII" Files="$(ProjectDir)\Properties\VersionInfo.cs" Regex="AssemblyFileVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyFileVersion(&quot;$(FileVersion)&quot;)]" />
106-
<FileUpdate Encoding="ASCII" Files="$(ProjectDir)\Properties\VersionInfo.cs" Regex="AssemblyInformationalVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyInformationalVersion(&quot;$(ProductVersion)&quot;)]" />
107-
108-
<FileUpdate Encoding="ASCII" Files="$(InstallerProjectDir)\Properties\VersionInfo.cs" Regex="AssemblyVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyVersion(&quot;$(FileVersion)&quot;)]" />
109-
<FileUpdate Encoding="ASCII" Files="$(InstallerProjectDir)\Properties\VersionInfo.cs" Regex="AssemblyFileVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyFileVersion(&quot;$(FileVersion)&quot;)]" />
110-
<FileUpdate Encoding="ASCII" Files="$(InstallerProjectDir)\Properties\VersionInfo.cs" Regex="AssemblyInformationalVersion\(&quot;.*&quot;\)\]" ReplacementText="AssemblyInformationalVersion(&quot;$(ProductVersion)&quot;)]" />
111-
</Target>
112-
11368
<!-- COMPILE -->
114-
<Target Name="Compile" DependsOnTargets="UpdateAssemblyInfo">
69+
<Target Name="Compile" DependsOnTargets="Clean">
11570
<MSBuild Projects="$(ProjectDir)\UmbracoFileSystemProviders.Azure.csproj" Properties="Configuration=$(BuildConfig)" />
11671
<MSBuild Projects="$(TestsProjectDir)\UmbracoFileSystemProviders.Azure.Tests.csproj" Properties="Configuration=$(BuildConfig)" />
11772
<MSBuild Projects="$(InstallerProjectDir)\UmbracoFileSystemProviders.Azure.Installer.csproj" Properties="Configuration=$(BuildConfig)" />

build/appveyor-semver.ps1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$version=[Version]$Env:APPVEYOR_BUILD_VERSION
2+
$version_suffix=$Env:version_suffix
3+
4+
$basever=$version.Major.ToString() + "." + $version.Minor.ToString() + "." + $version.Build.ToString()
5+
6+
$paddedRevision = $version.Revision.ToString().PadLeft(6,"0")
7+
8+
$semver = $basever + "-" + $version_suffix + "." + $version.Revision.ToString()
9+
$mssemver = $basever + "-" + $version_suffix + "-" + $paddedRevision
10+
$appveyor_version = $mssemver
11+
12+
$Env:semver = $semver
13+
$Env:mssemver = $mssemver
14+
$Env:appveyor_version = $appveyor_version
15+
16+
$Env:appveyor_file_version = $Env:APPVEYOR_BUILD_VERSION
17+
18+
$Env:ms_file_version = $version.ToString()
19+
$Env:padded_build_revision = $paddedRevision
20+
21+
"Envrionment variable 'semver' set:" + $Env:semver
22+
"Envrionment variable 'mssemver' set:" + $Env:mssemver
23+
"Envrionment variable 'appveyor_version' set:" + $Env:appveyor_version
24+
"Envrionment variable 'padded_build_revision' set:" + $Env:padded_build_revision

build/check-release-version.ps1

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
$tagged=$Env:APPVEYOR_REPO_TAG
2+
$tag_name=$Env:APPVEYOR_REPO_TAG_NAME
3+
$version=[Version]$Env:APPVEYOR_BUILD_VERSION
4+
$branch=$Env:APPVEYOR_REPO_BRANCH
5+
6+
$Env:tagged_release_build = "false"
7+
8+
#$tagged="true"
9+
#$tag_name="v2.1.2-beta"
10+
#$version=[Version]"2.1.2.12"
11+
12+
$has_suffix = "false"
13+
$suffix = ""
14+
15+
"APPVEYOR_REPO_TAG:" + $tagged
16+
"APPVEYOR_REPO_TAG_NAME:" + $tag_name
17+
18+
If ($tagged -eq "true" -and $tag_name.StartsWith("v")){
19+
20+
# This is to cut out the beta etc
21+
if ($tag_name.Contains("-")){
22+
$has_suffix = "true"
23+
$index = $tag_name.indexof("-");
24+
$suffix = $tag_name.Substring($index + 1, $tag_name.Length - ($index + 1))
25+
$tag_name = $tag_name.Substring(0, $index)
26+
}
27+
28+
$tagged_version=[Version]$tag_name.Substring(1)
29+
30+
if ($tagged_version.Major -eq $version.Major -and $tagged_version.Minor -eq $version.Minor -and $tagged_version.Build -eq $version.Build){
31+
"** THIS IS A TAGGED RELEASE BUILD:" + $tagged_version.ToString() + " **"
32+
33+
$Env:tagged_release_build = "true"
34+
35+
$basever=$tagged_version.Major.ToString() + "." + $tagged_version.Minor.ToString() + "." + $tagged_version.Build.ToString()
36+
37+
if ($has_suffix -eq "true"){
38+
$Env:version_suffix = $suffix
39+
40+
$Env:mssemver = $basever + "-" + $suffix
41+
$Env:appveyor_version = $basever + "-" + $suffix
42+
$Env:semver = $basever + "-" + $suffix
43+
} Else {
44+
$Env:mssemver = $basever
45+
$Env:appveyor_version = $basever
46+
$Env:semver = $basever
47+
}
48+
49+
"Envrionment variable 'semver' set:" + $Env:semver
50+
"Envrionment variable 'mssemver' set:" + $Env:mssemver
51+
"Envrionment variable 'appveyor_version' set:" + $Env:appveyor_version
52+
}Else{
53+
"** Naughty, naughty, very naughty, tagged version: " + $tagged_version.ToString() + " doesn't match build version:" + $version.ToString() + " **"
54+
"** If this was intentional you should manually bump the version in appveyor.yml **"
55+
$host.SetShouldExit(1)
56+
}
57+
}

build/tools/AppVeyorUmbraco/AppVeyorUmbraco.Targets

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/UmbracoFileSystemProviders.Azure.sln

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27004.2008
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29001.49
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UmbracoFileSystemProviders.Azure", "UmbracoFileSystemProviders.Azure\UmbracoFileSystemProviders.Azure.csproj", "{749BC432-144A-4250-9066-D1FE170AFE42}"
77
EndProject
@@ -14,9 +14,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1414
EndProject
1515
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildPackage", "BuildPackage", "{DDE4D2E6-E526-4CB3-BECE-D89DFFB37B10}"
1616
ProjectSection(SolutionItems) = preProject
17+
..\build\appveyor-semver.ps1 = ..\build\appveyor-semver.ps1
1718
..\appveyor.yml = ..\appveyor.yml
1819
..\build-appveyor.cmd = ..\build-appveyor.cmd
1920
..\build.cmd = ..\build.cmd
21+
..\build\check-release-version.ps1 = ..\build\check-release-version.ps1
2022
..\build\transforms\media-web.config.install.xdt = ..\build\transforms\media-web.config.install.xdt
2123
..\build\transforms\media-web.config.uninstall.xdt = ..\build\transforms\media-web.config.uninstall.xdt
2224
..\build\package.nuspec = ..\build\package.nuspec

0 commit comments

Comments
 (0)