Skip to content

Commit 2946006

Browse files
committed
Merge branch 'develop'
2 parents 2352b10 + 9499106 commit 2946006

File tree

17 files changed

+2191
-1966
lines changed

17 files changed

+2191
-1966
lines changed

.psscripts/build-functions.ps1

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ function Test-IsWindows
1515
[environment]::OSVersion.Platform -ne "Unix"
1616
}
1717

18+
function Get-UbuntuVersion
19+
{
20+
<#
21+
.DESCRIPTION
22+
Gets the Ubuntu version.
23+
24+
.EXAMPLE
25+
$ubuntuVersion = Get-UbuntuVersion
26+
#>
27+
28+
$version = Invoke-Cmd "lsb_release -r -s"
29+
return $version
30+
}
31+
1832
function Invoke-UnsafeCmd ($cmd)
1933
{
2034
<#
@@ -235,7 +249,10 @@ function Get-NetCoreSdkFromWeb ($version)
235249
The SDK version which should be downloaded.
236250
#>
237251

238-
$os = if (Test-IsWindows) { "windows" } else { "linux" }
252+
Write-Host "Downloading .NET Core SDK $version..."
253+
254+
$os = if (Test-IsWindows) { "windows" } else { "linux" }
255+
$ext = if (Test-IsWindows) { ".zip" } else { ".tar.gz" }
239256

240257
$response = Invoke-WebRequest `
241258
-Uri "https://www.microsoft.com/net/download/thank-you/dotnet-sdk-$version-$os-x64-binaries" `
@@ -247,13 +264,17 @@ function Get-NetCoreSdkFromWeb ($version)
247264
| Where-Object { $_.onclick -eq "recordManualDownload()" } `
248265
| Select-Object -Expand href
249266

250-
$tempFile = [System.IO.Path]::GetTempFileName()
267+
$tempFile = [System.IO.Path]::GetTempFileName() + $ext
268+
251269
$webClient = New-Object System.Net.WebClient
252270
$webClient.DownloadFile($downloadLink, $tempFile)
271+
272+
Write-Host "Download finished. SDK has been saved to '$tempFile'."
273+
253274
return $tempFile
254275
}
255276

256-
function Install-NetCoreSdk ($sdkZipPath)
277+
function Install-NetCoreSdkFromArchive ($sdkArchivePath)
257278
{
258279
<#
259280
.DESCRIPTION
@@ -263,13 +284,35 @@ function Install-NetCoreSdk ($sdkZipPath)
263284
The zip archive which contains the .NET Core SDK.
264285
#>
265286

287+
if (Test-IsWindows)
288+
{
289+
$env:DOTNET_INSTALL_DIR = [System.IO.Path]::Combine($pwd, ".dotnetsdk")
290+
New-Item $env:DOTNET_INSTALL_DIR -ItemType Directory -Force | Out-Null
291+
Write-Host "Created folder '$env:DOTNET_INSTALL_DIR'."
292+
Expand-Archive -LiteralPath $sdkArchivePath -DestinationPath $env:DOTNET_INSTALL_DIR -Force
293+
Write-Host "Extracted '$sdkArchivePath' to folder '$env:DOTNET_INSTALL_DIR'."
294+
$env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
295+
Write-Host "Added '$env:DOTNET_INSTALL_DIR' to the environment variables."
296+
}
297+
else
298+
{
299+
$dotnetInstallDir = "$env:HOME/.dotnetsdk"
300+
Invoke-Cmd "mkdir -p $dotnetInstallDir"
301+
Write-Host "Created folder '$dotnetInstallDir'."
302+
Invoke-Cmd "tar -xf $sdkArchivePath -C $dotnetInstallDir"
303+
Write-Host "Extracted '$sdkArchivePath' to folder '$dotnetInstallDir'."
304+
$env:PATH = "$env:PATH:$dotnetInstallDir"
305+
Write-Host "Added '$dotnetInstallDir' to the environment variables."
306+
}
307+
}
266308

267-
$env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
268-
New-Item $env:DOTNET_INSTALL_DIR -ItemType Directory -Force
269-
270-
Add-Type -AssemblyName System.IO.Compression.FileSystem;
271-
[System.IO.Compression.ZipFile]::ExtractToDirectory($sdkZipPath, $env:DOTNET_INSTALL_DIR)
272-
$env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
309+
function Install-NetCoreSdkForUbuntu ($ubuntuVersion, $sdkVersion)
310+
{
311+
Invoke-Cmd "wget -q https://packages.microsoft.com/config/ubuntu/$ubuntuVersion/packages-microsoft-prod.deb"
312+
Invoke-Cmd "sudo dpkg -i packages-microsoft-prod.deb"
313+
Invoke-Cmd "sudo apt-get install apt-transport-https"
314+
Invoke-Cmd "sudo apt-get update"
315+
Invoke-Cmd "sudo apt-get -y install dotnet-sdk-$sdkVersion"
273316
}
274317

275318
# ----------------------------------------------
@@ -280,14 +323,11 @@ function Test-IsAppVeyorBuild { return ($env:APPVEYOR -eq $true
280323
function Test-IsAppVeyorBuildTriggeredByGitTag { return ($env:APPVEYOR_REPO_TAG -eq $true) }
281324
function Get-AppVeyorGitTag { return $env:APPVEYOR_REPO_TAG_NAME }
282325

283-
function Update-AppVeyorBuildVersion ($projFile)
326+
function Update-AppVeyorBuildVersion ($version)
284327
{
285328
if (Test-IsAppVeyorBuild)
286329
{
287330
Write-Host "Updating AppVeyor build version..." -ForegroundColor Magenta
288-
289-
[xml]$xml = Get-Content $projFile
290-
$version = $xml.Project.PropertyGroup.Version
291331
$buildVersion = "$version-$env:APPVEYOR_BUILD_NUMBER"
292332
Write-Host "Setting AppVeyor build version to $buildVersion."
293333
Update-AppveyorBuild -Version $buildVersion

.psscripts/install-dotnet.ps1

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,27 @@
22
# Install .NET Core SDK
33
# ----------------------------------------------
44

5+
param
6+
(
7+
[switch] $ForceUbuntuInstall
8+
)
9+
510
$ErrorActionPreference = "Stop"
611

712
Import-module "$PSScriptRoot\build-functions.ps1" -Force
813

14+
if ($ForceUbuntuInstall.IsPresent)
15+
{
16+
$desiredSdk = Get-DesiredSdk
17+
$versionParts = $desiredSdk.Split(".")
18+
$majorMinorVer = $versionParts[0] + "." + $versionParts[1]
19+
$ubuntuVersion = Get-UbuntuVersion
20+
21+
Write-Host "Ubuntu version: $ubuntuVersion"
22+
Install-NetCoreSdkForUbuntu $ubuntuVersion $majorMinorVer
23+
return
24+
}
25+
926
# Rename the global.json before making the dotnet --version call
1027
# This will prevent AppVeyor to fail because it might not find
1128
# the desired SDK specified in the global.json
@@ -27,10 +44,11 @@ if ($desiredSdk -eq $currentSdk)
2744
}
2845

2946
Write-Host "The current .NET SDK ($currentSdk) doesn't match the project's desired .NET SDK ($desiredSdk)." -ForegroundColor Yellow
47+
3048
Write-Host "Attempting to download and install the correct .NET SDK..."
3149

3250
$sdkZipPath = Get-NetCoreSdkFromWeb $desiredSdk
33-
Install-NetCoreSdk $sdkZipPath
51+
Install-NetCoreSdkFromArchive $sdkZipPath
3452

3553
Write-Host ".NET SDK installation complete." -ForegroundColor Green
3654
dotnet-version

.psscripts/nuget-updates.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Write-Host " Scanning all projects for NuGet package upgrades "
3636
Write-Host "--------------------------------------------------"
3737
Write-Host ""
3838

39-
$projects = Get-ChildItem "..\**\*.*proj" -Recurse | % { $_.FullName }
39+
$projects = Get-ChildItem "$PSScriptRoot\..\**\*.*proj" -Recurse | % { $_.FullName }
4040

4141
foreach ($project in $projects)
4242
{

RELEASE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Release Notes
22
=============
33

4+
## 0.19.0
5+
6+
- Updated Giraffe to version 3.2.x
7+
- Updated Giraffe.Razor to version 2.0.x
8+
- Added TaskBuilder.fs as dependency to all templates
9+
410
## 0.18.0
511

612
- Updated all templates to latest Giraffe version

build.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ Import-module "$PSScriptRoot/.psscripts/build-functions.ps1" -Force
2121
Write-BuildHeader "Starting giraffe-template build script"
2222

2323
$nuspec = "./src/giraffe-template.nuspec"
24+
$version = Get-NuspecVersion $nuspec
2425

25-
Update-AppVeyorBuildVersion $nuspec
26+
Update-AppVeyorBuildVersion $version
2627

2728
if (Test-IsAppVeyorBuildTriggeredByGitTag)
2829
{
2930
$gitTag = Get-AppVeyorGitTag
30-
$nuspecVersion = Get-NuspecVersion $nuspec
31-
Test-CompareVersions $nuspecVersion $gitTag
31+
Test-CompareVersions $version $gitTag
3232
}
3333

3434
Write-DotnetCoreVersions
@@ -91,7 +91,6 @@ if ($UpdatePaketDependencies.IsPresent -or $TestPermutations.IsPresent -or $Crea
9191
$giraffeInstallation
9292
if ($giraffeInstallation.Length -lt 6) { Invoke-Cmd "dotnet new -u giraffe-template" }
9393

94-
$version = Get-NuspecVersion $nuspec
9594
$nupkg = Get-ChildItem "./giraffe-template.$version.nupkg"
9695
$nupkgPath = $nupkg.FullName
9796

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": [ "src", "tests" ],
33
"sdk": {
4-
"version": "2.1.401"
4+
"version": "2.1.403"
55
}
66
}

0 commit comments

Comments
 (0)