Switch to .NET Tool version of Cake (#1793)
This commit is contained in:
Родитель
e6fe745390
Коммит
2e08f1b404
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"cake.tool": {
|
||||
"version": "1.2.0",
|
||||
"commands": [
|
||||
"dotnet-cake"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
258
bootstrapper.ps1
258
bootstrapper.ps1
|
@ -1,256 +1,4 @@
|
|||
##########################################################################
|
||||
# This is the Cake bootstrapper script for PowerShell.
|
||||
# This file was downloaded from https://github.com/cake-build/resources
|
||||
# Feel free to change this file to fit your needs.
|
||||
##########################################################################
|
||||
dotnet tool restore
|
||||
dotnet cake $args
|
||||
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
This is a Powershell script to bootstrap a Cake build.
|
||||
|
||||
.DESCRIPTION
|
||||
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
|
||||
and execute your Cake build script with the parameters you provide.
|
||||
|
||||
.PARAMETER Script
|
||||
The build script to execute.
|
||||
.PARAMETER Target
|
||||
The build script target to run.
|
||||
.PARAMETER Configuration
|
||||
The build configuration to use.
|
||||
.PARAMETER Verbosity
|
||||
Specifies the amount of information to be displayed.
|
||||
.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
|
||||
https://cakebuild.net
|
||||
|
||||
#>
|
||||
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[string]$Script = "build.cake",
|
||||
[string]$Target,
|
||||
[string]$Configuration,
|
||||
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
|
||||
[string]$Verbosity,
|
||||
[switch]$ShowDescription,
|
||||
[Alias("WhatIf", "Noop")]
|
||||
[switch]$DryRun,
|
||||
[switch]$SkipToolPackageRestore,
|
||||
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
|
||||
[string[]]$ScriptArgs
|
||||
)
|
||||
|
||||
# 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).
|
||||
# PowerShell Core already has support for TLS 1.2 so we can skip this if running in that.
|
||||
if (-not $IsCoreCLR) {
|
||||
[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)
|
||||
{
|
||||
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
|
||||
{
|
||||
return $null
|
||||
}
|
||||
|
||||
[System.IO.Stream] $file = $null;
|
||||
[System.Security.Cryptography.MD5] $md5 = $null;
|
||||
try
|
||||
{
|
||||
$md5 = [System.Security.Cryptography.MD5]::Create()
|
||||
$file = [System.IO.File]::OpenRead($filePath)
|
||||
return [System.BitConverter]::ToString($md5.ComputeHash($file))
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ($file -ne $null)
|
||||
{
|
||||
$file.Dispose()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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"
|
||||
$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"
|
||||
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
|
||||
$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"
|
||||
|
||||
# Make sure tools folder exists
|
||||
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
|
||||
Write-Verbose -Message "Creating tools directory..."
|
||||
New-Item -Path $TOOLS_DIR -Type Directory | Out-Null
|
||||
}
|
||||
|
||||
# Make sure that packages.config exist.
|
||||
if (!(Test-Path $PACKAGES_CONFIG)) {
|
||||
Write-Verbose -Message "Downloading packages.config..."
|
||||
try {
|
||||
$wc = GetProxyEnabledWebClient
|
||||
$wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG)
|
||||
} catch {
|
||||
Throw "Could not download packages.config."
|
||||
}
|
||||
}
|
||||
|
||||
# Try find NuGet.exe in path if not exists
|
||||
if (!(Test-Path $NUGET_EXE)) {
|
||||
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
|
||||
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) }
|
||||
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
|
||||
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
|
||||
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
|
||||
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
|
||||
}
|
||||
}
|
||||
|
||||
# Try download NuGet.exe if not exists
|
||||
if (!(Test-Path $NUGET_EXE)) {
|
||||
Write-Verbose -Message "Downloading NuGet.exe..."
|
||||
try {
|
||||
$wc = GetProxyEnabledWebClient
|
||||
$wc.DownloadFile($NUGET_URL, $NUGET_EXE)
|
||||
} catch {
|
||||
Throw "Could not download NuGet.exe."
|
||||
}
|
||||
}
|
||||
|
||||
# Save nuget.exe path to environment to be available to child processed
|
||||
$env:NUGET_EXE = $NUGET_EXE
|
||||
$env:NUGET_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) {
|
||||
"mono `"$NUGET_EXE`""
|
||||
} else {
|
||||
"`"$NUGET_EXE`""
|
||||
}
|
||||
|
||||
# Restore tools from NuGet?
|
||||
if(-Not $SkipToolPackageRestore.IsPresent) {
|
||||
Push-Location
|
||||
Set-Location $TOOLS_DIR
|
||||
|
||||
# Check for changes in packages.config and remove installed tools if true.
|
||||
[string] $md5Hash = MD5HashFile $PACKAGES_CONFIG
|
||||
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
|
||||
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
|
||||
Write-Verbose -Message "Missing or changed package.config hash..."
|
||||
Get-ChildItem -Exclude packages.config,nuget.exe,Cake.Bakery |
|
||||
Remove-Item -Recurse -Force
|
||||
}
|
||||
|
||||
Write-Verbose -Message "Restoring tools from NuGet..."
|
||||
|
||||
$NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
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
|
||||
}
|
||||
|
||||
# Restore addins from NuGet
|
||||
if (Test-Path $ADDINS_PACKAGES_CONFIG) {
|
||||
Push-Location
|
||||
Set-Location $ADDINS_DIR
|
||||
|
||||
Write-Verbose -Message "Restoring addins from NuGet..."
|
||||
$NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`""
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Throw "An error occurred while restoring NuGet addins."
|
||||
}
|
||||
|
||||
Write-Verbose -Message ($NuGetOutput | Out-String)
|
||||
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
# Restore modules from NuGet
|
||||
if (Test-Path $MODULES_PACKAGES_CONFIG) {
|
||||
Push-Location
|
||||
Set-Location $MODULES_DIR
|
||||
|
||||
Write-Verbose -Message "Restoring modules from NuGet..."
|
||||
$NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`""
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Throw "An error occurred while restoring NuGet modules."
|
||||
}
|
||||
|
||||
Write-Verbose -Message ($NuGetOutput | Out-String)
|
||||
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
# Make sure that Cake has been installed.
|
||||
if (!(Test-Path $CAKE_EXE)) {
|
||||
Throw "Could not find Cake.exe at $CAKE_EXE"
|
||||
}
|
||||
|
||||
$CAKE_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) {
|
||||
"mono `"$CAKE_EXE`""
|
||||
} else {
|
||||
"`"$CAKE_EXE`""
|
||||
}
|
||||
|
||||
|
||||
# Build Cake arguments
|
||||
$cakeArguments = @("$Script", "--settings_skipverification=true");
|
||||
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_INVOCATION $($cakeArguments -join " ")"
|
||||
exit $LASTEXITCODE
|
||||
exit $LASTEXITCODE
|
||||
|
|
126
bootstrapper.sh
126
bootstrapper.sh
|
@ -1,125 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
##########################################################################
|
||||
# This is the Cake bootstrapper script for Linux and OS X.
|
||||
# This file was downloaded from https://github.com/cake-build/resources
|
||||
# Feel free to change this file to fit your needs.
|
||||
##########################################################################
|
||||
|
||||
# Define directories.
|
||||
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
TOOLS_DIR=$SCRIPT_DIR/tools
|
||||
ADDINS_DIR=$TOOLS_DIR/Addins
|
||||
MODULES_DIR=$TOOLS_DIR/Modules
|
||||
NUGET_EXE=$TOOLS_DIR/nuget.exe
|
||||
CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe
|
||||
PACKAGES_CONFIG=$TOOLS_DIR/packages.config
|
||||
PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum
|
||||
ADDINS_PACKAGES_CONFIG=$ADDINS_DIR/packages.config
|
||||
MODULES_PACKAGES_CONFIG=$MODULES_DIR/packages.config
|
||||
|
||||
# Define md5sum or md5 depending on Linux/OSX
|
||||
MD5_EXE=
|
||||
if [[ "$(uname -s)" == "Darwin" ]]; then
|
||||
MD5_EXE="md5 -r"
|
||||
else
|
||||
MD5_EXE="md5sum"
|
||||
fi
|
||||
|
||||
# Define default arguments.
|
||||
SCRIPT="build.cake"
|
||||
TARGET="Default"
|
||||
CONFIGURATION="Release"
|
||||
VERBOSITY="normal"
|
||||
DRYRUN=
|
||||
CAKE_ARGUMENTS=()
|
||||
|
||||
# Parse arguments.
|
||||
for i in "$@"; do
|
||||
case $1 in
|
||||
-s|--script) SCRIPT="$2"; shift ;;
|
||||
-t|--target) TARGET="$2"; shift ;;
|
||||
-c|--configuration) CONFIGURATION="$2"; shift ;;
|
||||
-v|--verbosity) VERBOSITY="$2"; shift ;;
|
||||
-d|--dryrun) DRYRUN="-dryrun" ;;
|
||||
--) shift; CAKE_ARGUMENTS+=("$@"); break ;;
|
||||
*) CAKE_ARGUMENTS+=("$1") ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Make sure the tools folder exist.
|
||||
if [ ! -d "$TOOLS_DIR" ]; then
|
||||
mkdir "$TOOLS_DIR"
|
||||
fi
|
||||
|
||||
# Make sure that packages.config exist.
|
||||
if [ ! -f "$TOOLS_DIR/packages.config" ]; then
|
||||
echo "Downloading packages.config..."
|
||||
curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "An error occurred while downloading packages.config."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Download NuGet if it does not exist.
|
||||
if [ ! -f "$NUGET_EXE" ]; then
|
||||
echo "Downloading NuGet..."
|
||||
curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "An error occurred while downloading nuget.exe."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Restore tools from NuGet.
|
||||
pushd "$TOOLS_DIR" >/dev/null
|
||||
if [ ! -f "$PACKAGES_CONFIG_MD5" ] || [ "$( cat "$PACKAGES_CONFIG_MD5" | sed 's/\r$//' )" != "$( $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' )" ]; then
|
||||
find . -type d ! -name . ! -name 'Cake.Bakery' | xargs rm -rf
|
||||
fi
|
||||
|
||||
mono "$NUGET_EXE" install -ExcludeVersion
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Could not restore NuGet tools."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5"
|
||||
|
||||
popd >/dev/null
|
||||
|
||||
# Restore addins from NuGet.
|
||||
if [ -f "$ADDINS_PACKAGES_CONFIG" ]; then
|
||||
pushd "$ADDINS_DIR" >/dev/null
|
||||
|
||||
mono "$NUGET_EXE" install -ExcludeVersion
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Could not restore NuGet addins."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
popd >/dev/null
|
||||
fi
|
||||
|
||||
# Restore modules from NuGet.
|
||||
if [ -f "$MODULES_PACKAGES_CONFIG" ]; then
|
||||
pushd "$MODULES_DIR" >/dev/null
|
||||
|
||||
mono "$NUGET_EXE" install -ExcludeVersion
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Could not restore NuGet modules."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
popd >/dev/null
|
||||
fi
|
||||
|
||||
# Make sure that Cake has been installed.
|
||||
if [ ! -f "$CAKE_EXE" ]; then
|
||||
echo "Could not find Cake.exe at '$CAKE_EXE'."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Start Cake
|
||||
exec mono "$CAKE_EXE" $SCRIPT --settings_skipverification=true -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${CAKE_ARGUMENTS[@]}"
|
||||
dotnet tool restore
|
||||
dotnet cake $@
|
||||
|
|
37
build.cake
37
build.cake
|
@ -1,14 +1,17 @@
|
|||
#addin nuget:?package=Cake.Xamarin&version=3.0.2
|
||||
#addin nuget:?package=Cake.XCode&version=4.2.0
|
||||
#addin nuget:?package=Cake.FileHelpers&version=3.2.1
|
||||
#addin nuget:?package=Cake.Json&version=4.0.0
|
||||
#addin nuget:?package=SharpCompress&version=0.24.0
|
||||
#addin nuget:?package=Mono.ApiTools.NuGetDiff&version=1.3.2&loaddependencies=true
|
||||
#addin nuget:?package=Cake.Xamarin&version=3.1.0
|
||||
#addin nuget:?package=Cake.XCode&version=5.0.0
|
||||
#addin nuget:?package=Cake.FileHelpers&version=4.0.1
|
||||
#addin nuget:?package=Cake.Json&version=6.0.1
|
||||
#addin nuget:?package=NuGet.Packaging.Core&version=5.11.0
|
||||
#addin nuget:?package=SharpCompress&version=0.28.3
|
||||
#addin nuget:?package=Mono.Cecil&version=0.10.0
|
||||
#addin nuget:?package=Mono.ApiTools&version=5.14.0.2
|
||||
#addin nuget:?package=Mono.ApiTools.NuGetDiff&version=1.3.2
|
||||
#addin nuget:?package=Xamarin.Nuget.Validator&version=1.1.1
|
||||
|
||||
#tool nuget:?package=mdoc&version=5.8.3
|
||||
#tool nuget:?package=xunit.runner.console&version=2.4.1
|
||||
#tool nuget:?package=vswhere&version=2.7.1
|
||||
#tool nuget:?package=vswhere&version=2.8.4
|
||||
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
|
@ -43,7 +46,6 @@ var PLATFORM_SUPPORTS_VULKAN_TESTS = (IsRunningOnWindows () || IsRunningOnLinux
|
|||
var SUPPORT_VULKAN_VAR = Argument ("supportVulkan", EnvironmentVariable ("SUPPORT_VULKAN") ?? PLATFORM_SUPPORTS_VULKAN_TESTS);
|
||||
var SUPPORT_VULKAN = SUPPORT_VULKAN_VAR == "1" || SUPPORT_VULKAN_VAR.ToLower () == "true";
|
||||
|
||||
var CakeToolPath = Context.Tools.Resolve ("Cake.exe");
|
||||
var MDocPath = Context.Tools.Resolve ("mdoc.exe");
|
||||
|
||||
DirectoryPath DOCS_PATH = MakeAbsolute(ROOT_PATH.Combine("docs/SkiaSharpAPI"));
|
||||
|
@ -103,11 +105,6 @@ var PREVIEW_ONLY_NUGETS = new List<string> {
|
|||
"SkiaSharp.Views.Maui.Controls.Compatibility",
|
||||
};
|
||||
|
||||
Information("Arguments:");
|
||||
foreach (var arg in CAKE_ARGUMENTS) {
|
||||
Information($" {arg.Key.PadRight(30)} {{0}}", arg.Value);
|
||||
}
|
||||
|
||||
Information("Source Control:");
|
||||
Information($" {"PREVIEW_LABEL".PadRight(30)} {{0}}", PREVIEW_LABEL);
|
||||
Information($" {"FEATURE_NAME".PadRight(30)} {{0}}", FEATURE_NAME);
|
||||
|
@ -149,7 +146,7 @@ Task ("libs")
|
|||
if (!BUILD_ALL_PLATFORMS) {
|
||||
if (IsRunningOnWindows ()) {
|
||||
platform = ".Windows";
|
||||
} else if (IsRunningOnMac ()) {
|
||||
} else if (IsRunningOnMacOs ()) {
|
||||
platform = ".Mac";
|
||||
} else if (IsRunningOnLinux ()) {
|
||||
platform = ".Linux";
|
||||
|
@ -220,7 +217,7 @@ Task ("tests-netfx")
|
|||
if (IsRunningOnWindows ()) {
|
||||
RunDesktopTest ("x86");
|
||||
RunDesktopTest ("x64");
|
||||
} else if (IsRunningOnMac ()) {
|
||||
} else if (IsRunningOnMacOs ()) {
|
||||
RunDesktopTest ("AnyCPU");
|
||||
} else if (IsRunningOnLinux ()) {
|
||||
RunDesktopTest ("x64");
|
||||
|
@ -416,7 +413,7 @@ Task ("samples")
|
|||
.Does(() =>
|
||||
{
|
||||
var isLinux = IsRunningOnLinux ();
|
||||
var isMac = IsRunningOnMac ();
|
||||
var isMac = IsRunningOnMacOs ();
|
||||
var isWin = IsRunningOnWindows ();
|
||||
|
||||
var buildMatrix = new Dictionary<string, bool> {
|
||||
|
@ -535,9 +532,9 @@ Task ("samples")
|
|||
}
|
||||
|
||||
CleanDirectory ("./output/samples/");
|
||||
DeleteDirectory ("./output/samples/");
|
||||
DeleteDirectory ("./output/samples/", new DeleteDirectorySettings { Recursive = true, Force = true });
|
||||
CleanDirectory ("./output/samples-preview/");
|
||||
DeleteDirectory ("./output/samples-preview/");
|
||||
DeleteDirectory ("./output/samples-preview/", new DeleteDirectorySettings { Recursive = true, Force = true });
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -558,7 +555,7 @@ Task ("nuget-normal")
|
|||
if (!PACK_ALL_PLATFORMS) {
|
||||
if (IsRunningOnWindows ()) {
|
||||
platform = "windows";
|
||||
} else if (IsRunningOnMac ()) {
|
||||
} else if (IsRunningOnMacOs ()) {
|
||||
platform = "macos";
|
||||
} else if (IsRunningOnLinux ()) {
|
||||
platform = "linux";
|
||||
|
@ -872,7 +869,7 @@ Task ("clean-managed")
|
|||
DeleteFiles ("./nuget/*.prerelease.nuspec");
|
||||
|
||||
if (DirectoryExists ("./output"))
|
||||
DeleteDirectory ("./output", true);
|
||||
DeleteDirectory ("./output", new DeleteDirectorySettings { Recursive = true, Force = true });
|
||||
});
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -4,7 +4,6 @@ void PackageNuGet(FilePath nuspecPath, DirectoryPath outputPath, bool allowDefau
|
|||
var settings = new NuGetPackSettings {
|
||||
OutputDirectory = MakeAbsolute(outputPath),
|
||||
BasePath = nuspecPath.GetDirectory(),
|
||||
ToolPath = NUGET_EXE,
|
||||
Properties = new Dictionary<string, string> {
|
||||
// NU5048: The 'PackageIconUrl'/'iconUrl' element is deprecated. Consider using the 'PackageIcon'/'icon' element instead.
|
||||
// NU5105: The package version 'xxx' uses SemVer 2.0.0 or components of SemVer 1.0.0 that are not supported on legacy clients.
|
||||
|
@ -50,7 +49,7 @@ void RunNetCoreTests(FilePath testAssembly)
|
|||
Configuration = CONFIGURATION,
|
||||
NoBuild = true,
|
||||
TestAdapterPath = ".",
|
||||
Logger = "xunit",
|
||||
Loggers = new [] { "xunit" },
|
||||
WorkingDirectory = dir,
|
||||
Verbosity = DotNetCoreVerbosity.Normal,
|
||||
ArgumentCustomization = args => {
|
||||
|
@ -168,7 +167,7 @@ IEnumerable<(DirectoryPath path, string platform)> GetPlatformDirectories(Direct
|
|||
else if (d.StartsWith("net") && d.Contains("-maccatalyst"))
|
||||
yield return (dir, "maccatalyst");
|
||||
else if (d.StartsWith("netcoreapp"))
|
||||
; // skip this one for now
|
||||
continue; // skip this one for now
|
||||
else
|
||||
throw new Exception($"Unknown platform '{d}' found at '{dir}'.");
|
||||
}
|
||||
|
@ -195,6 +194,7 @@ string[] GetReferenceSearchPaths()
|
|||
refs.Add($"{pf}/Windows Kits/10/References/Windows.Foundation.UniversalApiContract/1.0.0.0");
|
||||
refs.Add($"{pf}/Windows Kits/10/References/Windows.Foundation.FoundationContract/1.0.0.0");
|
||||
refs.Add($"{pf}/GtkSharp/2.12/lib");
|
||||
refs.Add($"{pf}/GtkSharp/2.12/lib/gtk-sharp-2.0");
|
||||
refs.Add($"{vs}/Common7/IDE/PublicAssemblies");
|
||||
} else {
|
||||
// TODO
|
||||
|
|
|
@ -18,7 +18,6 @@ void RunNuGetRestorePackagesConfig(FilePath sln)
|
|||
EnsureDirectoryExists(OUTPUT_NUGETS_PATH);
|
||||
|
||||
var settings = new NuGetRestoreSettings {
|
||||
ToolPath = NUGET_EXE,
|
||||
Source = NUGETS_SOURCES,
|
||||
NoCache = true,
|
||||
PackagesDirectory = dir.Combine("packages"),
|
||||
|
|
|
@ -7,12 +7,6 @@ var CONFIGURATION = Argument("c", Argument("configuration", "Release"));
|
|||
|
||||
var VS_INSTALL = Argument("vsinstall", EnvironmentVariable("VS_INSTALL"));
|
||||
var MSBUILD_EXE = Argument("msbuild", EnvironmentVariable("MSBUILD_EXE"));
|
||||
var NUGET_EXE = Argument("nuget", EnvironmentVariable("NUGET_EXE") ?? Context.Tools.Resolve ("nuget.exe"));
|
||||
|
||||
var CAKE_ARGUMENTS = (IReadOnlyDictionary<string, string>)Context.Arguments
|
||||
.GetType()
|
||||
.GetProperty("Arguments")
|
||||
.GetValue(Context.Arguments);
|
||||
|
||||
var BUILD_ARCH = Argument("arch", Argument("buildarch", EnvironmentVariable("BUILD_ARCH") ?? ""))
|
||||
.ToLower().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
@ -22,15 +16,17 @@ var ADDITIONAL_GN_ARGS = Argument("gnArgs", Argument("gnargs", EnvironmentVariab
|
|||
|
||||
DirectoryPath PROFILE_PATH = EnvironmentVariable("USERPROFILE") ?? EnvironmentVariable("HOME");
|
||||
|
||||
Information("Arguments:");
|
||||
foreach (var arg in Arguments()) {
|
||||
foreach (var val in arg.Value) {
|
||||
Information($" {arg.Key.PadRight(30)} {{0}}", val);
|
||||
}
|
||||
}
|
||||
|
||||
void RunCake(FilePath cake, string target = null, Dictionary<string, string> arguments = null)
|
||||
{
|
||||
var args = new Dictionary<string, string>();
|
||||
var args = Arguments().ToDictionary(a => a.Key, a => a.Value.LastOrDefault());
|
||||
|
||||
foreach (var arg in CAKE_ARGUMENTS) {
|
||||
args[arg.Key] = arg.Value;
|
||||
}
|
||||
|
||||
args.Remove("t");
|
||||
args["target"] = target;
|
||||
|
||||
if (arguments != null) {
|
||||
|
@ -39,10 +35,14 @@ void RunCake(FilePath cake, string target = null, Dictionary<string, string> arg
|
|||
}
|
||||
}
|
||||
|
||||
CakeExecuteScript(cake, new CakeSettings {
|
||||
WorkingDirectory = cake.GetDirectory(),
|
||||
Arguments = args,
|
||||
});
|
||||
cake = MakeAbsolute(cake);
|
||||
var cmd = $"cake {cake}";
|
||||
|
||||
foreach (var arg in args) {
|
||||
cmd += $@" --{arg.Key}=""{arg.Value}""";
|
||||
}
|
||||
|
||||
DotNetCoreTool(cmd);
|
||||
}
|
||||
|
||||
void RunProcess(FilePath process, string args = "")
|
||||
|
@ -80,16 +80,6 @@ IProcess RunAndReturnProcess(FilePath process, ProcessSettings settings)
|
|||
return proc;
|
||||
}
|
||||
|
||||
bool IsRunningOnMac()
|
||||
{
|
||||
return System.Environment.OSVersion.Platform == PlatformID.MacOSX || MacPlatformDetector.IsMac.Value;
|
||||
}
|
||||
|
||||
bool IsRunningOnLinux()
|
||||
{
|
||||
return IsRunningOnUnix() && !IsRunningOnMac();
|
||||
}
|
||||
|
||||
string GetVersion(string lib, string type = "nuget")
|
||||
{
|
||||
return GetRegexValue($@"^{lib}\s*{type}\s*(.*)$", ROOT_PATH.CombineWithFilePath("VERSIONS.txt"));
|
||||
|
@ -105,30 +95,3 @@ string GetRegexValue(string regex, FilePath file)
|
|||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
internal static class MacPlatformDetector
|
||||
{
|
||||
internal static readonly Lazy<bool> IsMac = new Lazy<bool>(IsRunningOnMac);
|
||||
|
||||
[DllImport("libc")]
|
||||
static extern int uname(IntPtr buf);
|
||||
|
||||
static bool IsRunningOnMac()
|
||||
{
|
||||
IntPtr buf = IntPtr.Zero;
|
||||
try {
|
||||
buf = Marshal.AllocHGlobal(8192);
|
||||
// This is a hacktastic way of getting sysname from uname()
|
||||
if (uname(buf) == 0) {
|
||||
string os = Marshal.PtrToStringAnsi(buf);
|
||||
if (os == "Darwin")
|
||||
return true;
|
||||
}
|
||||
} catch {
|
||||
} finally {
|
||||
if (buf != IntPtr.Zero)
|
||||
Marshal.FreeHGlobal(buf);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#addin nuget:?package=Cake.XCode&version=4.2.0
|
||||
#addin nuget:?package=Cake.XCode&version=5.0.0
|
||||
|
||||
void RunXCodeBuild(FilePath project, string scheme, string sdk, string arch, string platform = null)
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ void RunXCodeBuild(FilePath project, string scheme, string sdk, string arch, str
|
|||
|
||||
void StripSign(FilePath target)
|
||||
{
|
||||
if (!IsRunningOnMac())
|
||||
if (!IsRunningOnMacOs())
|
||||
throw new InvalidOperationException("strip and codesign are only available on macOS.");
|
||||
|
||||
target = MakeAbsolute(target);
|
||||
|
@ -49,7 +49,7 @@ void StripSign(FilePath target)
|
|||
|
||||
void RunLipo(DirectoryPath directory, FilePath output, FilePath[] inputs)
|
||||
{
|
||||
if (!IsRunningOnMac())
|
||||
if (!IsRunningOnMacOs())
|
||||
throw new InvalidOperationException("lipo is only available on macOS.");
|
||||
|
||||
EnsureDirectoryExists(directory.CombineWithFilePath(output).GetDirectory());
|
||||
|
@ -63,7 +63,7 @@ void RunLipo(DirectoryPath directory, FilePath output, FilePath[] inputs)
|
|||
|
||||
void RunLipo(FilePath output, FilePath[] inputs)
|
||||
{
|
||||
if (!IsRunningOnMac())
|
||||
if (!IsRunningOnMacOs())
|
||||
throw new InvalidOperationException("lipo is only available on macOS.");
|
||||
|
||||
var inputString = string.Join(" ", inputs.Select(i => string.Format("\"{0}\"", i)));
|
||||
|
|
|
@ -10,7 +10,7 @@ bool SUPPORT_VULKAN = SUPPORT_VULKAN_VAR == "1" || SUPPORT_VULKAN_VAR.ToLower ()
|
|||
|
||||
Task("libSkiaSharp")
|
||||
.IsDependentOn("git-sync-deps")
|
||||
.WithCriteria(IsRunningOnMac() || IsRunningOnWindows())
|
||||
.WithCriteria(IsRunningOnMacOs() || IsRunningOnWindows())
|
||||
.Does(() =>
|
||||
{
|
||||
Build("x86", "x86");
|
||||
|
@ -46,7 +46,7 @@ Task("libSkiaSharp")
|
|||
});
|
||||
|
||||
Task("libHarfBuzzSharp")
|
||||
.WithCriteria(IsRunningOnMac() || IsRunningOnWindows())
|
||||
.WithCriteria(IsRunningOnMacOs() || IsRunningOnWindows())
|
||||
.Does(() =>
|
||||
{
|
||||
var cmd = IsRunningOnWindows() ? ".cmd" : "";
|
||||
|
|
|
@ -8,7 +8,7 @@ string VARIANT = BUILD_VARIANT ?? "ios";
|
|||
|
||||
Task("libSkiaSharp")
|
||||
.IsDependentOn("git-sync-deps")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
if (VARIANT.ToLower() == "ios") {
|
||||
|
@ -52,7 +52,7 @@ Task("libSkiaSharp")
|
|||
});
|
||||
|
||||
Task("libHarfBuzzSharp")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
if (VARIANT.ToLower() == "ios") {
|
||||
|
|
|
@ -4,7 +4,7 @@ DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native"));
|
|||
#load "../../cake/shared.cake"
|
||||
|
||||
Task("libSkiaSharp")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
RunCake("../ios/build.cake", "libSkiaSharp", new Dictionary<string, string> {
|
||||
|
@ -13,7 +13,7 @@ Task("libSkiaSharp")
|
|||
});
|
||||
|
||||
Task("libHarfBuzzSharp")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
RunCake("../ios/build.cake", "libHarfBuzzSharp", new Dictionary<string, string> {
|
||||
|
|
|
@ -6,7 +6,7 @@ DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native/osx"))
|
|||
|
||||
Task("libSkiaSharp")
|
||||
.IsDependentOn("git-sync-deps")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
Build("x86_64", "x64");
|
||||
|
@ -47,7 +47,7 @@ Task("libSkiaSharp")
|
|||
});
|
||||
|
||||
Task("libHarfBuzzSharp")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
Build("x86_64");
|
||||
|
|
|
@ -6,7 +6,7 @@ DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native/tvos")
|
|||
|
||||
Task("libSkiaSharp")
|
||||
.IsDependentOn("git-sync-deps")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
Build("appletvsimulator", "x86_64", "x64");
|
||||
|
@ -41,7 +41,7 @@ Task("libSkiaSharp")
|
|||
});
|
||||
|
||||
Task("libHarfBuzzSharp")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
Build("appletvsimulator", "x86_64");
|
||||
|
|
|
@ -6,7 +6,7 @@ DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native/watcho
|
|||
|
||||
Task("libSkiaSharp")
|
||||
.IsDependentOn("git-sync-deps")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
Build("watchsimulator", "i386", "x86");
|
||||
|
@ -43,7 +43,7 @@ Task("libSkiaSharp")
|
|||
});
|
||||
|
||||
Task("libHarfBuzzSharp")
|
||||
.WithCriteria(IsRunningOnMac())
|
||||
.WithCriteria(IsRunningOnMacOs())
|
||||
.Does(() =>
|
||||
{
|
||||
Build("watchsimulator", "i386");
|
||||
|
|
|
@ -1,10 +1,25 @@
|
|||
FROM amd64/alpine:3.9
|
||||
|
||||
RUN apk add --no-cache bash curl ca-certificates python git build-base ninja fontconfig-dev
|
||||
RUN apk add --no-cache samurai --repository http://dl-cdn.alpinelinux.org/alpine/edge/main
|
||||
RUN apk add --no-cache mono clang gn --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing
|
||||
# Arguments:
|
||||
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 3.1.412 | * ]
|
||||
|
||||
RUN cert-sync /etc/ssl/certs/ca-certificates.crt
|
||||
RUN apk add --no-cache bash curl wget python git build-base ninja fontconfig-dev libintl
|
||||
RUN apk add --no-cache samurai --repository http://dl-cdn.alpinelinux.org/alpine/edge/main
|
||||
RUN apk add --no-cache clang gn --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing
|
||||
|
||||
ARG DOTNET_SDK_VERSION=3.1.412
|
||||
|
||||
RUN wget -O dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-musl-x64.tar.gz \
|
||||
&& dotnet_sha512='f81ec24d3550bd414fb0fa154007f88a2e2956c73d033c2a82a6cea3402f0a842d1f32e8ffc199c0d9ed86faa8005a76b7c3b130e9cd0c1bea71d0631c9a1bcd' \
|
||||
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
|
||||
&& mkdir -p /usr/share/dotnet \
|
||||
&& tar -C /usr/share/dotnet -xzf dotnet.tar.gz \
|
||||
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
|
||||
&& rm dotnet.tar.gz
|
||||
|
||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1
|
||||
|
||||
RUN dotnet help
|
||||
|
||||
ENV GN_EXE=gn NINJA_EXE=ninja
|
||||
|
||||
|
|
|
@ -4,4 +4,7 @@ set -e
|
|||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
(cd $DIR && docker build --tag skiasharp-alpine .)
|
||||
(cd $DIR/../../../../ && docker run --rm --name skiasharp-alpine --volume $(pwd):/work skiasharp-alpine /bin/bash ./bootstrapper.sh -t externals-linux -c Release --buildarch=x64 --variant=alpine)
|
||||
(cd $DIR/../../../../ && \
|
||||
docker run --rm --name skiasharp-alpine --volume $(pwd):/work skiasharp-alpine /bin/bash -c "\
|
||||
dotnet tool restore && \
|
||||
dotnet cake --target=externals-linux --configuration=Release --buildarch=x64 --variant=alpine")
|
||||
|
|
|
@ -1,23 +1,34 @@
|
|||
FROM amd64/debian:9
|
||||
|
||||
# Arguments:
|
||||
# MONO_VERSION - the version of mono for the Cake script [ 6.4.0 | * ]
|
||||
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 3.1.412 | * ]
|
||||
# CLANG_VERSION - the version of clang/llvm tools [ 10 | * ]
|
||||
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 6 | * ]
|
||||
|
||||
ARG MONO_VERSION=6.4.0
|
||||
ARG CLANG_VERSION=10
|
||||
ARG TOOLCHAIN_VERSION=6
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y apt-transport-https curl wget python git make dirmngr gnupg ca-certificates \
|
||||
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
|
||||
&& echo "deb https://download.mono-project.com/repo/debian stable-stretch/snapshots/${MONO_VERSION} main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
|
||||
&& apt-get install -y apt-transport-https curl wget python git make dirmngr gnupg \
|
||||
&& curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
|
||||
&& echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-${CLANG_VERSION} main" | tee /etc/apt/sources.list.d/llvm.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y mono-devel libfontconfig1-dev gcc-${TOOLCHAIN_VERSION} g++-${TOOLCHAIN_VERSION} clang-${CLANG_VERSION} \
|
||||
&& apt-get install -y libfontconfig1-dev gcc-${TOOLCHAIN_VERSION} g++-${TOOLCHAIN_VERSION} clang-${CLANG_VERSION} \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ARG DOTNET_SDK_VERSION=3.1.412
|
||||
|
||||
RUN wget -O dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
|
||||
&& dotnet_sha512='1ed0c1ab48723cef834906a55fb1889b29dd810cd2bc66cbd345a0baf8a2796045b5b7f4beef3c48bd56bef3ffed690b6fae4a5f017ad8687817b25a76fbd9be' \
|
||||
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
|
||||
&& mkdir -p /usr/share/dotnet \
|
||||
&& tar -C /usr/share/dotnet -xzf dotnet.tar.gz \
|
||||
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
|
||||
&& rm dotnet.tar.gz
|
||||
|
||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1
|
||||
|
||||
RUN dotnet help
|
||||
|
||||
ENV CC=clang-${CLANG_VERSION} CXX=clang++-${CLANG_VERSION}
|
||||
|
||||
WORKDIR /work
|
||||
|
|
|
@ -4,4 +4,7 @@ set -e
|
|||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
(cd $DIR && docker build --tag skiasharp-linux .)
|
||||
(cd $DIR/../../../../ && docker run --rm --name skiasharp-linux --volume $(pwd):/work skiasharp-linux /bin/bash ./bootstrapper.sh -t externals-linux -c Release --buildarch=x64 )
|
||||
(cd $DIR/../../../../ && \
|
||||
docker run --rm --name skiasharp-linux --volume $(pwd):/work skiasharp-linux /bin/bash -c "\
|
||||
dotnet tool restore && \
|
||||
dotnet cake --target=externals-linux --configuration=Release --buildarch=x64")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
FROM amd64/debian:9
|
||||
|
||||
# Arguments:
|
||||
# MONO_VERSION - the version of mono for the Cake script [ 6.4.0 | * ]
|
||||
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 3.1.412 | * ]
|
||||
# CLANG_VERSION - the version of clang/llvm tools [ 10 | * ]
|
||||
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 6 | * ]
|
||||
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-linux-gnueabihf | aarch64-linux-gnu]
|
||||
|
@ -13,20 +13,29 @@ FROM amd64/debian:9
|
|||
# To build a arm64 image:
|
||||
# --build-arg TOOLCHAIN_ARCH=aarch64-linux-gnu --build-arg TOOLCHAIN_ARCH_SHORT=arm64
|
||||
|
||||
# pre-requisites for building (python, git, mono)
|
||||
ARG MONO_VERSION=6.4.0
|
||||
# pre-requisites for building (python, git)
|
||||
ARG CLANG_VERSION=10
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y apt-transport-https curl wget python git make dirmngr gnupg ca-certificates \
|
||||
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
|
||||
&& echo "deb https://download.mono-project.com/repo/debian stable-stretch/snapshots/${MONO_VERSION} main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
|
||||
&& apt-get install -y apt-transport-https curl wget python git make dirmngr gnupg \
|
||||
&& curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
|
||||
&& echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-${CLANG_VERSION} main" | tee /etc/apt/sources.list.d/llvm.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y mono-devel clang-${CLANG_VERSION} \
|
||||
&& apt-get install -y clang-${CLANG_VERSION} \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN apt-get update
|
||||
ARG DOTNET_SDK_VERSION=3.1.412
|
||||
|
||||
RUN wget -O dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
|
||||
&& dotnet_sha512='1ed0c1ab48723cef834906a55fb1889b29dd810cd2bc66cbd345a0baf8a2796045b5b7f4beef3c48bd56bef3ffed690b6fae4a5f017ad8687817b25a76fbd9be' \
|
||||
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
|
||||
&& mkdir -p /usr/share/dotnet \
|
||||
&& tar -C /usr/share/dotnet -xzf dotnet.tar.gz \
|
||||
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
|
||||
&& rm dotnet.tar.gz
|
||||
|
||||
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1
|
||||
|
||||
RUN dotnet help
|
||||
|
||||
# toolchain (gcc/g++)
|
||||
ARG TOOLCHAIN_VERSION=6
|
||||
|
|
|
@ -11,4 +11,7 @@ if [ "$1" == "arm64" ]; then
|
|||
fi
|
||||
|
||||
(cd $DIR && docker build --tag skiasharp-$ARCH $BUILD_ARGS .)
|
||||
(cd $DIR/../../../../ && docker run --rm --name skiasharp-$ARCH --volume $(pwd):/work skiasharp-$ARCH /bin/bash ./bootstrapper.sh -t externals-linux-clang-cross -c Release --buildarch=$ARCH)
|
||||
(cd $DIR/../../../../ &&
|
||||
docker run --rm --name skiasharp-$ARCH --volume $(pwd):/work skiasharp-$ARCH /bin/bash -c "\
|
||||
dotnet tool restore && \
|
||||
dotnet cake --target=externals-linux-clang-cross --configuration=Release --buildarch=$ARCH")
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.201-bionic
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.412-bionic
|
||||
|
||||
# Arguments:
|
||||
# EMSCRIPTEN_VERSION - the version of the emscripten SDK [ 2.0.23 | * ]
|
||||
|
||||
# default value, but should be provided depending on app
|
||||
ARG EMSCRIPTEN_VERSION=2.0.11
|
||||
ARG EMSCRIPTEN_VERSION=2.0.23
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y apt-transport-https curl wget python python3 git make \
|
||||
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
|
||||
&& echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y mono-devel \
|
||||
&& apt-get install -y apt-transport-https curl wget python python3 git make xz-utils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN git clone --branch ${EMSCRIPTEN_VERSION} https://github.com/emscripten-core/emsdk ~/emsdk && \
|
||||
|
@ -17,7 +16,7 @@ RUN git clone --branch ${EMSCRIPTEN_VERSION} https://github.com/emscripten-core/
|
|||
./emsdk activate ${EMSCRIPTEN_VERSION}
|
||||
|
||||
# Workaround for https://github.com/dotnet/sdk/issues/11108
|
||||
RUN cd /usr/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets && \
|
||||
RUN cd /usr/share/dotnet/sdk/3.1.412/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets && \
|
||||
mv Microsoft.WinFx.props Microsoft.WinFX.props && \
|
||||
mv Microsoft.WinFx.targets Microsoft.WinFX.targets
|
||||
|
||||
|
|
|
@ -9,4 +9,7 @@ if [ "$1" ]; then
|
|||
fi
|
||||
|
||||
(cd $DIR && docker build --tag skiasharp-wasm $VERSION_ARGS .)
|
||||
(cd $DIR/../../../ && docker run --rm --name skiasharp-wasm --volume $(pwd):/work skiasharp-wasm /bin/bash ./bootstrapper.sh -t externals-wasm --emscriptenVersion=$1)
|
||||
(cd $DIR/../../../ && \
|
||||
docker run --rm --name skiasharp-wasm --volume $(pwd):/work skiasharp-wasm /bin/bash -c "\
|
||||
dotnet tool restore && \
|
||||
dotnet cake --target=externals-wasm --emscriptenVersion=$1")
|
||||
|
|
|
@ -38,7 +38,7 @@ variables:
|
|||
THROW_ON_TEST_FAILURE: true
|
||||
NUGET_DIFF_PRERELEASE: false
|
||||
ENABLE_CODE_COVERAGE: true
|
||||
EMSCRIPTEN_VERSION: 2.0.12
|
||||
EMSCRIPTEN_VERSION: 2.0.23
|
||||
XHARNESS_VERSION: 1.0.0-prerelease.21404.1
|
||||
|
||||
resources:
|
||||
|
@ -442,12 +442,7 @@ stages:
|
|||
- src: nuget
|
||||
dst: nugets
|
||||
preBuildSteps:
|
||||
- pwsh: |
|
||||
$p = "$env:BUILD_SOURCESDIRECTORY\output\nugets\api-diff"
|
||||
New-Item -ItemType Directory -Force -Path $p | Out-Null
|
||||
$uri = 'https://xamarin.azureedge.net/GTKforWindows/Windows/gtk-sharp-2.12.45.msi'
|
||||
.\scripts\download-file.ps1 -Uri $uri -OutFile gtk-sharp.msi
|
||||
msiexec /i gtk-sharp.msi /norestart /quiet /l* $p\gtk-sharp-install.log
|
||||
- pwsh: .\scripts\install-gtk.ps1
|
||||
displayName: Install GTK# 2.12
|
||||
postBuildSteps:
|
||||
- task: PublishBuildArtifacts@1
|
||||
|
|
|
@ -202,9 +202,10 @@ jobs:
|
|||
- ${{ if eq(parameters.docker, '') }}:
|
||||
- ${{ if endsWith(parameters.name, '_windows') }}:
|
||||
- pwsh: |
|
||||
dotnet tool restore
|
||||
${{ parameters.initScript }}
|
||||
.\scripts\retry-command.ps1 -RetryCount ${{ parameters.retryCount }} {
|
||||
.\bootstrapper.ps1 -t ${{ parameters.target }} -v ${{ parameters.verbosity }} -c ${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }}
|
||||
dotnet cake --target=${{ parameters.target }} --verbosity=${{ parameters.verbosity }} --configuration=${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }}
|
||||
}
|
||||
env:
|
||||
JavaSdkDirectory: $(JAVA_HOME)
|
||||
|
@ -214,9 +215,10 @@ jobs:
|
|||
displayName: Run the bootstrapper for ${{ parameters.target }}
|
||||
- ${{ if not(endsWith(parameters.name, '_windows')) }}:
|
||||
- bash: |
|
||||
dotnet tool restore
|
||||
${{ parameters.initScript }}
|
||||
./scripts/retry-command.sh ${{ parameters.retryCount }} \
|
||||
./bootstrapper.sh -t ${{ parameters.target }} -v ${{ parameters.verbosity }} -c ${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }}
|
||||
dotnet cake --target=${{ parameters.target }} --verbosity=${{ parameters.verbosity }} --configuration=${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }}
|
||||
env:
|
||||
JavaSdkDirectory: $(JAVA_HOME)
|
||||
displayName: Run the bootstrapper for ${{ parameters.target }}
|
||||
|
@ -225,9 +227,12 @@ jobs:
|
|||
workingDirectory: ${{ parameters.docker }}
|
||||
displayName: Build the Docker image for ${{ parameters.docker }}
|
||||
- bash: |
|
||||
echo dotnet tool restore > cmd.sh
|
||||
echo dotnet cake --target=${{ parameters.target }} --verbosity=${{ parameters.verbosity }} --configuration=${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }} >> cmd.sh
|
||||
sed -i 's/--gnArgs=\" \"//' cmd.sh
|
||||
docker run --rm --name skiasharp --volume $(pwd):/work skiasharp /bin/bash \
|
||||
scripts/retry-command.sh ${{ parameters.retryCount }} \
|
||||
./bootstrapper.sh -t ${{ parameters.target }} -v ${{ parameters.verbosity }} -c ${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }}
|
||||
/bin/bash /work/cmd.sh
|
||||
displayName: Run the bootstrapper for ${{ parameters.target }} using the Docker image
|
||||
|
||||
# post-build steps
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
Param(
|
||||
[string] $Version = "2.12.45"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$p = "$env:BUILD_SOURCESDIRECTORY\output\logs\install-logs"
|
||||
New-Item -ItemType Directory -Force -Path $p | Out-Null
|
||||
|
||||
$uri = "https://xamarin.azureedge.net/GTKforWindows/Windows/gtk-sharp-$Version.msi"
|
||||
|
||||
.\scripts\download-file.ps1 -Uri $uri -OutFile gtk-sharp.msi
|
||||
|
||||
msiexec /i gtk-sharp.msi /norestart /quiet /l* $p\gtk-sharp-install.log
|
||||
|
||||
exit $LASTEXITCODE
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Cake" version="0.38.4" />
|
||||
</packages>
|
Загрузка…
Ссылка в новой задаче