Skip to content

Commit

Permalink
update cake and paket
Browse files Browse the repository at this point in the history
pin .NetCore 3 to 3.0.100-preview4-010538
  • Loading branch information
punker76 committed Feb 27, 2019
1 parent d1b8ead commit d2e3223
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 126 deletions.
2 changes: 1 addition & 1 deletion .paket/paket-sha256.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
A664A299B0D62E48FD7E1DDADB2598B8589E60BD77A1B9A7060BC2DD2F920D08 paket.exe
FA7885DD3F2217BC4C6994B3F7DB4DBEADE051AB9E614A65BE0218C86F18B76A paket.exe
Binary file modified .paket/paket.bootstrapper.exe
Binary file not shown.
Binary file modified .paket/paket.exe
Binary file not shown.
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ branches:
- master

skip_tags: true
# image: Visual Studio 2017
image: Visual Studio 2019 Preview
configuration: Release
test: off
Expand All @@ -17,8 +16,8 @@ test: off
install:
#- ps: Start-FileDownload 'https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.exe'
#- ps: Start-Process .\dotnet-sdk-latest-win-x64.exe "/install /norestart /quiet /log sdkinstall.log" -NoNewWindow -Wait
- ps: Start-FileDownload 'https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.0.100-preview-010213/dotnet-sdk-3.0.100-preview-010213-win-x64.exe'
- ps: Start-Process .\dotnet-sdk-3.0.100-preview-010213-win-x64.exe "/install /norestart /quiet /log sdkinstall.log" -NoNewWindow -Wait
- ps: Start-FileDownload 'https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.0.100-preview4-010538/dotnet-sdk-3.0.100-preview4-010538-win-x64.exe'
- ps: Start-Process .\dotnet-sdk-3.0.100-preview4-010538-win-x64.exe "/install /norestart /quiet /log sdkinstall.log" -NoNewWindow -Wait

pull_requests:
do_not_increment_build_number: false
Expand Down
30 changes: 0 additions & 30 deletions azure-pipelines.yml

This file was deleted.

51 changes: 16 additions & 35 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,30 @@
#tool xunit.runner.console
#tool vswhere
#addin Cake.Figlet
#addin Cake.Paket

///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
if (string.IsNullOrWhiteSpace(target))
{
target = "Default";
}

var configuration = Argument("configuration", "Release");
if (string.IsNullOrWhiteSpace(configuration))
{
configuration = "Release";
}

var verbosity = Argument("verbosity", Verbosity.Normal);
if (string.IsNullOrWhiteSpace(configuration))
{
verbosity = Verbosity.Normal;
}
var verbosity = Argument("verbosity", Verbosity.Minimal);

///////////////////////////////////////////////////////////////////////////////
// PREPARATION
///////////////////////////////////////////////////////////////////////////////

var repoName = "MahApps.Metro";
var local = BuildSystem.IsLocalBuild;
var isLocal = BuildSystem.IsLocalBuild;

// Set build version
if (local == false
|| verbosity == Verbosity.Verbose)
if (isLocal == false || verbosity == Verbosity.Verbose)
{
GitVersion(new GitVersionSettings { OutputType = GitVersionOutput.BuildServer });
}
GitVersion gitVersion = GitVersion(new GitVersionSettings { OutputType = GitVersionOutput.Json });

var latestInstallationPath = VSWhereLatest(new VSWhereLatestSettings { IncludePrerelease = true });
//var msBuildPath = latestInstallationPath.CombineWithFilePath("./MSBuild/15.0/Bin/MSBuild.exe");
var msBuildPath = latestInstallationPath.Combine("./MSBuild/Current/Bin");
var msBuildPathExe = msBuildPath.CombineWithFilePath("./MSBuild.exe");

