From 75aceb73f71372532701ccf6c6d2b80d9306a590 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 19 Aug 2021 22:54:45 +0200 Subject: [PATCH 1/6] Add main PDB files to the packages --- .../HarfBuzzSharp.UWP.csproj | 8 +++---- binding/SkiaSharp.UWP/SkiaSharp.UWP.csproj | 24 +++++++++---------- nuget/HarfbuzzSharp.nuspec | 16 +++++++++++++ nuget/SkiaSharp.HarfBuzz.nuspec | 3 +++ nuget/SkiaSharp.Views.Desktop.Common.nuspec | 3 +++ nuget/SkiaSharp.Views.Forms.GTK.nuspec | 1 + nuget/SkiaSharp.Views.Forms.WPF.nuspec | 2 ++ nuget/SkiaSharp.Views.Forms.nuspec | 19 +++++++++++++++ nuget/SkiaSharp.Views.Gtk2.nuspec | 1 + nuget/SkiaSharp.Views.Gtk3.nuspec | 1 + ...p.Views.Maui.Controls.Compatibility.nuspec | 5 ++++ nuget/SkiaSharp.Views.Maui.Controls.nuspec | 5 ++++ nuget/SkiaSharp.Views.Maui.Core.nuspec | 5 ++++ nuget/SkiaSharp.Views.Uno.nuspec | 6 +++++ nuget/SkiaSharp.Views.WPF.nuspec | 2 ++ nuget/SkiaSharp.Views.WinUI.nuspec | 1 + nuget/SkiaSharp.Views.WindowsForms.nuspec | 2 ++ nuget/SkiaSharp.Views.nuspec | 13 ++++++++++ nuget/SkiaSharp.Vulkan.SharpVk.nuspec | 1 + nuget/SkiaSharp.nuspec | 16 +++++++++++++ scripts/azure-templates-bootstrapper.yml | 24 +++++++++---------- .../SkiaSharp.Views.UWP.csproj | 8 +++---- 22 files changed, 134 insertions(+), 32 deletions(-) diff --git a/binding/HarfBuzzSharp.UWP/HarfBuzzSharp.UWP.csproj b/binding/HarfBuzzSharp.UWP/HarfBuzzSharp.UWP.csproj index 2a3e5eed94..4ceef30de4 100644 --- a/binding/HarfBuzzSharp.UWP/HarfBuzzSharp.UWP.csproj +++ b/binding/HarfBuzzSharp.UWP/HarfBuzzSharp.UWP.csproj @@ -10,10 +10,10 @@ - - - - + + + + diff --git a/binding/SkiaSharp.UWP/SkiaSharp.UWP.csproj b/binding/SkiaSharp.UWP/SkiaSharp.UWP.csproj index 9895267c0c..7ff892527e 100644 --- a/binding/SkiaSharp.UWP/SkiaSharp.UWP.csproj +++ b/binding/SkiaSharp.UWP/SkiaSharp.UWP.csproj @@ -9,18 +9,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/nuget/HarfbuzzSharp.nuspec b/nuget/HarfbuzzSharp.nuspec index b613a725c5..172a82f3dd 100644 --- a/nuget/HarfbuzzSharp.nuspec +++ b/nuget/HarfbuzzSharp.nuspec @@ -73,36 +73,52 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + + + + + + + + + diff --git a/nuget/SkiaSharp.HarfBuzz.nuspec b/nuget/SkiaSharp.HarfBuzz.nuspec index cd05c93ff4..24b72250af 100644 --- a/nuget/SkiaSharp.HarfBuzz.nuspec +++ b/nuget/SkiaSharp.HarfBuzz.nuspec @@ -46,10 +46,13 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + diff --git a/nuget/SkiaSharp.Views.Desktop.Common.nuspec b/nuget/SkiaSharp.Views.Desktop.Common.nuspec index 8539bf47bd..fd2709ef80 100644 --- a/nuget/SkiaSharp.Views.Desktop.Common.nuspec +++ b/nuget/SkiaSharp.Views.Desktop.Common.nuspec @@ -46,10 +46,13 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + diff --git a/nuget/SkiaSharp.Views.Forms.GTK.nuspec b/nuget/SkiaSharp.Views.Forms.GTK.nuspec index 8731c9f8ae..bda4949cae 100644 --- a/nuget/SkiaSharp.Views.Forms.GTK.nuspec +++ b/nuget/SkiaSharp.Views.Forms.GTK.nuspec @@ -43,6 +43,7 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + diff --git a/nuget/SkiaSharp.Views.Forms.WPF.nuspec b/nuget/SkiaSharp.Views.Forms.WPF.nuspec index 1c3cb5352e..785bd5a658 100644 --- a/nuget/SkiaSharp.Views.Forms.WPF.nuspec +++ b/nuget/SkiaSharp.Views.Forms.WPF.nuspec @@ -56,8 +56,10 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + diff --git a/nuget/SkiaSharp.Views.Forms.nuspec b/nuget/SkiaSharp.Views.Forms.nuspec index 616e109a29..c000404e09 100644 --- a/nuget/SkiaSharp.Views.Forms.nuspec +++ b/nuget/SkiaSharp.Views.Forms.nuspec @@ -29,30 +29,37 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + @@ -107,32 +114,44 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + + + + + diff --git a/nuget/SkiaSharp.Views.Gtk2.nuspec b/nuget/SkiaSharp.Views.Gtk2.nuspec index 90e3b7dd47..7bf6c2642d 100644 --- a/nuget/SkiaSharp.Views.Gtk2.nuspec +++ b/nuget/SkiaSharp.Views.Gtk2.nuspec @@ -38,6 +38,7 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + diff --git a/nuget/SkiaSharp.Views.Gtk3.nuspec b/nuget/SkiaSharp.Views.Gtk3.nuspec index 0495807ac1..dcc0210c42 100644 --- a/nuget/SkiaSharp.Views.Gtk3.nuspec +++ b/nuget/SkiaSharp.Views.Gtk3.nuspec @@ -39,6 +39,7 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + diff --git a/nuget/SkiaSharp.Views.Maui.Controls.Compatibility.nuspec b/nuget/SkiaSharp.Views.Maui.Controls.Compatibility.nuspec index df0701e153..266832f203 100644 --- a/nuget/SkiaSharp.Views.Maui.Controls.Compatibility.nuspec +++ b/nuget/SkiaSharp.Views.Maui.Controls.Compatibility.nuspec @@ -49,10 +49,15 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + diff --git a/nuget/SkiaSharp.Views.Maui.Controls.nuspec b/nuget/SkiaSharp.Views.Maui.Controls.nuspec index 92e181f4c4..ce2e24db0b 100644 --- a/nuget/SkiaSharp.Views.Maui.Controls.nuspec +++ b/nuget/SkiaSharp.Views.Maui.Controls.nuspec @@ -49,10 +49,15 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + diff --git a/nuget/SkiaSharp.Views.Maui.Core.nuspec b/nuget/SkiaSharp.Views.Maui.Core.nuspec index 4369369b1d..e7c8d80b70 100644 --- a/nuget/SkiaSharp.Views.Maui.Core.nuspec +++ b/nuget/SkiaSharp.Views.Maui.Core.nuspec @@ -53,10 +53,15 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + diff --git a/nuget/SkiaSharp.Views.Uno.nuspec b/nuget/SkiaSharp.Views.Uno.nuspec index 437a395e02..c6ffca8ca7 100644 --- a/nuget/SkiaSharp.Views.Uno.nuspec +++ b/nuget/SkiaSharp.Views.Uno.nuspec @@ -56,16 +56,22 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + diff --git a/nuget/SkiaSharp.Views.WPF.nuspec b/nuget/SkiaSharp.Views.WPF.nuspec index 43f1257a2a..df8934fa19 100644 --- a/nuget/SkiaSharp.Views.WPF.nuspec +++ b/nuget/SkiaSharp.Views.WPF.nuspec @@ -42,8 +42,10 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + diff --git a/nuget/SkiaSharp.Views.WinUI.nuspec b/nuget/SkiaSharp.Views.WinUI.nuspec index 9537cccc23..5bf28d1ce2 100644 --- a/nuget/SkiaSharp.Views.WinUI.nuspec +++ b/nuget/SkiaSharp.Views.WinUI.nuspec @@ -38,6 +38,7 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + diff --git a/nuget/SkiaSharp.Views.WindowsForms.nuspec b/nuget/SkiaSharp.Views.WindowsForms.nuspec index 2e331c474d..6062579301 100644 --- a/nuget/SkiaSharp.Views.WindowsForms.nuspec +++ b/nuget/SkiaSharp.Views.WindowsForms.nuspec @@ -46,8 +46,10 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + diff --git a/nuget/SkiaSharp.Views.nuspec b/nuget/SkiaSharp.Views.nuspec index 498a87e4e0..dbe44ed74e 100644 --- a/nuget/SkiaSharp.Views.nuspec +++ b/nuget/SkiaSharp.Views.nuspec @@ -77,30 +77,43 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + + + + + + diff --git a/nuget/SkiaSharp.Vulkan.SharpVk.nuspec b/nuget/SkiaSharp.Vulkan.SharpVk.nuspec index c14d7e142c..55a7d3ef19 100644 --- a/nuget/SkiaSharp.Vulkan.SharpVk.nuspec +++ b/nuget/SkiaSharp.Vulkan.SharpVk.nuspec @@ -38,6 +38,7 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + diff --git a/nuget/SkiaSharp.nuspec b/nuget/SkiaSharp.nuspec index 5d147fcbec..60e08dd5c0 100644 --- a/nuget/SkiaSharp.nuspec +++ b/nuget/SkiaSharp.nuspec @@ -93,36 +93,52 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + + + + + + + + + diff --git a/scripts/azure-templates-bootstrapper.yml b/scripts/azure-templates-bootstrapper.yml index 3562f0a149..b99e3dc135 100644 --- a/scripts/azure-templates-bootstrapper.yml +++ b/scripts/azure-templates-bootstrapper.yml @@ -16,7 +16,7 @@ parameters: condition: succeeded() # whether or not to run this template shouldPublish: true # whether or not to publish the artifacts configuration: $(CONFIGURATION) # the build configuration - buildExternals: '' # the build number to download externals from + buildExternals: '5109878' # the build number to download externals from verbosity: $(VERBOSITY) # the level of verbosity to use when building docker: '' # the Docker image to build and use dockerArgs: '' # any additional arguments to pass to docker build @@ -30,18 +30,18 @@ parameters: artifactName: '' # the name of the artifact to merge this run into jobs: -# - ${{ if and(ne(parameters.buildExternals, ''), startsWith(parameters.name, 'native_')) }}: -# - template: azure-templates-download.yml -# parameters: -# name: ${{ parameters.name }} -# displayName: ${{ parameters.displayName }} -# vmImage: ${{ parameters.vmImage }} -# condition: ${{ parameters.condition }} -# postBuildSteps: ${{ parameters.postBuildSteps }} -# buildExternals: ${{ parameters.buildExternals }} -# artifactName: ${{ parameters.artifactName }} +- ${{ if and(ne(parameters.buildExternals, ''), startsWith(parameters.name, 'native_')) }}: + - template: azure-templates-download.yml + parameters: + name: ${{ parameters.name }} + displayName: ${{ parameters.displayName }} + vmImage: ${{ parameters.vmImage }} + condition: ${{ parameters.condition }} + postBuildSteps: ${{ parameters.postBuildSteps }} + buildExternals: ${{ parameters.buildExternals }} + artifactName: ${{ parameters.artifactName }} -# - ${{ if or(eq(parameters.buildExternals, ''), not(startsWith(parameters.name, 'native_'))) }}: +- ${{ if or(eq(parameters.buildExternals, ''), not(startsWith(parameters.name, 'native_'))) }}: - job: ${{ parameters.name }} displayName: ${{ parameters.displayName }} timeoutInMinutes: 120 diff --git a/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SkiaSharp.Views.UWP.csproj b/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SkiaSharp.Views.UWP.csproj index 8c8917ed3c..4dccf918a4 100644 --- a/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SkiaSharp.Views.UWP.csproj +++ b/source/SkiaSharp.Views/SkiaSharp.Views.UWP/SkiaSharp.Views.UWP.csproj @@ -10,10 +10,10 @@ - - - - + + + + From 87bccabe9ce063634c39317f71640f3750f055f8 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 19 Aug 2021 22:59:36 +0200 Subject: [PATCH 2/6] Deterministic --- source/SkiaSharp.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/source/SkiaSharp.Build.props b/source/SkiaSharp.Build.props index 84df9a5674..0d4fe3bd40 100644 --- a/source/SkiaSharp.Build.props +++ b/source/SkiaSharp.Build.props @@ -26,6 +26,7 @@ portable + true true True From b53c292fd659f111edce3846327e5f266255881b Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 20 Aug 2021 02:58:00 +0200 Subject: [PATCH 3/6] Add source info --- build.cake | 32 +++++++++++++++++++++++++++++++- scripts/azure-pipelines.yml | 3 ++- source/SkiaSharp.Build.props | 5 ++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/build.cake b/build.cake index fce5896429..2598c9c8ef 100644 --- a/build.cake +++ b/build.cake @@ -52,7 +52,8 @@ var PREVIEW_LABEL = Argument ("previewLabel", EnvironmentVariable ("PREVIEW_LABE var FEATURE_NAME = EnvironmentVariable ("FEATURE_NAME") ?? ""; var BUILD_NUMBER = Argument ("buildNumber", EnvironmentVariable ("BUILD_NUMBER") ?? "0"); var GIT_SHA = Argument ("gitSha", EnvironmentVariable ("GIT_SHA") ?? ""); -var GIT_BRANCH_NAME = Argument ("gitBranch", EnvironmentVariable ("GIT_BRANCH_NAME") ?? ""); +var GIT_BRANCH_NAME = Argument ("gitBranch", EnvironmentVariable ("GIT_BRANCH_NAME") ?? ""). Replace ("refs/heads/", ""); +var GIT_URL = Argument ("gitUrl", EnvironmentVariable ("GIT_URL") ?? ""); var PREVIEW_NUGET_SUFFIX = string.IsNullOrEmpty (BUILD_NUMBER) ? $"{PREVIEW_LABEL}" @@ -107,6 +108,14 @@ 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); +Information($" {"BUILD_NUMBER".PadRight(30)} {{0}}", BUILD_NUMBER); +Information($" {"GIT_SHA".PadRight(30)} {{0}}", GIT_SHA); +Information($" {"GIT_BRANCH_NAME".PadRight(30)} {{0}}", GIT_BRANCH_NAME); +Information($" {"GIT_URL".PadRight(30)} {{0}}", GIT_URL); + #load "cake/msbuild.cake" #load "cake/UtilsManaged.cake" #load "cake/externals.cake" @@ -600,6 +609,27 @@ Task ("nuget-normal") } } + // + var repository = metadata.Element ("repository"); + if (repository == null) { + repository = new XElement ("repository"); + metadata.Add (repository); + } + repository.SetAttributeValue ("type", "git"); + repository.SetAttributeValue ("url", GIT_URL); + repository.SetAttributeValue ("branch", GIT_BRANCH_NAME); + repository.SetAttributeValue ("commit", GIT_SHA); + + // + if (id != null && version != null) { + var v = GetVersion (id.Value); + if (!string.IsNullOrEmpty (v)) { + if (id.Value.StartsWith("SkiaSharp") || id.Value.StartsWith("HarfBuzzSharp")) + v += suffix; + version.Value = v; + } + } + // var dependencies = metadata .Elements ("dependencies") diff --git a/scripts/azure-pipelines.yml b/scripts/azure-pipelines.yml index 1a17b00eb5..66978b4951 100644 --- a/scripts/azure-pipelines.yml +++ b/scripts/azure-pipelines.yml @@ -14,7 +14,8 @@ variables: FEATURE_NAME_PREFIX: 'feature/' VERBOSITY: normal GIT_SHA: $(Build.SourceVersion) - GIT_BRANCH_NAME: $(Build.SourceBranchName) + GIT_BRANCH_NAME: $(Build.SourceBranch) + GIT_URL: $(Build.Repository.Uri) FEATURE_NAME: '' PREVIEW_LABEL: 'preview' BUILD_NUMBER: $[counter(format('_{0}_{1}_{2}__', variables['SKIASHARP_VERSION'], variables['Build.SourceBranch'], variables['PREVIEW_LABEL']), 1)] diff --git a/source/SkiaSharp.Build.props b/source/SkiaSharp.Build.props index 0d4fe3bd40..7cce78357a 100644 --- a/source/SkiaSharp.Build.props +++ b/source/SkiaSharp.Build.props @@ -26,11 +26,14 @@ portable - true true True + + true + + $(DefineConstants);THROW_OBJECT_EXCEPTIONS From b27fcc01fc1f948ac41c554689aea316b6050e01 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 20 Aug 2021 04:00:29 +0200 Subject: [PATCH 4/6] fix the issue on older compilers --- source/SkiaSharp.Build.targets | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/SkiaSharp.Build.targets b/source/SkiaSharp.Build.targets index 8334c582a6..f7bd4292e1 100644 --- a/source/SkiaSharp.Build.targets +++ b/source/SkiaSharp.Build.targets @@ -69,6 +69,13 @@ + + + + + - +