Skip to content

Commit

Permalink
Add build infrastructure for .NET 7 (#2255)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow authored Sep 30, 2022
1 parent 1385a7f commit 20a1180
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 52 deletions.
22 changes: 11 additions & 11 deletions binding/HarfBuzzSharp/HarfBuzzSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
<DefineConstants>$(DefineConstants);USE_DELEGATES</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard2'))">
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard2.0'))">
<!-- macOS -->
<None Include="..\..\output\native\osx\libHarfBuzzSharp*" Link="nuget\runtimes\osx\native\%(Filename)%(Extension)" />
<!-- Windows -->
Expand Down Expand Up @@ -53,31 +53,31 @@
<None Include="..\..\output\native\android\x86_64\libHarfBuzzSharp*" Link="nuget\runtimes\android-x64\native\%(Filename)%(Extension)" />
<None Include="..\..\output\native\android\armeabi-v7a\libHarfBuzzSharp*" Link="nuget\runtimes\android-arm\native\%(Filename)%(Extension)" />
<None Include="..\..\output\native\android\arm64-v8a\libHarfBuzzSharp*" Link="nuget\runtimes\android-arm64\native\%(Filename)%(Extension)" />
<None Include="nuget\build\android\HarfBuzzSharp.targets" Link="nuget\build\net6.0-android\HarfBuzzSharp.targets" />
<None Include="nuget\build\android\HarfBuzzSharp.Local.targets" Link="nuget\build\net6.0-android\HarfBuzzSharp.Local.targets" />
<None Include="nuget\build\android\HarfBuzzSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-android\HarfBuzzSharp.targets" />
<None Include="nuget\build\android\HarfBuzzSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-android\HarfBuzzSharp.Local.targets" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
<!-- iOS -->
<None Include="..\..\output\native\ios\libHarfBuzzSharp.framework\**" Link="nuget\runtimes\ios\native\libHarfBuzzSharp.framework\%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="nuget\build\ios\HarfBuzzSharp.targets" Link="nuget\build\net6.0-ios\HarfBuzzSharp.targets" />
<None Include="nuget\build\ios\HarfBuzzSharp.Local.targets" Link="nuget\build\net6.0-ios\HarfBuzzSharp.Local.targets" />
<None Include="nuget\build\ios\HarfBuzzSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-ios\HarfBuzzSharp.targets" />
<None Include="nuget\build\ios\HarfBuzzSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-ios\HarfBuzzSharp.Local.targets" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-maccatalyst'))">
<!-- Mac Catalyst -->
<None Include="nuget\build\maccatalyst\HarfBuzzSharp.targets" Link="nuget\build\net6.0-maccatalyst\HarfBuzzSharp.targets" />
<None Include="nuget\build\maccatalyst\HarfBuzzSharp.Local.targets" Link="nuget\build\net6.0-maccatalyst\HarfBuzzSharp.Local.targets" />
<None Include="nuget\build\maccatalyst\HarfBuzzSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-maccatalyst\HarfBuzzSharp.targets" />
<None Include="nuget\build\maccatalyst\HarfBuzzSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-maccatalyst\HarfBuzzSharp.Local.targets" />
<None Include="..\..\output\native\maccatalyst\libHarfBuzzSharp*.framework.zip" Link="nuget\runtimes\maccatalyst\native\%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-tvos'))">
<!-- tvOS -->
<None Include="..\..\output\native\tvos\libHarfBuzzSharp.framework\**" Link="nuget\runtimes\tvos\native\libHarfBuzzSharp.framework\%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="nuget\build\tvos\HarfBuzzSharp.targets" Link="nuget\build\net6.0-tvos\HarfBuzzSharp.targets" />
<None Include="nuget\build\tvos\HarfBuzzSharp.Local.targets" Link="nuget\build\net6.0-tvos\HarfBuzzSharp.Local.targets" />
<None Include="nuget\build\tvos\HarfBuzzSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-tvos\HarfBuzzSharp.targets" />
<None Include="nuget\build\tvos\HarfBuzzSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-tvos\HarfBuzzSharp.Local.targets" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-macos'))">
<!-- macOS -->
<None Include="nuget\build\macos\HarfBuzzSharp.targets" Link="nuget\build\net6.0-macos\HarfBuzzSharp.targets" />
<None Include="nuget\build\macos\HarfBuzzSharp.Local.targets" Link="nuget\build\net6.0-macos\HarfBuzzSharp.Local.targets" />
<None Include="nuget\build\macos\HarfBuzzSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-macos\HarfBuzzSharp.targets" />
<None Include="nuget\build\macos\HarfBuzzSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-macos\HarfBuzzSharp.Local.targets" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Binding.Shared\**\*.cs" Link="%(RecursiveDir)%(Filename)%(Extension)" />
Expand Down
30 changes: 15 additions & 15 deletions binding/SkiaSharp/SkiaSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
<DefineConstants>$(DefineConstants);USE_DELEGATES</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard2'))">
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard2.0'))">
<!-- macOS -->
<None Include="..\..\output\native\osx\libSkiaSharp*" Link="nuget\runtimes\osx\native\%(Filename)%(Extension)" />
<!-- Windows -->
Expand Down Expand Up @@ -52,38 +52,38 @@
<None Include="..\..\output\native\android\x86_64\libSkiaSharp*" Link="nuget\runtimes\android-x64\native\%(Filename)%(Extension)" />
<None Include="..\..\output\native\android\armeabi-v7a\libSkiaSharp*" Link="nuget\runtimes\android-arm\native\%(Filename)%(Extension)" />
<None Include="..\..\output\native\android\arm64-v8a\libSkiaSharp*" Link="nuget\runtimes\android-arm64\native\%(Filename)%(Extension)" />
<None Include="nuget\build\android\SkiaSharp.targets" Link="nuget\build\net6.0-android\SkiaSharp.targets" />
<None Include="nuget\build\android\SkiaSharp.Local.targets" Link="nuget\build\net6.0-android\SkiaSharp.Local.targets" />
<None Include="nuget\build\android\SkiaSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-android\SkiaSharp.targets" />
<None Include="nuget\build\android\SkiaSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-android\SkiaSharp.Local.targets" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
<!-- iOS -->
<None Include="..\..\output\native\ios\libSkiaSharp.framework\**" Link="nuget\runtimes\ios\native\libSkiaSharp.framework\%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="nuget\build\ios\SkiaSharp.targets" Link="nuget\build\net6.0-ios\SkiaSharp.targets" />
<None Include="nuget\build\ios\SkiaSharp.Local.targets" Link="nuget\build\net6.0-ios\SkiaSharp.Local.targets" />
<None Include="nuget\build\ios\SkiaSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-ios\SkiaSharp.targets" />
<None Include="nuget\build\ios\SkiaSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-ios\SkiaSharp.Local.targets" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-maccatalyst'))">
<!-- Mac Catalyst -->
<None Include="nuget\build\maccatalyst\SkiaSharp.targets" Link="nuget\build\net6.0-maccatalyst\SkiaSharp.targets" />
<None Include="nuget\build\maccatalyst\SkiaSharp.Local.targets" Link="nuget\build\net6.0-maccatalyst\SkiaSharp.Local.targets" />
<None Include="nuget\build\maccatalyst\SkiaSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-maccatalyst\SkiaSharp.targets" />
<None Include="nuget\build\maccatalyst\SkiaSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-maccatalyst\SkiaSharp.Local.targets" />
<None Include="..\..\output\native\maccatalyst\libSkiaSharp*.framework.zip" Link="nuget\runtimes\maccatalyst\native\%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-tvos'))">
<!-- tvOS -->
<None Include="..\..\output\native\tvos\libSkiaSharp.framework\**" Link="nuget\runtimes\tvos\native\libSkiaSharp.framework\%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="nuget\build\tvos\SkiaSharp.targets" Link="nuget\build\net6.0-tvos\SkiaSharp.targets" />
<None Include="nuget\build\tvos\SkiaSharp.Local.targets" Link="nuget\build\net6.0-tvos\SkiaSharp.Local.targets" />
<None Include="nuget\build\tvos\SkiaSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-tvos\SkiaSharp.targets" />
<None Include="nuget\build\tvos\SkiaSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-tvos\SkiaSharp.Local.targets" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-macos'))">
<!-- macOS -->
<None Include="nuget\build\macos\SkiaSharp.targets" Link="nuget\build\net6.0-macos\SkiaSharp.targets" />
<None Include="nuget\build\macos\SkiaSharp.Local.targets" Link="nuget\build\net6.0-macos\SkiaSharp.Local.targets" />
<None Include="nuget\build\macos\SkiaSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-macos\SkiaSharp.targets" />
<None Include="nuget\build\macos\SkiaSharp.Local.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-macos\SkiaSharp.Local.targets" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-tizen'))">
<!-- Tizen -->
<None Include="..\..\output\native\tizen\armel\libSkiaSharp.*" Link="nuget\build\net6.0-tizen\arm\%(Filename)%(Extension)" />
<None Include="..\..\output\native\tizen\i386\libSkiaSharp.*" Link="nuget\build\net6.0-tizen\x86\%(Filename)%(Extension)" />
<None Include="nuget\build\tizen40\SkiaSharp.targets" Link="nuget\build\net6.0-tizen\SkiaSharp.targets" />
<None Include="nuget\build\tizen40\SkiaSharp.targets" Link="nuget\build\net6.0-tizen\SkiaSharp.Local.targets" />
<None Include="..\..\output\native\tizen\armel\libSkiaSharp.*" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-tizen\arm\%(Filename)%(Extension)" />
<None Include="..\..\output\native\tizen\i386\libSkiaSharp.*" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-tizen\x86\%(Filename)%(Extension)" />
<None Include="nuget\build\tizen40\SkiaSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-tizen\SkiaSharp.targets" />
<None Include="nuget\build\tizen40\SkiaSharp.targets" Link="nuget\build\net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-tizen\SkiaSharp.Local.targets" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Binding.Shared\**\*.cs" Link="%(RecursiveDir)%(Filename)%(Extension)" />
Expand Down
10 changes: 5 additions & 5 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ Task ("libs")
platform = ".Linux";
}
var net6 = $"./source/SkiaSharpSource{platform}-net6.slnf";
var net = $"./source/SkiaSharpSource{platform}-net.slnf";
var netfx = $"./source/SkiaSharpSource{platform}-netfx.slnf";
if (FileExists (net6) || FileExists (netfx)) {
if (FileExists (net6) && (string.IsNullOrEmpty(SOLUTION_TYPE) || SOLUTION_TYPE == "net6"))
RunMSBuild (net6, properties: new Dictionary<string, string> { { "BuildingForNet6", "true" } });
if (FileExists (net) || FileExists (netfx)) {
if (FileExists (net) && (string.IsNullOrEmpty(SOLUTION_TYPE) || SOLUTION_TYPE == "net"))
RunMSBuild (net, properties: new Dictionary<string, string> { { "BuildingForDotNet", "true" } });
if (FileExists (netfx) && (string.IsNullOrEmpty(SOLUTION_TYPE) || SOLUTION_TYPE == "netfx"))
RunMSBuild (netfx, properties: new Dictionary<string, string> { { "BuildingForNet6", "false" } });
RunMSBuild (netfx, properties: new Dictionary<string, string> { { "BuildingForDotNet", "false" } });
} else {
var slnf = $"./source/SkiaSharpSource{platform}.slnf";
var sln = $"./source/SkiaSharpSource{platform}.sln";
Expand Down
2 changes: 1 addition & 1 deletion cake/UtilsManaged.cake
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ IEnumerable<(DirectoryPath path, string platform)> GetPlatformDirectories(Direct
// try find any cross-platform frameworks
foreach (var dir in platformDirs) {
var d = dir.GetDirectoryName().ToLower();
if (d.StartsWith("netstandard") || d.StartsWith("portable") || d.Equals("net6.0")) {
if (d.StartsWith("netstandard") || d.StartsWith("portable") || d.Equals("net6.0") || d.Equals("net7.0")) {
// we just want this single platform
yield return (dir, null);
yield break;
Expand Down
4 changes: 2 additions & 2 deletions scripts/azure-templates-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,12 @@ stages:
displayName: Delete the native folder
- template: azure-templates-bootstrapper.yml # Build Managed .NET (Windows)
parameters:
name: managed_net6_windows
name: managed_net_windows
displayName: Managed .NET (Windows)
buildPipelineType: ${{ parameters.buildPipelineType }}
vmImage: ${{ parameters.VM_IMAGE_WINDOWS}}
target: libs
additionalArgs: --skipExternals="all" --solutionType=net6
additionalArgs: --skipExternals="all" --solutionType=net
installPreviewVs: true
requiredArtifacts:
- name: native
Expand Down
3 changes: 3 additions & 0 deletions scripts/install-dotnet-workloads.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ Param(
$ErrorActionPreference = 'Stop'

$previewFeed = 'https://api.nuget.org/v3/index.json'
$previewNextFeed = 'https://api.nuget.org/v3/index.json'
$previewRuntime = 'https://api.nuget.org/v3/index.json'
$previewEmscripten = 'https://api.nuget.org/v3/index.json'
if ($IsPreview) {
$previewFeed = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json'
$previewNextFeed = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json'
$previewRuntime = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-531f715f/nuget/v3/index.json'
$previewEmscripten = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-3f6c45a2/nuget/v3/index.json'
}
Expand All @@ -21,6 +23,7 @@ Write-Host "Installing .NET workloads..."
--from-rollback-file $SourceUrl `
--source https://api.nuget.org/v3/index.json `
--source $previewFeed `
--source $previewNextFeed `
--source $previewRuntime `
--source $previewEmscripten `
--skip-sign-check
Expand Down
Loading

0 comments on commit 20a1180

Please sign in to comment.