From 33a68a5687c69da2d6b0ee4f8e1a0de72607f84b Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Sun, 17 Nov 2019 05:08:27 +0200 Subject: [PATCH] Add Nano Server to the list Fixes #676 --- VERSIONS.txt | 2 + build.cake | 28 ++++---- cake/BuildExternals.cake | 8 +-- externals/skia | 2 +- ...rfbuzzSharp.NativeAssets.NanoServer.nuspec | 51 ++++++++++++++ .../SkiaSharp.NativeAssets.NanoServer.nuspec | 52 ++++++++++++++ scripts/azure-pipelines.yml | 68 ++++++++++++++++++- 7 files changed, 192 insertions(+), 19 deletions(-) create mode 100644 nuget/HarfbuzzSharp.NativeAssets.NanoServer.nuspec create mode 100644 nuget/SkiaSharp.NativeAssets.NanoServer.nuspec diff --git a/VERSIONS.txt b/VERSIONS.txt index 69a4e9efd6..4f5fe82e94 100644 --- a/VERSIONS.txt +++ b/VERSIONS.txt @@ -36,6 +36,7 @@ HarfBuzzSharp file 2.6.1.0 SkiaSharp nuget 1.68.1 SkiaSharp.NativeAssets.Linux nuget 1.68.1 SkiaSharp.NativeAssets.Linux.NoDependencies nuget 1.68.1 +SkiaSharp.NativeAssets.NanoServer nuget 1.68.1 SkiaSharp.Views nuget 1.68.1 SkiaSharp.Views.Desktop.Common nuget 1.68.1 SkiaSharp.Views.Gtk2 nuget 1.68.1 @@ -47,3 +48,4 @@ SkiaSharp.Views.Forms.WPF nuget 1.68.1 SkiaSharp.HarfBuzz nuget 1.68.1 HarfBuzzSharp nuget 2.6.1 HarfBuzzSharp.NativeAssets.Linux nuget 2.6.1 +HarfBuzzSharp.NativeAssets.NanoServer nuget 2.6.1 diff --git a/build.cake b/build.cake index d4f30bd816..4513c044f3 100644 --- a/build.cake +++ b/build.cake @@ -74,19 +74,21 @@ var AZURE_BUILD_SUCCESS = "https://dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7 var AZURE_BUILD_URL = "https://dev.azure.com/xamarin/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_apis/build/builds/{0}/artifacts?artifactName={1}&%24format=zip&api-version=5.1"; var TRACKED_NUGETS = new Dictionary { - { "SkiaSharp", new Version (1, 57, 0) }, - { "SkiaSharp.NativeAssets.Linux", new Version (1, 57, 0) }, - { "SkiaSharp.Views", new Version (1, 57, 0) }, - { "SkiaSharp.Views.Desktop.Common", new Version (1, 57, 0) }, - { "SkiaSharp.Views.Gtk2", new Version (1, 57, 0) }, - { "SkiaSharp.Views.Gtk3", new Version (1, 57, 0) }, - { "SkiaSharp.Views.WindowsForms", new Version (1, 57, 0) }, - { "SkiaSharp.Views.WPF", new Version (1, 57, 0) }, - { "SkiaSharp.Views.Forms", new Version (1, 57, 0) }, - { "SkiaSharp.Views.Forms.WPF", new Version (1, 57, 0) }, - { "HarfBuzzSharp", new Version (1, 0, 0) }, - { "HarfBuzzSharp.NativeAssets.Linux", new Version (1, 0, 0) }, - { "SkiaSharp.HarfBuzz", new Version (1, 57, 0) }, + { "SkiaSharp", new Version (1, 57, 0) }, + { "SkiaSharp.NativeAssets.Linux", new Version (1, 57, 0) }, + { "SkiaSharp.NativeAssets.NanoServer", new Version (1, 57, 0) }, + { "SkiaSharp.Views", new Version (1, 57, 0) }, + { "SkiaSharp.Views.Desktop.Common", new Version (1, 57, 0) }, + { "SkiaSharp.Views.Gtk2", new Version (1, 57, 0) }, + { "SkiaSharp.Views.Gtk3", new Version (1, 57, 0) }, + { "SkiaSharp.Views.WindowsForms", new Version (1, 57, 0) }, + { "SkiaSharp.Views.WPF", new Version (1, 57, 0) }, + { "SkiaSharp.Views.Forms", new Version (1, 57, 0) }, + { "SkiaSharp.Views.Forms.WPF", new Version (1, 57, 0) }, + { "HarfBuzzSharp", new Version (1, 0, 0) }, + { "HarfBuzzSharp.NativeAssets.NanoServer", new Version (1, 0, 0) }, + { "HarfBuzzSharp.NativeAssets.Linux", new Version (1, 0, 0) }, + { "SkiaSharp.HarfBuzz", new Version (1, 57, 0) }, }; #load "cake/UtilsManaged.cake" diff --git a/cake/BuildExternals.cake b/cake/BuildExternals.cake index 2fac8443e6..541f6d1ad3 100644 --- a/cake/BuildExternals.cake +++ b/cake/BuildExternals.cake @@ -1,14 +1,14 @@ void GnNinja (DirectoryPath outDir, string target, string skiaArgs) { - var exe = IsRunningOnWindows () ? ".exe" : ""; - var quote = IsRunningOnWindows () ? "\"" : "'"; - var innerQuote = IsRunningOnWindows () ? "\\\"" : "\""; - if (!string.IsNullOrEmpty(ADDITIONAL_GN_ARGS)) { skiaArgs += " " + ADDITIONAL_GN_ARGS; } + var exe = IsRunningOnWindows () ? ".exe" : ""; + var quote = IsRunningOnWindows () ? "\"" : "'"; + var innerQuote = IsRunningOnWindows () ? "\\\"" : "\""; + // generate native skia build files RunProcess (SKIA_PATH.CombineWithFilePath($"bin/gn{exe}"), new ProcessSettings { Arguments = $"gen out/{outDir} --args={quote}{skiaArgs.Replace("'", innerQuote)}{quote}", diff --git a/externals/skia b/externals/skia index 6c864a6c85..c7bc33cec7 160000 --- a/externals/skia +++ b/externals/skia @@ -1 +1 @@ -Subproject commit 6c864a6c858f77d7e20b37cd468103ae8d7e054b +Subproject commit c7bc33cec7df10707f9c13254e4a593ce18aa7ae diff --git a/nuget/HarfbuzzSharp.NativeAssets.NanoServer.nuspec b/nuget/HarfbuzzSharp.NativeAssets.NanoServer.nuspec new file mode 100644 index 0000000000..6306816b09 --- /dev/null +++ b/nuget/HarfbuzzSharp.NativeAssets.NanoServer.nuspec @@ -0,0 +1,51 @@ + + + + + + HarfBuzzSharp.NativeAssets.NanoServer + HarfBuzzSharp - Native Assets for Microsoft Nano Server + 1.0.0 + +HarfBuzzSharp is a cross-platform OpenType text shaping engine for .NET platforms. + + +HarfBuzzSharp is a cross-platform OpenType text shaping engine for .NET platforms. + + +Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release notes. + + https://go.microsoft.com/fwlink/?linkid=868515 + https://go.microsoft.com/fwlink/?linkid=868516 + xamarin text harfbuzz ios android linux windows uwp tvos macos tizen cross-platform harfbuzzsharp + + + https://go.microsoft.com/fwlink/?linkid=868514 + Microsoft + Microsoft + true + © Microsoft Corporation. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nuget/SkiaSharp.NativeAssets.NanoServer.nuspec b/nuget/SkiaSharp.NativeAssets.NanoServer.nuspec new file mode 100644 index 0000000000..c426f892d8 --- /dev/null +++ b/nuget/SkiaSharp.NativeAssets.NanoServer.nuspec @@ -0,0 +1,52 @@ + + + + + + SkiaSharp.NativeAssets.NanoServer + SkiaSharp - Native Assets for Microsoft Nano Server + 1.0.0 + +SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. +It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images. + + +SkiaSharp is a cross-platform 2D graphics API for .NET platforms that can be used across mobile, server and desktop models to render images. + + +Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release notes. + + https://go.microsoft.com/fwlink/?linkid=868515 + https://go.microsoft.com/fwlink/?linkid=868516 + xamarin graphics ios android linux windows uwp tvos watchos macos tizen cross-platform skiasharp + + + https://go.microsoft.com/fwlink/?linkid=868514 + Microsoft + Microsoft + true + © Microsoft Corporation. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/azure-pipelines.yml b/scripts/azure-pipelines.yml index 1a9cf3a5e3..517a970ef8 100644 --- a/scripts/azure-pipelines.yml +++ b/scripts/azure-pipelines.yml @@ -115,6 +115,13 @@ stages: vmImage: $(VM_IMAGE_WINDOWS) target: externals-windows additionalArgs: --buildarch=x64 + - template: azure-templates-bootstrapper.yml # Build Native Win32|x64 [NanoServer] (Windows) + parameters: + name: native_win32_x64_nanoserver_windows + displayName: Build Native Win32|x64 [NanoServer] (Windows) + vmImage: $(VM_IMAGE_WINDOWS) + target: externals-windows + additionalArgs: --buildarch=x64 --additionalGnArgs="extra_cflags+=[''''-DSK_BUILD_FOR_NANOSERVER'''']" # NATIVE JOBS - MAC - template: azure-templates-bootstrapper.yml # Build Native Android|x86 (macOS) parameters: @@ -222,6 +229,25 @@ stages: - native_uwp_arm64_windows - native_win32_x86_windows - native_win32_x64_windows + - template: azure-templates-bootstrapper.yml # Build Managed [NanoServer] (Windows) + parameters: + name: managed_nanoserver_windows + displayName: Build Managed [NanoServer] (Windows) + vmImage: $(VM_IMAGE_WINDOWS) + target: libs-only + requiredArtifacts: + - native_android_x86_windows + - native_android_x64_windows + - native_android_arm_windows + - native_android_arm64_windows + # - native_tizen_windows + - native_tizen_linux + - native_uwp_x86_windows + - native_uwp_x64_windows + - native_uwp_arm_windows + - native_uwp_arm64_windows + - native_win32_x86_windows + - native_win32_x64_nanoserver_windows - template: azure-templates-bootstrapper.yml # Build Managed (macOS) parameters: name: managed_macos @@ -264,6 +290,39 @@ stages: displayName: Package NuGets dependsOn: managed jobs: + - template: azure-templates-bootstrapper.yml # Package NuGets [NanoServer] + parameters: + name: package_nanoserver_windows + displayName: Package NuGets [NanoServer] + vmImage: $(VM_IMAGE_WINDOWS) + target: nuget-only + additionalArgs: --packall=true + shouldPublish: false + requiredArtifacts: + - managed_linux + - managed_macos + - managed_nanoserver_windows + postBuildSteps: + - pwsh: | + $platforms = (Get-ChildItem -Path ./output/native/*) | Where-Object { $_.Name -NotMatch "windows" } + Write-Host "Removing the following platforms:" + $platforms | Foreach-Object { Write-Host $_.Name } + $platforms | ForEach-Object { Remove-Item -Path $_ -Recurse -Force } + $nupkgs = (Get-ChildItem -Path ./output/nugets/*) | Where-Object { $_.Name -NotMatch "NanoServer" } + Write-Host "Removing the following packages:" + $nupkgs | Foreach-Object { Write-Host $_.Name } + $nupkgs | ForEach-Object { Remove-Item -Path $_ -Recurse -Force } + displayName: Remove all unrelated files + - task: PublishBuildArtifacts@1 + displayName: Publish the native-nanoserver artifacts + inputs: + artifactName: native-nanoserver + pathToPublish: 'output/native' + - task: PublishBuildArtifacts@1 + displayName: Publish the nuget-nanoserver artifacts + inputs: + artifactName: nuget-nanoserver + pathToPublish: 'output/nugets' - template: azure-templates-bootstrapper.yml # Package NuGets [No Dependencies] parameters: name: package_nodependencies_windows @@ -311,7 +370,7 @@ stages: - managed_windows postBuildSteps: - pwsh: | - $nupkgs = (Get-ChildItem -Path ./output/nugets/*) | Where-Object { $_.Name -Match "NoDependencies" } + $nupkgs = (Get-ChildItem -Path ./output/nugets/*) | Where-Object { ($_.Name -Match "NoDependencies") -or ($_.Name -Match "NanoServer") } Write-Host "Removing the following packages:" $nupkgs | Foreach-Object { Write-Host $_.Name } $nupkgs | ForEach-Object { Remove-Item -Path $_ -Recurse -Force } @@ -330,6 +389,7 @@ stages: displayName: Combine Packaged NuGets dependsOn: - package_nodependencies_windows + - package_nanoserver_windows - package_windows pool: name: $(VM_IMAGE_LINUX) @@ -339,6 +399,11 @@ stages: inputs: artifactName: nuget-nodependencies downloadPath: 'download-temp' + - task: DownloadBuildArtifacts@0 + displayName: Download the nuget-nanoserver artifacts + inputs: + artifactName: nuget-nanoserver + downloadPath: 'download-temp' - task: DownloadBuildArtifacts@0 displayName: Download the nuget-default artifacts inputs: @@ -347,6 +412,7 @@ stages: - pwsh: | New-Item '.\output\nugets' -Type Directory -Force | Out-Null Get-ChildItem '.\download-temp\nuget-nodependencies\' | Copy-Item -Destination '.\output\nugets' -Recurse -Force + Get-ChildItem '.\download-temp\nuget-nanoserver\' | Copy-Item -Destination '.\output\nugets' -Recurse -Force Get-ChildItem '.\download-temp\nuget-default\' | Copy-Item -Destination '.\output\nugets' -Recurse -Force Remove-Item '.\download-temp\' -Recurse -Force displayName: Move the nuget-* artifacts to the output directory