diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index c4ec4ffc7a..9dd8678ca7 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "dotnet-reportgenerator-globaltool": { - "version": "5.0.4", + "version": "5.1.19", "commands": [ "reportgenerator" ] diff --git a/cake/xcode.cake b/cake/xcode.cake index e037c2b417..d852b5552b 100644 --- a/cake/xcode.cake +++ b/cake/xcode.cake @@ -1,6 +1,6 @@ #addin nuget:?package=Cake.XCode&version=5.0.0 -void RunXCodeBuild(FilePath project, string scheme, string sdk, string arch, string platform = null) +void RunXCodeBuild(FilePath project, string scheme, string sdk, string arch, string platform = null, Dictionary properties = null) { var dir = project.GetDirectory(); @@ -21,6 +21,11 @@ void RunXCodeBuild(FilePath project, string scheme, string sdk, string arch, str if (platform != null) { settings.BuildSettings["PLATFORM"] = platform; } + if (properties != null) { + foreach (var prop in properties) { + settings.BuildSettings[prop.Key] = prop.Value; + } + } XCodeBuild(settings); } diff --git a/native/ios/build.cake b/native/ios/build.cake index 8a3f3e51bf..0402c0c439 100644 --- a/native/ios/build.cake +++ b/native/ios/build.cake @@ -4,25 +4,36 @@ DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native")); #load "../../cake/native-shared.cake" #load "../../cake/xcode.cake" -string VARIANT = BUILD_VARIANT ?? "ios"; +string VARIANT = (BUILD_VARIANT ?? "ios").ToLower(); +string DEPLOYMENT_SDK = VARIANT == "maccatalyst" ? "[sdk=macosx*]" : ""; + +DirectoryPath OUTPUT_VARIANT_PATH = OUTPUT_PATH.Combine(VARIANT); + +string GetDeploymentTarget(string arch) +{ + switch (VARIANT) { + case "maccatalyst": return "13.0"; + default: return "8.0"; + } +} Task("libSkiaSharp") .IsDependentOn("git-sync-deps") .WithCriteria(IsRunningOnMacOs()) .Does(() => { - if (VARIANT.ToLower() == "ios") { + if (VARIANT == "ios") { Build("iphonesimulator", "i386", "x86"); Build("iphonesimulator", "x86_64", "x64"); Build("iphoneos", "armv7", "arm"); Build("iphoneos", "arm64", "arm64"); - CreateFatFramework(OUTPUT_PATH.Combine("ios/libSkiaSharp")); - } else if (VARIANT.ToLower() == "maccatalyst") { + CreateFatFramework(OUTPUT_VARIANT_PATH.Combine("libSkiaSharp")); + } else if (VARIANT == "maccatalyst") { Build("macosx", "x86_64", "x64"); Build("macosx", "arm64", "arm64"); - CreateFatVersionedFramework(OUTPUT_PATH.Combine("maccatalyst/libSkiaSharp")); + CreateFatVersionedFramework(OUTPUT_VARIANT_PATH.Combine("libSkiaSharp")); } void Build(string sdk, string arch, string skiaArch) @@ -32,6 +43,7 @@ Task("libSkiaSharp") GnNinja($"{VARIANT}/{arch}", "skia modules/skottie", $"target_cpu='{skiaArch}' " + $"target_os='{VARIANT}' " + + $"min_{VARIANT}_version='{GetDeploymentTarget(arch)}' " + $"skia_use_icu=false " + $"skia_use_metal={(sdk == "macosx" ? "false" : "true")} " + $"skia_use_piex=true " + @@ -42,9 +54,12 @@ Task("libSkiaSharp") $"skia_use_system_libwebp=false " + $"skia_use_system_zlib=false " + $"skia_enable_skottie=true " + - $"extra_cflags=[ '-DSKIA_C_DLL', '-DHAVE_ARC4RANDOM_BUF' ] "); + $"extra_cflags=[ '-DSKIA_C_DLL', '-DHAVE_ARC4RANDOM_BUF' ] " + + ADDITIONAL_GN_ARGS); - RunXCodeBuild("libSkiaSharp/libSkiaSharp.xcodeproj", "libSkiaSharp", sdk, arch, platform: VARIANT); + RunXCodeBuild("libSkiaSharp/libSkiaSharp.xcodeproj", "libSkiaSharp", sdk, arch, platform: VARIANT, properties: new Dictionary { + { $"IPHONEOS_DEPLOYMENT_TARGET{DEPLOYMENT_SDK}", GetDeploymentTarget(arch) }, + }); SafeCopy( $"libSkiaSharp/bin/{CONFIGURATION}/{sdk}/{arch}.xcarchive", @@ -56,25 +71,27 @@ Task("libHarfBuzzSharp") .WithCriteria(IsRunningOnMacOs()) .Does(() => { - if (VARIANT.ToLower() == "ios") { + if (VARIANT == "ios") { Build("iphonesimulator", "i386"); Build("iphonesimulator", "x86_64"); Build("iphoneos", "armv7"); Build("iphoneos", "arm64"); - CreateFatFramework(OUTPUT_PATH.Combine("ios/libHarfBuzzSharp")); - } else if (VARIANT.ToLower() == "maccatalyst") { + CreateFatFramework(OUTPUT_VARIANT_PATH.Combine("libHarfBuzzSharp")); + } else if (VARIANT == "maccatalyst") { Build("macosx", "x86_64"); Build("macosx", "arm64"); - CreateFatVersionedFramework(OUTPUT_PATH.Combine("maccatalyst/libHarfBuzzSharp")); + CreateFatVersionedFramework(OUTPUT_VARIANT_PATH.Combine("libHarfBuzzSharp")); } void Build(string sdk, string arch) { if (Skip(arch)) return; - RunXCodeBuild("libHarfBuzzSharp/libHarfBuzzSharp.xcodeproj", "libHarfBuzzSharp", sdk, arch, platform: VARIANT); + RunXCodeBuild("libHarfBuzzSharp/libHarfBuzzSharp.xcodeproj", "libHarfBuzzSharp", sdk, arch, platform: VARIANT, properties: new Dictionary { + { $"IPHONEOS_DEPLOYMENT_TARGET{DEPLOYMENT_SDK}", GetDeploymentTarget(arch) }, + }); SafeCopy( $"libHarfBuzzSharp/bin/{CONFIGURATION}/{sdk}/{arch}.xcarchive", diff --git a/native/macos/build.cake b/native/macos/build.cake index d52bb74cac..65c37e6732 100644 --- a/native/macos/build.cake +++ b/native/macos/build.cake @@ -4,6 +4,14 @@ DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native/osx")) #load "../../cake/native-shared.cake" #load "../../cake/xcode.cake" +string GetDeploymentTarget(string arch) +{ + switch (arch.ToLower()) { + case "arm64": return "11.0"; + default: return "10.8"; + } +} + Task("libSkiaSharp") .IsDependentOn("git-sync-deps") .WithCriteria(IsRunningOnMacOs()) @@ -18,14 +26,10 @@ Task("libSkiaSharp") { if (Skip(arch)) return; - var minVersion = skiaArch.ToLower() == "arm64" - ? "11.0" - : "10.8"; - GnNinja($"macos/{arch}", "skia modules/skottie", $"target_os='mac' " + $"target_cpu='{skiaArch}' " + - $"min_macos_version='{minVersion}' " + + $"min_macos_version='{GetDeploymentTarget(arch)}' " + $"skia_use_icu=false " + $"skia_use_metal=true " + $"skia_use_piex=true " + @@ -39,7 +43,9 @@ Task("libSkiaSharp") $"extra_cflags=[ '-DSKIA_C_DLL', '-DHAVE_ARC4RANDOM_BUF', '-stdlib=libc++' ] " + $"extra_ldflags=[ '-stdlib=libc++' ]"); - RunXCodeBuild("libSkiaSharp/libSkiaSharp.xcodeproj", "libSkiaSharp", "macosx", arch); + RunXCodeBuild("libSkiaSharp/libSkiaSharp.xcodeproj", "libSkiaSharp", "macosx", arch, properties: new Dictionary { + { "MACOSX_DEPLOYMENT_TARGET", GetDeploymentTarget(arch) }, + }); SafeCopy( $"libSkiaSharp/bin/{CONFIGURATION}/macosx/{arch}.xcarchive", @@ -60,7 +66,9 @@ Task("libHarfBuzzSharp") { if (Skip(arch)) return; - RunXCodeBuild("libHarfBuzzSharp/libHarfBuzzSharp.xcodeproj", "libHarfBuzzSharp", "macosx", arch); + RunXCodeBuild("libHarfBuzzSharp/libHarfBuzzSharp.xcodeproj", "libHarfBuzzSharp", "macosx", arch, properties: new Dictionary { + { "MACOSX_DEPLOYMENT_TARGET", GetDeploymentTarget(arch) }, + }); SafeCopy( $"libHarfBuzzSharp/bin/{CONFIGURATION}/macosx/{arch}.xcarchive", diff --git a/native/tvos/build.cake b/native/tvos/build.cake index 92beaae768..d53edc17b8 100644 --- a/native/tvos/build.cake +++ b/native/tvos/build.cake @@ -4,6 +4,11 @@ DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native/tvos") #load "../../cake/native-shared.cake" #load "../../cake/xcode.cake" +string GetDeploymentTarget(string arch) +{ + return "9.0"; +} + Task("libSkiaSharp") .IsDependentOn("git-sync-deps") .WithCriteria(IsRunningOnMacOs()) @@ -21,6 +26,7 @@ Task("libSkiaSharp") GnNinja($"tvos/{arch}", "skia modules/skottie", $"target_os='tvos' " + $"target_cpu='{skiaArch}' " + + $"min_ios_version='{GetDeploymentTarget(arch)}' " + $"skia_use_icu=false " + $"skia_use_metal=false " + $"skia_use_piex=true " + @@ -33,7 +39,9 @@ Task("libSkiaSharp") $"skia_enable_skottie=true " + $"extra_cflags=[ '-DSKIA_C_DLL', '-DHAVE_ARC4RANDOM_BUF' ] "); - RunXCodeBuild("libSkiaSharp/libSkiaSharp.xcodeproj", "libSkiaSharp", sdk, arch); + RunXCodeBuild("libSkiaSharp/libSkiaSharp.xcodeproj", "libSkiaSharp", sdk, arch, properties: new Dictionary { + { "TVOS_DEPLOYMENT_TARGET", GetDeploymentTarget(arch) }, + }); SafeCopy( $"libSkiaSharp/bin/{CONFIGURATION}/{sdk}/{arch}.xcarchive", @@ -54,7 +62,9 @@ Task("libHarfBuzzSharp") { if (Skip(arch)) return; - RunXCodeBuild("libHarfBuzzSharp/libHarfBuzzSharp.xcodeproj", "libHarfBuzzSharp", sdk, arch); + RunXCodeBuild("libHarfBuzzSharp/libHarfBuzzSharp.xcodeproj", "libHarfBuzzSharp", sdk, arch, properties: new Dictionary { + { "TVOS_DEPLOYMENT_TARGET", GetDeploymentTarget(arch) }, + }); SafeCopy( $"libHarfBuzzSharp/bin/{CONFIGURATION}/{sdk}/{arch}.xcarchive", diff --git a/native/watchos/build.cake b/native/watchos/build.cake index 645bd5f272..02c65bf01f 100644 --- a/native/watchos/build.cake +++ b/native/watchos/build.cake @@ -4,6 +4,11 @@ DirectoryPath OUTPUT_PATH = MakeAbsolute(ROOT_PATH.Combine("output/native/watcho #load "../../cake/native-shared.cake" #load "../../cake/xcode.cake" +string GetDeploymentTarget(string arch) +{ + return "2.0"; +} + Task("libSkiaSharp") .IsDependentOn("git-sync-deps") .WithCriteria(IsRunningOnMacOs()) @@ -22,6 +27,7 @@ Task("libSkiaSharp") GnNinja($"watchos/{arch}", "skia modules/skottie", $"target_os='watchos' " + $"target_cpu='{skiaArch}' " + + $"min_watchos_version='{GetDeploymentTarget(arch)}' " + $"skia_enable_gpu=false " + $"skia_use_icu=false " + $"skia_use_metal=false " + @@ -35,7 +41,9 @@ Task("libSkiaSharp") $"skia_enable_skottie=true " + $"extra_cflags=[ '-DSKIA_C_DLL', '-DHAVE_ARC4RANDOM_BUF' ] "); - RunXCodeBuild("libSkiaSharp/libSkiaSharp.xcodeproj", "libSkiaSharp", sdk, arch); + RunXCodeBuild("libSkiaSharp/libSkiaSharp.xcodeproj", "libSkiaSharp", sdk, arch, properties: new Dictionary { + { "WATCHOS_DEPLOYMENT_TARGET", GetDeploymentTarget(arch) }, + }); SafeCopy( $"libSkiaSharp/bin/{CONFIGURATION}/{sdk}/{arch}.xcarchive", @@ -57,7 +65,9 @@ Task("libHarfBuzzSharp") { if (Skip(arch)) return; - RunXCodeBuild("libHarfBuzzSharp/libHarfBuzzSharp.xcodeproj", "libHarfBuzzSharp", sdk, arch); + RunXCodeBuild("libHarfBuzzSharp/libHarfBuzzSharp.xcodeproj", "libHarfBuzzSharp", sdk, arch, properties: new Dictionary { + { "WATCHOS_DEPLOYMENT_TARGET", GetDeploymentTarget(arch) }, + }); SafeCopy( $"libHarfBuzzSharp/bin/{CONFIGURATION}/{sdk}/{arch}.xcarchive", diff --git a/scripts/azure-pipelines-variables.yml b/scripts/azure-pipelines-variables.yml index 5f205046b2..28d444bc95 100644 --- a/scripts/azure-pipelines-variables.yml +++ b/scripts/azure-pipelines-variables.yml @@ -11,7 +11,7 @@ variables: BUILD_COUNTER: $[counter('global_counter', 1)] TIZEN_LINUX_PACKAGES: libxcb-icccm4 libxcb-render-util0 gettext libxcb-image0 libsdl1.2debian libv4l-0 libxcb-randr0 bridge-utils libxcb-shape0 libpython2.7 openvpn MANAGED_LINUX_PACKAGES: ttf-ancient-fonts ninja-build - MONO_VERSION_MACOS: '6_12_13' + MONO_VERSION_MACOS: '6_12_24' MONO_VERSION_LINUX: 'stable-focal/snapshots/6.12.0.182' XCODE_VERSION: 13.2.1 VISUAL_STUDIO_VERSION: '' diff --git a/scripts/install-vs.ps1 b/scripts/install-vs.ps1 index 485a3b26f6..9a553d9ef0 100644 --- a/scripts/install-vs.ps1 +++ b/scripts/install-vs.ps1 @@ -43,7 +43,6 @@ Write-Host "Installing Visual Studio..." $exitCode = & "$temp\dd_vs_community.exe" --quiet --norestart --wait ` --includeRecommended ` --add Microsoft.VisualStudio.Workload.NetCrossPlat ` - --add Microsoft.VisualStudio.Workload.NetCoreTools ` --add Microsoft.VisualStudio.Workload.ManagedDesktop ` --add Microsoft.VisualStudio.Workload.Universal ` | Out-Null @@ -55,5 +54,8 @@ New-Item -ItemType Directory -Force -Path "$vsLogs" | Out-Null Get-ChildItem "$temp\dd_*" | Where-Object { $_.CreationTime -gt $startTime } | Copy-Item -Destination "$vsLogs" +Get-ChildItem "$env:TEMP\dd_*" | + Where-Object { $_.CreationTime -gt $startTime } | + Copy-Item -Destination "$vsLogs" exit $LASTEXITCODE