Expand Down Expand Up @@ -86,7 +69,7 @@ Setup(ctx =>
Information("AssemblySemVer Version: {0}", gitVersion.AssemblySemVer);
Information("MajorMinorPatch Version: {0}", gitVersion.MajorMinorPatch);
Information("NuGet Version: {0}", gitVersion.NuGetVersion);
Information("IsLocalBuild : {0}", local);
Information("IsLocalBuild : {0}", isLocal);
Information("Branch : {0}", branchName);
Information("Configuration : {0}", configuration);
Information("MSBuildPath : {0}", msBuildPath);
Expand All @@ -105,7 +88,9 @@ Task("Clean")
.ContinueOnError()
.Does(() =>
{
var directoriesToDelete = GetDirectories("./**/obj").Concat(GetDirectories("./**/bin")).Concat(GetDirectories("./**/Publish"));
var directoriesToDelete = GetDirectories("./**/obj")
.Concat(GetDirectories("./**/bin"))
.Concat(GetDirectories("./**/Publish"));
DeleteDirectories(directoriesToDelete, new DeleteDirectorySettings { Recursive = true, Force = true });
});

Expand All @@ -115,7 +100,6 @@ Task("Restore")
// var msBuildSettings = new MSBuildSettings {
// Verbosity = Verbosity.Minimal,
// ToolPath = msBuildPathExe,
// ToolVersion = MSBuildToolVersion.Default,
// Configuration = configuration,
// ArgumentCustomization = args => args.Append("/m")
// };
Expand All @@ -135,14 +119,12 @@ Task("Build")
.Does(() =>
{
var msBuildSettings = new MSBuildSettings {
Verbosity = Verbosity.Normal,
ToolPath = msBuildPathExe,
ToolVersion = MSBuildToolVersion.Default,
Configuration = configuration,
// Restore = true, // only with cake 0.28.x
ArgumentCustomization = args => args.Append("/m")
};

Verbosity = verbosity
, ToolPath = msBuildPathExe
, Configuration = configuration
, ArgumentCustomization = args => args.Append("/m")
, BinaryLogger = new MSBuildBinaryLogSettings() { Enabled = isLocal }
};
MSBuild(solution, msBuildSettings
.SetMaxCpuCount(0)
.WithProperty("Description", "A toolkit for creating Metro / Modern UI styled WPF apps.")
Expand All @@ -160,10 +142,9 @@ Task("Pack")
EnsureDirectoryExists(Directory(publishDir));

var msBuildSettings = new MSBuildSettings {
Verbosity = Verbosity.Normal,
ToolPath = msBuildPathExe,
ToolVersion = MSBuildToolVersion.Default,
Configuration = configuration
Verbosity = verbosity
, ToolPath = msBuildPathExe
, Configuration = configuration
};
var project = "./src/MahApps.Metro/MahApps.Metro.csproj";

Expand Down
110 changes: 60 additions & 50 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,48 @@ The build script target to run.
The build configuration to use.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.
.PARAMETER Experimental
Tells Cake to use the latest Roslyn release.
.PARAMETER WhatIf
Performs a dry run of the build script.
No tasks will be executed.
.PARAMETER Mono
Tells Cake to use the Mono scripting engine.
.PARAMETER ShowDescription
Shows description about tasks.
.PARAMETER DryRun
Performs a dry run.
.PARAMETER SkipToolPackageRestore
Skips restoring of packages.
.PARAMETER ScriptArgs
Remaining arguments are added here.
.LINK
http://cakebuild.net
https://cakebuild.net
#>

[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[string]$Target = "Default",
[ValidateSet("Release", "Debug")]
[string]$Configuration = "Release",
[string]$Target,
[string]$Configuration,
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Verbose",
[switch]$Experimental,
[Alias("DryRun","Noop")]
[switch]$WhatIf,
[switch]$Mono,
[string]$Verbosity,
[switch]$ShowDescription,
[Alias("WhatIf", "Noop")]
[switch]$DryRun,
[switch]$SkipToolPackageRestore,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)

# Setup the proxy
[System.Net.WebRequest]::DefaultWebProxy = [System.Net.WebRequest]::GetSystemWebProxy()
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
# Attempt to set highest encryption available for SecurityProtocol.
# PowerShell will not set this by default (until maybe .NET 4.6.x). This
# will typically produce a message for PowerShell v2 (just an info
# message though)
try {
# Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48)
# Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't
# exist in .NET 4.0, even though they are addressable if .NET 4.5+ is
# installed (.NET 4.5 is an in-place upgrade).
[System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48
} catch {
Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3'
}

[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
function MD5HashFile([string] $filePath)
Expand All @@ -84,15 +89,24 @@ function MD5HashFile([string] $filePath)
}
}

function GetProxyEnabledWebClient
{
$wc = New-Object System.Net.WebClient
$proxy = [System.Net.WebRequest]::GetSystemWebProxy()
$proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
$wc.Proxy = $proxy
return $wc
}

Write-Host "Preparing to run build script..."

if(!$PSScriptRoot){
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}

$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$ADDINS_DIR = Join-Path $TOOLS_DIR "addins"
$MODULES_DIR = Join-Path $TOOLS_DIR "modules"
$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins"
$MODULES_DIR = Join-Path $TOOLS_DIR "Modules"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
Expand All @@ -101,26 +115,6 @@ $PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config"
$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config"

# Should we use mono?
$UseMono = "";
if($Mono.IsPresent) {
Write-Verbose -Message "Using the Mono based scripting engine."
$UseMono = "-mono"
}

# Should we use the new Roslyn?
$UseExperimental = "";
if($Experimental.IsPresent -and !($Mono.IsPresent)) {
Write-Verbose -Message "Using experimental version of Roslyn."
$UseExperimental = "-experimental"
}

# Is this a dry run?
$UseDryRun = "";
if($WhatIf.IsPresent) {
$UseDryRun = "-dryrun"
}

# Make sure tools folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
Write-Verbose -Message "Creating tools directory..."
Expand All @@ -130,7 +124,10 @@ if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
# Make sure that packages.config exist.
if (!(Test-Path $PACKAGES_CONFIG)) {
Write-Verbose -Message "Downloading packages.config..."
try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
try {
$wc = GetProxyEnabledWebClient
$wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG)
} catch {
Throw "Could not download packages.config."
}
}
Expand All @@ -150,7 +147,8 @@ if (!(Test-Path $NUGET_EXE)) {
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Downloading NuGet.exe..."
try {
(New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
$wc = GetProxyEnabledWebClient
$wc.DownloadFile($NUGET_URL, $NUGET_EXE)
} catch {
Throw "Could not download NuGet.exe."
}
Expand All @@ -169,21 +167,22 @@ if(-Not $SkipToolPackageRestore.IsPresent) {
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
Write-Verbose -Message "Missing or changed package.config hash..."
Remove-Item * -Recurse -Exclude packages.config,nuget.exe
Get-ChildItem -Exclude packages.config,nuget.exe,Cake.Bakery |
Remove-Item -Recurse
}

Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""

if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet tools."
Throw "An error occurred while restoring NuGet tools."
}
else
{
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
}
Write-Verbose -Message ($NuGetOutput | out-string)

Pop-Location
}

Expand All @@ -196,7 +195,7 @@ if (Test-Path $ADDINS_PACKAGES_CONFIG) {
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`""

if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet addins."
Throw "An error occurred while restoring NuGet addins."
}

Write-Verbose -Message ($NuGetOutput | out-string)
Expand All @@ -213,7 +212,7 @@ if (Test-Path $MODULES_PACKAGES_CONFIG) {
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`""

if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet modules."
Throw "An error occurred while restoring NuGet modules."
}

Write-Verbose -Message ($NuGetOutput | out-string)
Expand All @@ -226,7 +225,18 @@ if (!(Test-Path $CAKE_EXE)) {
Throw "Could not find Cake.exe at $CAKE_EXE"
}



# Build Cake arguments
$cakeArguments = @("$Script");
if ($Target) { $cakeArguments += "-target=$Target" }
if ($Configuration) { $cakeArguments += "-configuration=$Configuration" }
if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" }
if ($ShowDescription) { $cakeArguments += "-showdescription" }
if ($DryRun) { $cakeArguments += "-dryrun" }
$cakeArguments += $ScriptArgs

# Start Cake
Write-Host "Running build script..."
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
exit $LASTEXITCODE
&$CAKE_EXE $cakeArguments
exit $LASTEXITCODE
15 changes: 15 additions & 0 deletions cake.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; This is the default configuration file for Cake.
; This file was downloaded from https://github.com/cake-build/resources

[Nuget]
Source=https://api.nuget.org/v3/index.json
UseInProcessClient=true
LoadDependencies=false

[Paths]
Tools=./tools
Addins=./tools/Addins
Modules=./tools/Modules

[Settings]
SkipVerification=false
Loading

0 comments on commit d2e3223

Please sign in to comment.