Cleanup solution and build wip

This commit is contained in:
Stephan
2018-05-16 15:19:46 +02:00
parent fc56126820
commit 6bedc1020b
9 changed files with 69 additions and 78 deletions

View File

@@ -5,7 +5,7 @@
# . "$PSScriptRoot\build-bootstrap.ps1"
# THIS FILE IS DISTRIBUTED AS PART OF UMBRACO.BUILD
# DO NOT MODIFY IT - ALWAYS USED THE COMMON VERSION
# DO NOT MODIFY IT - ALWAYS USED THE COMMON VERSION
# ################################################################
# BOOTSTRAP
@@ -41,12 +41,28 @@
throw "Failed to locate NuGet.exe."
}
# NuGet notes
# As soon as we use -ConfigFile, NuGet uses that file, and only that file, and does not
# merge configuration from system level. See comments in NuGet.Client solution, class
# NuGet.Configuration.Settings, method LoadDefaultSettings.
# For NuGet to merge configurations, it needs to "find" the file in the current directory,
# or above. Which means we cannot really use -ConfigFile but instead have to have Umbraco's
# NuGet.config file at root, and always run NuGet.exe while at root or in a directory below
# root.
$solutionRoot = "$scriptRoot\.."
$testPwd = [System.IO.Path]::GetFullPath($pwd.Path) + "\"
$testRoot = [System.IO.Path]::GetFullPath($solutionRoot) + "\"
if (-not $testPwd.ToLower().StartsWith($testRoot.ToLower()))
{
throw "Cannot run outside of the solution's root."
}
# get the build system
if (-not $local)
{
$solutionRoot = "$scriptRoot\.."
$nugetConfig = @{$true="$solutionRoot\src\NuGet.config.user";$false="$solutionRoot\src\NuGet.config"}[(test-path "$solutionRoot\src\NuGet.config.user")]
&$nuget install Umbraco.Build -OutputDirectory $scriptTemp -Verbosity quiet -PreRelease -ConfigFile $nugetConfig
$params = "-OutputDirectory", $scriptTemp, "-Verbosity", "quiet", "-PreRelease"
&$nuget install Umbraco.Build @params
if (-not $?) { throw "Failed to download Umbraco.Build." }
}
@@ -63,7 +79,7 @@
# at that point the build.ps1 script must boot the build system
# eg
# $ubuild.Boot($ubuildPath.FullName, [System.IO.Path]::GetFullPath("$scriptRoot\.."),
# $ubuild.Boot($ubuildPath.FullName, [System.IO.Path]::GetFullPath("$scriptRoot\.."),
# @{ Local = $local; With7Zip = $false; WithNode = $false },
# @{ continue = $continue })
# if (-not $?) { throw "Failed to boot the build system." }
@@ -73,4 +89,4 @@
# Write-Host "Umbraco.Whatever Build"
# Write-Host "Umbraco.Build v$($ubuild.BuildVersion)"
# eof
# eof

View File

@@ -342,13 +342,13 @@
$this.TempStoreFile("$($this.SolutionRoot)\src\Umbraco.Web.UI\web.config")
Write-Host "Create clean web.config"
$this.CopyFile("$($this.SolutionRoot)\src\Umbraco.Web.UI\web.Template.config", "$($this.SolutionRoot)\src\Umbraco.Web.UI\web.config")
Write-host "Set environment"
$env:UMBRACO_VERSION=$this.Version.Semver.ToString()
$env:UMBRACO_RELEASE=$this.Version.Release
$env:UMBRACO_COMMENT=$this.Version.Comment
$env:UMBRACO_BUILD=$this.Version.Build
if ($args -and $args[0] -eq "vso")
{
Write-host "Set VSO environment"
@@ -378,7 +378,7 @@
{
Write-Host "Restore NuGet"
Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log"
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" -ConfigFile $this.BuildEnv.NuGetConfig > "$($this.BuildTemp)\nuget.restore.log"
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" > "$($this.BuildTemp)\nuget.restore.log"
if (-not $?) { throw "Failed to restore NuGet packages." }
})