Skip to content

Commit

Permalink
Add Nano Server to the list
Browse files Browse the repository at this point in the history
Fixes #676
  • Loading branch information
mattleibow committed Nov 17, 2019
1 parent e640669 commit 33a68a5
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 19 deletions.
2 changes: 2 additions & 0 deletions VERSIONS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
28 changes: 15 additions & 13 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Version> {
{ "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"
Expand Down
8 changes: 4 additions & 4 deletions cake/BuildExternals.cake
Original file line number Diff line number Diff line change
@@ -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}",
Expand Down
2 changes: 1 addition & 1 deletion externals/skia
Submodule skia updated 1 files
+1 −1 src/xps/SkXPSDevice.cpp
51 changes: 51 additions & 0 deletions nuget/HarfbuzzSharp.NativeAssets.NanoServer.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>

<!-- package -->
<id>HarfBuzzSharp.NativeAssets.NanoServer</id>
<title>HarfBuzzSharp - Native Assets for Microsoft Nano Server</title>
<version>1.0.0</version>
<description>
HarfBuzzSharp is a cross-platform OpenType text shaping engine for .NET platforms.
</description>
<summary>
HarfBuzzSharp is a cross-platform OpenType text shaping engine for .NET platforms.
</summary>
<releaseNotes>
Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release notes.
</releaseNotes>
<projectUrl>https://go.microsoft.com/fwlink/?linkid=868515</projectUrl>
<iconUrl>https://go.microsoft.com/fwlink/?linkid=868516</iconUrl>
<tags>xamarin text harfbuzz ios android linux windows uwp tvos macos tizen cross-platform harfbuzzsharp</tags>

<!-- legal -->
<licenseUrl>https://go.microsoft.com/fwlink/?linkid=868514</licenseUrl>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>

<dependencies>
<dependency id="HarfBuzzSharp" version="1.0.0" />
</dependencies>

</metadata>
<files>

<!-- the build bits -->
<file src="build/net45/HarfBuzzSharp.targets" target="build/net45/HarfBuzzSharp.NativeAssets.NanoServer.targets" />

<!-- harfbuzz.dll and other native files -->
<file platform="windows" src="runtimes/win-x64/native/libHarfBuzzSharp.dll" />

<!-- placeholders -->
<file src="_._" target="lib/net45/_._" />
<file src="_._" target="lib/netstandard/_._" />

<!-- legal -->
<file src="LICENSE.txt" />
<file src="THIRD-PARTY-NOTICES.txt" />

</files>
</package>
52 changes: 52 additions & 0 deletions nuget/SkiaSharp.NativeAssets.NanoServer.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>

<!-- package -->
<id>SkiaSharp.NativeAssets.NanoServer</id>
<title>SkiaSharp - Native Assets for Microsoft Nano Server</title>
<version>1.0.0</version>
<description>
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.
</description>
<summary>
SkiaSharp is a cross-platform 2D graphics API for .NET platforms that can be used across mobile, server and desktop models to render images.
</summary>
<releaseNotes>
Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release notes.
</releaseNotes>
<projectUrl>https://go.microsoft.com/fwlink/?linkid=868515</projectUrl>
<iconUrl>https://go.microsoft.com/fwlink/?linkid=868516</iconUrl>
<tags>xamarin graphics ios android linux windows uwp tvos watchos macos tizen cross-platform skiasharp</tags>

<!-- legal -->
<licenseUrl>https://go.microsoft.com/fwlink/?linkid=868514</licenseUrl>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>

<dependencies>
<dependency id="SkiaSharp" version="1.0.0" />
</dependencies>

</metadata>
<files>

<!-- the build bits -->
<file src="build/net45/SkiaSharp.targets" target="build/net45/SkiaSharp.NativeAssets.NanoServer.targets" />

<!-- libSkiaSharp.dll and other native files -->
<file platform="windows" src="runtimes/win-x64/native/libSkiaSharp.dll" />

<!-- placeholders -->
<file src="_._" target="lib/net45/_._" />
<file src="_._" target="lib/netstandard/_._" />

<!-- legal -->
<file src="LICENSE.txt" />
<file src="THIRD-PARTY-NOTICES.txt" />

</files>
</package>
68 changes: 67 additions & 1 deletion scripts/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }
Expand All @@ -330,6 +389,7 @@ stages:
displayName: Combine Packaged NuGets
dependsOn:
- package_nodependencies_windows
- package_nanoserver_windows
- package_windows
pool:
name: $(VM_IMAGE_LINUX)
Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 33a68a5

Please sign in to comment.