diff --git a/binding/Binding/Properties/SkiaSharpAssemblyInfo.cs b/binding/Binding/Properties/SkiaSharpAssemblyInfo.cs index 9c1c163d43..a1c6c5d6d6 100644 --- a/binding/Binding/Properties/SkiaSharpAssemblyInfo.cs +++ b/binding/Binding/Properties/SkiaSharpAssemblyInfo.cs @@ -36,3 +36,14 @@ "3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fd" + "dafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef00" + "65d016df")] + +[assembly: AssemblyMetadata("IsTrimmable", "True")] + +#if __IOS__ || __TVOS__ || __WATCHOS__ || __MACOS__ +// This attribute allows you to mark your assemblies as “safe to link”. +// When the attribute is present, the linker—if enabled—will process the assembly +// even if you’re using the “Link SDK assemblies only” option, which is the default for device builds. +#pragma warning disable CS0618 // Type or member is obsolete +[assembly: Foundation.LinkerSafe] +#pragma warning restore CS0618 // Type or member is obsolete +#endif diff --git a/binding/HarfBuzzSharp.Android/HarfBuzzSharp.Android.csproj b/binding/HarfBuzzSharp.Android/HarfBuzzSharp.Android.csproj index 2311a147bb..5102bb273a 100644 --- a/binding/HarfBuzzSharp.Android/HarfBuzzSharp.Android.csproj +++ b/binding/HarfBuzzSharp.Android/HarfBuzzSharp.Android.csproj @@ -8,13 +8,13 @@ $(DefineConstants);HARFBUZZ - - - - + + + + - + diff --git a/binding/HarfBuzzSharp.Android/nuget/build/monoandroid1.0/HarfBuzzSharp.targets b/binding/HarfBuzzSharp.Android/nuget/build/monoandroid1.0/HarfBuzzSharp.targets deleted file mode 100644 index e96dfcdece..0000000000 --- a/binding/HarfBuzzSharp.Android/nuget/build/monoandroid1.0/HarfBuzzSharp.targets +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - True - - - - <_HarfBuzzSharpNativeLibraryCurrPath>$([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)')) - <_HarfBuzzSharpNativeLibraryDirName>$([System.IO.Path]::GetFileName('$(_HarfBuzzSharpNativeLibraryCurrPath)')) - <_HarfBuzzSharpNativeLibraryRootDir>$(MSBuildThisFileDirectory)..\..\build\$(_HarfBuzzSharpNativeLibraryDirName)\ - - - - - - - - - - \ No newline at end of file diff --git a/binding/HarfBuzzSharp.OSX/HarfBuzzSharp.OSX.csproj b/binding/HarfBuzzSharp.OSX/HarfBuzzSharp.OSX.csproj index 5990178055..96164b56e9 100644 --- a/binding/HarfBuzzSharp.OSX/HarfBuzzSharp.OSX.csproj +++ b/binding/HarfBuzzSharp.OSX/HarfBuzzSharp.OSX.csproj @@ -10,10 +10,9 @@ - + - diff --git a/binding/HarfBuzzSharp.OSX/Properties/AssemblyInfo.cs b/binding/HarfBuzzSharp.OSX/Properties/AssemblyInfo.cs deleted file mode 100644 index 9c6171d579..0000000000 --- a/binding/HarfBuzzSharp.OSX/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using Foundation; - -[assembly: LinkerSafe] diff --git a/binding/HarfBuzzSharp.Shared/Properties/HarfBuzzSharpAssemblyInfo.cs b/binding/HarfBuzzSharp.Shared/Properties/HarfBuzzSharpAssemblyInfo.cs index eb220c4ec1..23212b19e5 100644 --- a/binding/HarfBuzzSharp.Shared/Properties/HarfBuzzSharpAssemblyInfo.cs +++ b/binding/HarfBuzzSharp.Shared/Properties/HarfBuzzSharpAssemblyInfo.cs @@ -22,3 +22,14 @@ "3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fd" + "dafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef00" + "65d016df")] + +[assembly: AssemblyMetadata("IsTrimmable", "True")] + +#if __IOS__ || __TVOS__ || __WATCHOS__ || __MACOS__ +// This attribute allows you to mark your assemblies as “safe to link”. +// When the attribute is present, the linker—if enabled—will process the assembly +// even if you’re using the “Link SDK assemblies only” option, which is the default for device builds. +#pragma warning disable CS0618 // Type or member is obsolete +[assembly: Foundation.LinkerSafe] +#pragma warning restore CS0618 // Type or member is obsolete +#endif diff --git a/binding/HarfBuzzSharp.iOS/HarfBuzzSharp.iOS.csproj b/binding/HarfBuzzSharp.iOS/HarfBuzzSharp.iOS.csproj index abf2dfc003..a94a6f30e3 100644 --- a/binding/HarfBuzzSharp.iOS/HarfBuzzSharp.iOS.csproj +++ b/binding/HarfBuzzSharp.iOS/HarfBuzzSharp.iOS.csproj @@ -7,13 +7,12 @@ $(DefineConstants);HARFBUZZ - + - + - diff --git a/binding/HarfBuzzSharp.iOS/Properties/AssemblyInfo.cs b/binding/HarfBuzzSharp.iOS/Properties/AssemblyInfo.cs deleted file mode 100644 index 9c6171d579..0000000000 --- a/binding/HarfBuzzSharp.iOS/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using Foundation; - -[assembly: LinkerSafe] diff --git a/binding/HarfBuzzSharp.iOS/nuget/build/xamarinios1.0/HarfBuzzSharp.targets b/binding/HarfBuzzSharp.iOS/nuget/build/xamarinios1.0/HarfBuzzSharp.targets deleted file mode 100644 index a7e1611b01..0000000000 --- a/binding/HarfBuzzSharp.iOS/nuget/build/xamarinios1.0/HarfBuzzSharp.targets +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - True - - - - <_HarfBuzzSharpNativeLibraryCurrPath>$([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)')) - <_HarfBuzzSharpNativeLibraryDirName>$([System.IO.Path]::GetFileName('$(_HarfBuzzSharpNativeLibraryCurrPath)')) - <_HarfBuzzSharpNativeLibraryRootDir>$(MSBuildThisFileDirectory)..\..\build\$(_HarfBuzzSharpNativeLibraryDirName)\ - - - - - - - \ No newline at end of file diff --git a/binding/HarfBuzzSharp.tvOS/HarfBuzzSharp.tvOS.csproj b/binding/HarfBuzzSharp.tvOS/HarfBuzzSharp.tvOS.csproj index dec88f38a5..332f247a74 100644 --- a/binding/HarfBuzzSharp.tvOS/HarfBuzzSharp.tvOS.csproj +++ b/binding/HarfBuzzSharp.tvOS/HarfBuzzSharp.tvOS.csproj @@ -7,13 +7,12 @@ $(DefineConstants);HARFBUZZ - + - + - diff --git a/binding/HarfBuzzSharp.tvOS/Properties/AssemblyInfo.cs b/binding/HarfBuzzSharp.tvOS/Properties/AssemblyInfo.cs deleted file mode 100644 index 9c6171d579..0000000000 --- a/binding/HarfBuzzSharp.tvOS/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using Foundation; - -[assembly: LinkerSafe] diff --git a/binding/HarfBuzzSharp.tvOS/nuget/build/xamarintvos1.0/HarfBuzzSharp.targets b/binding/HarfBuzzSharp.tvOS/nuget/build/xamarintvos1.0/HarfBuzzSharp.targets deleted file mode 100644 index a7e1611b01..0000000000 --- a/binding/HarfBuzzSharp.tvOS/nuget/build/xamarintvos1.0/HarfBuzzSharp.targets +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - True - - - - <_HarfBuzzSharpNativeLibraryCurrPath>$([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)')) - <_HarfBuzzSharpNativeLibraryDirName>$([System.IO.Path]::GetFileName('$(_HarfBuzzSharpNativeLibraryCurrPath)')) - <_HarfBuzzSharpNativeLibraryRootDir>$(MSBuildThisFileDirectory)..\..\build\$(_HarfBuzzSharpNativeLibraryDirName)\ - - - - - - - \ No newline at end of file diff --git a/binding/HarfBuzzSharp.watchOS/HarfBuzzSharp.watchOS.csproj b/binding/HarfBuzzSharp.watchOS/HarfBuzzSharp.watchOS.csproj index c1cf0ed931..a44ba487e5 100644 --- a/binding/HarfBuzzSharp.watchOS/HarfBuzzSharp.watchOS.csproj +++ b/binding/HarfBuzzSharp.watchOS/HarfBuzzSharp.watchOS.csproj @@ -7,13 +7,12 @@ $(DefineConstants);HARFBUZZ - + - + - diff --git a/binding/HarfBuzzSharp.watchOS/Properties/AssemblyInfo.cs b/binding/HarfBuzzSharp.watchOS/Properties/AssemblyInfo.cs deleted file mode 100644 index 9c6171d579..0000000000 --- a/binding/HarfBuzzSharp.watchOS/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using Foundation; - -[assembly: LinkerSafe] diff --git a/binding/HarfBuzzSharp.watchOS/nuget/build/xamarinwatchos1.0/HarfBuzzSharp.targets b/binding/HarfBuzzSharp.watchOS/nuget/build/xamarinwatchos1.0/HarfBuzzSharp.targets deleted file mode 100644 index a7e1611b01..0000000000 --- a/binding/HarfBuzzSharp.watchOS/nuget/build/xamarinwatchos1.0/HarfBuzzSharp.targets +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - True - - - - <_HarfBuzzSharpNativeLibraryCurrPath>$([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)')) - <_HarfBuzzSharpNativeLibraryDirName>$([System.IO.Path]::GetFileName('$(_HarfBuzzSharpNativeLibraryCurrPath)')) - <_HarfBuzzSharpNativeLibraryRootDir>$(MSBuildThisFileDirectory)..\..\build\$(_HarfBuzzSharpNativeLibraryDirName)\ - - - - - - - \ No newline at end of file diff --git a/binding/HarfBuzzSharp/HarfBuzzSharp.csproj b/binding/HarfBuzzSharp/HarfBuzzSharp.csproj index 205022d175..56aab85dd8 100644 --- a/binding/HarfBuzzSharp/HarfBuzzSharp.csproj +++ b/binding/HarfBuzzSharp/HarfBuzzSharp.csproj @@ -1,6 +1,7 @@  netstandard1.3;netstandard2.0;net462 + $(TargetFrameworks);net6.0-ios;net6.0-maccatalyst;net6.0-tvos;net6.0-macos;net6.0-android HarfBuzzSharp HarfBuzzSharp HarfBuzzSharp @@ -15,7 +16,7 @@ - + @@ -50,8 +51,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/binding/HarfBuzzSharp/nuget/build/android/HarfBuzzSharp.targets b/binding/HarfBuzzSharp/nuget/build/android/HarfBuzzSharp.targets new file mode 100644 index 0000000000..f41ecfc014 --- /dev/null +++ b/binding/HarfBuzzSharp/nuget/build/android/HarfBuzzSharp.targets @@ -0,0 +1,23 @@ + + + + + + + <_FixedResolvedFileToPublish + Include="@(ResolvedFileToPublish)" + Condition=" + '%(ResolvedFileToPublish.AssetType)' == 'native' and + '%(ResolvedFileToPublish.Filename)' == 'libHarfBuzzSharp' and + '%(ResolvedFileToPublish.Extension)' == '.so' and + '%(ResolvedFileToPublish.NuGetPackageId)' != '' and + '%(ResolvedFileToPublish.RuntimeIdentifier)' == '' and + '%(ResolvedFileToPublish.PathInPackage)' != '' " /> + + $([System.Text.RegularExpressions.Regex]::Match('%(_FixedResolvedFileToPublish.PathInPackage)', 'runtimes/([^/]+)/native/.*').Groups[1].Value) + + <_FixedResolvedFileToPublish Remove="@(_FixedResolvedFileToPublish)" /> + + + + \ No newline at end of file diff --git a/binding/HarfBuzzSharp/nuget/build/ios/HarfBuzzSharp.targets b/binding/HarfBuzzSharp/nuget/build/ios/HarfBuzzSharp.targets new file mode 100644 index 0000000000..e7a5299f44 --- /dev/null +++ b/binding/HarfBuzzSharp/nuget/build/ios/HarfBuzzSharp.targets @@ -0,0 +1,29 @@ + + + + + + + <_PossibleNativeFramework + Include="@(ResolvedFileToPublish)" + Condition=" + '%(ResolvedFileToPublish.AssetType)' == 'native' and + '%(ResolvedFileToPublish.Filename)' == 'libHarfBuzzSharp' and + '%(ResolvedFileToPublish.Extension)' == '' and + '%(ResolvedFileToPublish.NuGetPackageId)' != '' and + '%(ResolvedFileToPublish.PathInPackage)' != ''"> + $([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName(%(ResolvedFileToPublish.PathInPackage))))) + $([System.IO.Path]::GetDirectoryName(%(ResolvedFileToPublish.FullPath))) + + + Framework + %(NuGetPackageId) + %(NuGetPackageVersion) + %(AssetType) + $([System.Text.RegularExpressions.Regex]::Match('%(_PossibleNativeFramework.PathInPackage)', 'runtimes/([^/]+)/native/.*').Groups[1].Value) + + <_PossibleNativeFramework Remove="@(_PossibleNativeFramework)" /> + + + + \ No newline at end of file diff --git a/binding/HarfBuzzSharp/nuget/build/macos/HarfBuzzSharp.targets b/binding/HarfBuzzSharp/nuget/build/macos/HarfBuzzSharp.targets new file mode 100644 index 0000000000..cffd211377 --- /dev/null +++ b/binding/HarfBuzzSharp/nuget/build/macos/HarfBuzzSharp.targets @@ -0,0 +1,23 @@ + + + + + + + <_PossibleNativeReference + Include="@(ResolvedFileToPublish)" + Condition=" + '%(ResolvedFileToPublish.AssetType)' == 'native' and + '%(ResolvedFileToPublish.Filename)' == 'libHarfBuzzSharp' and + '%(ResolvedFileToPublish.Extension)' == '.dylib' and + '%(ResolvedFileToPublish.NuGetPackageId)' != '' and + '%(ResolvedFileToPublish.PathInPackage)' != ''" /> + + Dynamic + $([System.Text.RegularExpressions.Regex]::Match('%(_PossibleNativeReference.PathInPackage)', 'runtimes/([^/]+)/native/.*').Groups[1].Value) + + <_PossibleNativeReference Remove="@(_PossibleNativeReference)" /> + + + + \ No newline at end of file diff --git a/binding/HarfBuzzSharp/nuget/build/monoandroid/HarfBuzzSharp.targets b/binding/HarfBuzzSharp/nuget/build/monoandroid/HarfBuzzSharp.targets new file mode 100644 index 0000000000..dcf6c0d81e --- /dev/null +++ b/binding/HarfBuzzSharp/nuget/build/monoandroid/HarfBuzzSharp.targets @@ -0,0 +1,16 @@ + + + + + + True + + + + + + + + + + \ No newline at end of file diff --git a/binding/HarfBuzzSharp/nuget/build/tvos/HarfBuzzSharp.targets b/binding/HarfBuzzSharp/nuget/build/tvos/HarfBuzzSharp.targets new file mode 100644 index 0000000000..e7a5299f44 --- /dev/null +++ b/binding/HarfBuzzSharp/nuget/build/tvos/HarfBuzzSharp.targets @@ -0,0 +1,29 @@ + + + + + + + <_PossibleNativeFramework + Include="@(ResolvedFileToPublish)" + Condition=" + '%(ResolvedFileToPublish.AssetType)' == 'native' and + '%(ResolvedFileToPublish.Filename)' == 'libHarfBuzzSharp' and + '%(ResolvedFileToPublish.Extension)' == '' and + '%(ResolvedFileToPublish.NuGetPackageId)' != '' and + '%(ResolvedFileToPublish.PathInPackage)' != ''"> + $([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName(%(ResolvedFileToPublish.PathInPackage))))) + $([System.IO.Path]::GetDirectoryName(%(ResolvedFileToPublish.FullPath))) + + + Framework + %(NuGetPackageId) + %(NuGetPackageVersion) + %(AssetType) + $([System.Text.RegularExpressions.Regex]::Match('%(_PossibleNativeFramework.PathInPackage)', 'runtimes/([^/]+)/native/.*').Groups[1].Value) + + <_PossibleNativeFramework Remove="@(_PossibleNativeFramework)" /> + + + + \ No newline at end of file diff --git a/binding/HarfBuzzSharp/nuget/build/xamarinios/HarfBuzzSharp.targets b/binding/HarfBuzzSharp/nuget/build/xamarinios/HarfBuzzSharp.targets new file mode 100644 index 0000000000..173428e84a --- /dev/null +++ b/binding/HarfBuzzSharp/nuget/build/xamarinios/HarfBuzzSharp.targets @@ -0,0 +1,13 @@ + + + + + + True + + + + + + + \ No newline at end of file diff --git a/binding/HarfBuzzSharp.OSX/nuget/build/xamarinmac2.0/HarfBuzzSharp.targets b/binding/HarfBuzzSharp/nuget/build/xamarinmac/HarfBuzzSharp.targets similarity index 100% rename from binding/HarfBuzzSharp.OSX/nuget/build/xamarinmac2.0/HarfBuzzSharp.targets rename to binding/HarfBuzzSharp/nuget/build/xamarinmac/HarfBuzzSharp.targets diff --git a/binding/HarfBuzzSharp/nuget/build/xamarintvos/HarfBuzzSharp.targets b/binding/HarfBuzzSharp/nuget/build/xamarintvos/HarfBuzzSharp.targets new file mode 100644 index 0000000000..3682672a4c --- /dev/null +++ b/binding/HarfBuzzSharp/nuget/build/xamarintvos/HarfBuzzSharp.targets @@ -0,0 +1,13 @@ + + + + + + True + + + + + + + \ No newline at end of file diff --git a/binding/HarfBuzzSharp/nuget/build/xamarinwatchos/HarfBuzzSharp.targets b/binding/HarfBuzzSharp/nuget/build/xamarinwatchos/HarfBuzzSharp.targets new file mode 100644 index 0000000000..41d664c22b --- /dev/null +++ b/binding/HarfBuzzSharp/nuget/build/xamarinwatchos/HarfBuzzSharp.targets @@ -0,0 +1,13 @@ + + + + + + True + + + + + + + \ No newline at end of file diff --git a/binding/SkiaSharp.Android/SkiaSharp.Android.csproj b/binding/SkiaSharp.Android/SkiaSharp.Android.csproj index f2623cd7fc..b249e9e3b3 100644 --- a/binding/SkiaSharp.Android/SkiaSharp.Android.csproj +++ b/binding/SkiaSharp.Android/SkiaSharp.Android.csproj @@ -7,13 +7,13 @@ monoandroid1.0 - - - - + + + + - + diff --git a/binding/SkiaSharp.Android/nuget/build/monoandroid1.0/SkiaSharp.targets b/binding/SkiaSharp.Android/nuget/build/monoandroid1.0/SkiaSharp.targets deleted file mode 100644 index a963c434ad..0000000000 --- a/binding/SkiaSharp.Android/nuget/build/monoandroid1.0/SkiaSharp.targets +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - True - - - - <_SkiaSharpNativeLibraryCurrPath>$([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)')) - <_SkiaSharpNativeLibraryDirName>$([System.IO.Path]::GetFileName('$(_SkiaSharpNativeLibraryCurrPath)')) - <_SkiaSharpNativeLibraryRootDir>$(MSBuildThisFileDirectory)..\..\build\$(_SkiaSharpNativeLibraryDirName)\ - - - - - - - - - - \ No newline at end of file diff --git a/binding/SkiaSharp.OSX/Properties/AssemblyInfo.cs b/binding/SkiaSharp.OSX/Properties/AssemblyInfo.cs deleted file mode 100644 index efc6ea06d2..0000000000 --- a/binding/SkiaSharp.OSX/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Foundation; - -// This attribute allows you to mark your assemblies as “safe to link”. -// When the attribute is present, the linker—if enabled—will process the assembly -// even if you’re using the “Link SDK assemblies only” option, which is the default for device builds. - -[assembly: LinkerSafe] diff --git a/binding/SkiaSharp.OSX/SkiaSharp.OSX.csproj b/binding/SkiaSharp.OSX/SkiaSharp.OSX.csproj index 38be41b899..55b1117faa 100644 --- a/binding/SkiaSharp.OSX/SkiaSharp.OSX.csproj +++ b/binding/SkiaSharp.OSX/SkiaSharp.OSX.csproj @@ -9,10 +9,9 @@ - + - diff --git a/binding/SkiaSharp.iOS/Properties/AssemblyInfo.cs b/binding/SkiaSharp.iOS/Properties/AssemblyInfo.cs deleted file mode 100644 index efc6ea06d2..0000000000 --- a/binding/SkiaSharp.iOS/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Foundation; - -// This attribute allows you to mark your assemblies as “safe to link”. -// When the attribute is present, the linker—if enabled—will process the assembly -// even if you’re using the “Link SDK assemblies only” option, which is the default for device builds. - -[assembly: LinkerSafe] diff --git a/binding/SkiaSharp.iOS/SkiaSharp.iOS.csproj b/binding/SkiaSharp.iOS/SkiaSharp.iOS.csproj index 503d6f9f6e..48e259d3f6 100644 --- a/binding/SkiaSharp.iOS/SkiaSharp.iOS.csproj +++ b/binding/SkiaSharp.iOS/SkiaSharp.iOS.csproj @@ -6,13 +6,12 @@ SkiaSharp - + - + - diff --git a/binding/SkiaSharp.iOS/nuget/build/xamarinios1.0/SkiaSharp.targets b/binding/SkiaSharp.iOS/nuget/build/xamarinios1.0/SkiaSharp.targets deleted file mode 100644 index f760e8bfd0..0000000000 --- a/binding/SkiaSharp.iOS/nuget/build/xamarinios1.0/SkiaSharp.targets +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - True - - - - <_SkiaSharpNativeLibraryCurrPath>$([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)')) - <_SkiaSharpNativeLibraryDirName>$([System.IO.Path]::GetFileName('$(_SkiaSharpNativeLibraryCurrPath)')) - <_SkiaSharpNativeLibraryRootDir>$(MSBuildThisFileDirectory)..\..\build\$(_SkiaSharpNativeLibraryDirName)\ - - - - - - - \ No newline at end of file diff --git a/binding/SkiaSharp.tvOS/Properties/AssemblyInfo.cs b/binding/SkiaSharp.tvOS/Properties/AssemblyInfo.cs deleted file mode 100644 index efc6ea06d2..0000000000 --- a/binding/SkiaSharp.tvOS/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Foundation; - -// This attribute allows you to mark your assemblies as “safe to link”. -// When the attribute is present, the linker—if enabled—will process the assembly -// even if you’re using the “Link SDK assemblies only” option, which is the default for device builds. - -[assembly: LinkerSafe] diff --git a/binding/SkiaSharp.tvOS/SkiaSharp.tvOS.csproj b/binding/SkiaSharp.tvOS/SkiaSharp.tvOS.csproj index 63fd4ecd21..9d0566dc41 100644 --- a/binding/SkiaSharp.tvOS/SkiaSharp.tvOS.csproj +++ b/binding/SkiaSharp.tvOS/SkiaSharp.tvOS.csproj @@ -6,13 +6,12 @@ SkiaSharp - + - + - diff --git a/binding/SkiaSharp.tvOS/nuget/build/xamarintvos1.0/SkiaSharp.targets b/binding/SkiaSharp.tvOS/nuget/build/xamarintvos1.0/SkiaSharp.targets deleted file mode 100644 index f760e8bfd0..0000000000 --- a/binding/SkiaSharp.tvOS/nuget/build/xamarintvos1.0/SkiaSharp.targets +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - True - - - - <_SkiaSharpNativeLibraryCurrPath>$([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)')) - <_SkiaSharpNativeLibraryDirName>$([System.IO.Path]::GetFileName('$(_SkiaSharpNativeLibraryCurrPath)')) - <_SkiaSharpNativeLibraryRootDir>$(MSBuildThisFileDirectory)..\..\build\$(_SkiaSharpNativeLibraryDirName)\ - - - - - - - \ No newline at end of file diff --git a/binding/SkiaSharp.watchOS/Properties/AssemblyInfo.cs b/binding/SkiaSharp.watchOS/Properties/AssemblyInfo.cs deleted file mode 100644 index efc6ea06d2..0000000000 --- a/binding/SkiaSharp.watchOS/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Foundation; - -// This attribute allows you to mark your assemblies as “safe to link”. -// When the attribute is present, the linker—if enabled—will process the assembly -// even if you’re using the “Link SDK assemblies only” option, which is the default for device builds. - -[assembly: LinkerSafe] diff --git a/binding/SkiaSharp.watchOS/SkiaSharp.watchOS.csproj b/binding/SkiaSharp.watchOS/SkiaSharp.watchOS.csproj index 04929d737e..00bfb68105 100644 --- a/binding/SkiaSharp.watchOS/SkiaSharp.watchOS.csproj +++ b/binding/SkiaSharp.watchOS/SkiaSharp.watchOS.csproj @@ -6,13 +6,12 @@ SkiaSharp - + - + - diff --git a/binding/SkiaSharp.watchOS/nuget/build/xamarinwatchos1.0/SkiaSharp.targets b/binding/SkiaSharp.watchOS/nuget/build/xamarinwatchos1.0/SkiaSharp.targets deleted file mode 100644 index f760e8bfd0..0000000000 --- a/binding/SkiaSharp.watchOS/nuget/build/xamarinwatchos1.0/SkiaSharp.targets +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - True - - - - <_SkiaSharpNativeLibraryCurrPath>$([System.IO.Path]::GetDirectoryName('$(MSBuildThisFileDirectory)')) - <_SkiaSharpNativeLibraryDirName>$([System.IO.Path]::GetFileName('$(_SkiaSharpNativeLibraryCurrPath)')) - <_SkiaSharpNativeLibraryRootDir>$(MSBuildThisFileDirectory)..\..\build\$(_SkiaSharpNativeLibraryDirName)\ - - - - - - - \ No newline at end of file diff --git a/binding/SkiaSharp/SkiaSharp.csproj b/binding/SkiaSharp/SkiaSharp.csproj index 2d4142e022..b5719332b7 100644 --- a/binding/SkiaSharp/SkiaSharp.csproj +++ b/binding/SkiaSharp/SkiaSharp.csproj @@ -1,6 +1,7 @@  netstandard1.3;netstandard2.0;net462 + $(TargetFrameworks);net6.0-ios;net6.0-maccatalyst;net6.0-tvos;net6.0-macos;net6.0-android SkiaSharp SkiaSharp SkiaSharp @@ -14,7 +15,7 @@ - + @@ -49,8 +50,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/binding/SkiaSharp/nuget/build/android/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/android/SkiaSharp.targets new file mode 100644 index 0000000000..f5ee392395 --- /dev/null +++ b/binding/SkiaSharp/nuget/build/android/SkiaSharp.targets @@ -0,0 +1,23 @@ + + + + + + + <_FixedResolvedFileToPublish + Include="@(ResolvedFileToPublish)" + Condition=" + '%(ResolvedFileToPublish.AssetType)' == 'native' and + '%(ResolvedFileToPublish.Filename)' == 'libSkiaSharp' and + '%(ResolvedFileToPublish.Extension)' == '.so' and + '%(ResolvedFileToPublish.NuGetPackageId)' != '' and + '%(ResolvedFileToPublish.RuntimeIdentifier)' == '' and + '%(ResolvedFileToPublish.PathInPackage)' != '' " /> + + $([System.Text.RegularExpressions.Regex]::Match('%(_FixedResolvedFileToPublish.PathInPackage)', 'runtimes/([^/]+)/native/.*').Groups[1].Value) + + <_FixedResolvedFileToPublish Remove="@(_FixedResolvedFileToPublish)" /> + + + + \ No newline at end of file diff --git a/binding/SkiaSharp/nuget/build/ios/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/ios/SkiaSharp.targets new file mode 100644 index 0000000000..a7aa4980e2 --- /dev/null +++ b/binding/SkiaSharp/nuget/build/ios/SkiaSharp.targets @@ -0,0 +1,29 @@ + + + + + + + <_PossibleNativeFramework + Include="@(ResolvedFileToPublish)" + Condition=" + '%(ResolvedFileToPublish.AssetType)' == 'native' and + '%(ResolvedFileToPublish.Filename)' == 'libSkiaSharp' and + '%(ResolvedFileToPublish.Extension)' == '' and + '%(ResolvedFileToPublish.NuGetPackageId)' != '' and + '%(ResolvedFileToPublish.PathInPackage)' != ''"> + $([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName(%(ResolvedFileToPublish.PathInPackage))))) + $([System.IO.Path]::GetDirectoryName(%(ResolvedFileToPublish.FullPath))) + + + Framework + %(NuGetPackageId) + %(NuGetPackageVersion) + %(AssetType) + $([System.Text.RegularExpressions.Regex]::Match('%(_PossibleNativeFramework.PathInPackage)', 'runtimes/([^/]+)/native/.*').Groups[1].Value) + + <_PossibleNativeFramework Remove="@(_PossibleNativeFramework)" /> + + + + \ No newline at end of file diff --git a/binding/SkiaSharp/nuget/build/macos/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/macos/SkiaSharp.targets new file mode 100644 index 0000000000..c192069b5b --- /dev/null +++ b/binding/SkiaSharp/nuget/build/macos/SkiaSharp.targets @@ -0,0 +1,23 @@ + + + + + + + <_PossibleNativeReference + Include="@(ResolvedFileToPublish)" + Condition=" + '%(ResolvedFileToPublish.AssetType)' == 'native' and + '%(ResolvedFileToPublish.Filename)' == 'libSkiaSharp' and + '%(ResolvedFileToPublish.Extension)' == '.dylib' and + '%(ResolvedFileToPublish.NuGetPackageId)' != '' and + '%(ResolvedFileToPublish.PathInPackage)' != ''" /> + + Dynamic + $([System.Text.RegularExpressions.Regex]::Match('%(_PossibleNativeReference.PathInPackage)', 'runtimes/([^/]+)/native/.*').Groups[1].Value) + + <_PossibleNativeReference Remove="@(_PossibleNativeReference)" /> + + + + \ No newline at end of file diff --git a/binding/SkiaSharp/nuget/build/monoandroid/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/monoandroid/SkiaSharp.targets new file mode 100644 index 0000000000..7b870e572f --- /dev/null +++ b/binding/SkiaSharp/nuget/build/monoandroid/SkiaSharp.targets @@ -0,0 +1,16 @@ + + + + + + True + + + + + + + + + + \ No newline at end of file diff --git a/binding/SkiaSharp/nuget/build/tvos/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/tvos/SkiaSharp.targets new file mode 100644 index 0000000000..a7aa4980e2 --- /dev/null +++ b/binding/SkiaSharp/nuget/build/tvos/SkiaSharp.targets @@ -0,0 +1,29 @@ + + + + + + + <_PossibleNativeFramework + Include="@(ResolvedFileToPublish)" + Condition=" + '%(ResolvedFileToPublish.AssetType)' == 'native' and + '%(ResolvedFileToPublish.Filename)' == 'libSkiaSharp' and + '%(ResolvedFileToPublish.Extension)' == '' and + '%(ResolvedFileToPublish.NuGetPackageId)' != '' and + '%(ResolvedFileToPublish.PathInPackage)' != ''"> + $([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName(%(ResolvedFileToPublish.PathInPackage))))) + $([System.IO.Path]::GetDirectoryName(%(ResolvedFileToPublish.FullPath))) + + + Framework + %(NuGetPackageId) + %(NuGetPackageVersion) + %(AssetType) + $([System.Text.RegularExpressions.Regex]::Match('%(_PossibleNativeFramework.PathInPackage)', 'runtimes/([^/]+)/native/.*').Groups[1].Value) + + <_PossibleNativeFramework Remove="@(_PossibleNativeFramework)" /> + + + + \ No newline at end of file diff --git a/binding/SkiaSharp/nuget/build/xamarinios/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/xamarinios/SkiaSharp.targets new file mode 100644 index 0000000000..eb3a98e673 --- /dev/null +++ b/binding/SkiaSharp/nuget/build/xamarinios/SkiaSharp.targets @@ -0,0 +1,13 @@ + + + + + + True + + + + + + + \ No newline at end of file diff --git a/binding/SkiaSharp.OSX/nuget/build/xamarinmac2.0/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/xamarinmac/SkiaSharp.targets similarity index 100% rename from binding/SkiaSharp.OSX/nuget/build/xamarinmac2.0/SkiaSharp.targets rename to binding/SkiaSharp/nuget/build/xamarinmac/SkiaSharp.targets diff --git a/binding/SkiaSharp/nuget/build/xamarintvos/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/xamarintvos/SkiaSharp.targets new file mode 100644 index 0000000000..a53c273125 --- /dev/null +++ b/binding/SkiaSharp/nuget/build/xamarintvos/SkiaSharp.targets @@ -0,0 +1,13 @@ + + + + + + True + + + + + + + \ No newline at end of file diff --git a/binding/SkiaSharp/nuget/build/xamarinwatchos/SkiaSharp.targets b/binding/SkiaSharp/nuget/build/xamarinwatchos/SkiaSharp.targets new file mode 100644 index 0000000000..749476e1fc --- /dev/null +++ b/binding/SkiaSharp/nuget/build/xamarinwatchos/SkiaSharp.targets @@ -0,0 +1,13 @@ + + + + + + True + + + + + + + \ No newline at end of file diff --git a/build.cake b/build.cake index 4a8ec3adc1..354e768f5e 100644 --- a/build.cake +++ b/build.cake @@ -328,9 +328,10 @@ Task ("tests-wasm") WorkingDirectory = pubDir, }); DotNetCoreRun("./utils/WasmTestRunner/WasmTestRunner.csproj", - "http://localhost:8000/ " + - "-o ./tests/SkiaSharp.Wasm.Tests/TestResults/ " + - (string.IsNullOrEmpty(CHROMEWEBDRIVER) ? "" : $"-d {CHROMEWEBDRIVER}")); + "--output=\"./tests/SkiaSharp.Wasm.Tests/TestResults/\" " + + (string.IsNullOrEmpty(CHROMEWEBDRIVER) ? "" : $"--driver=\"{CHROMEWEBDRIVER}\" ") + + "--verbose " + + "\"http://127.0.0.1:8000/\" "); } catch { failedTests++; } finally { diff --git a/cake/UtilsManaged.cake b/cake/UtilsManaged.cake index bf098b8020..bc514d1748 100644 --- a/cake/UtilsManaged.cake +++ b/cake/UtilsManaged.cake @@ -203,9 +203,31 @@ string[] GetReferenceSearchPaths() return refs.ToArray(); } +string[] GetDotNetPacksSearchPaths() +{ + var refs = new List(); + + RunProcess("dotnet", "--list-sdks", out var sdks); + + var last = sdks.Last(); + var start = last.IndexOf("[") + 1; + var latestSdk = (DirectoryPath)(last.Substring(start, last.Length - start - 1)); + var dotnetRoot = latestSdk.Combine(".."); + + var packs = GetDirectories(dotnetRoot.Combine("packs").FullPath + "/*.Ref"); + + foreach(var pack in packs) { + var latestPath = GetDirectories(pack.FullPath + "/*").Last(); + refs.AddRange(GetDirectories(latestPath.FullPath + "/ref/net*").Select(d => d.FullPath)); + } + + return refs.ToArray(); +} + async Task CreateNuGetDiffAsync() { var comparer = new NuGetDiff(); + comparer.SearchPaths.AddRange(GetDotNetPacksSearchPaths()); comparer.SearchPaths.AddRange(GetReferenceSearchPaths()); comparer.PackageCache = PACKAGE_CACHE_PATH.FullPath; diff --git a/images/forground.png b/images/forground.png new file mode 100644 index 0000000000..a899530df4 Binary files /dev/null and b/images/forground.png differ diff --git a/nuget/HarfbuzzSharp.nuspec b/nuget/HarfbuzzSharp.nuspec index 7bab04f53d..c8c7c14d10 100644 --- a/nuget/HarfbuzzSharp.nuspec +++ b/nuget/HarfbuzzSharp.nuspec @@ -56,6 +56,16 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + + + @@ -84,6 +94,16 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + + + @@ -92,14 +112,22 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + @@ -119,17 +147,18 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release - - - - + + + + - + + + - + - - + diff --git a/nuget/SkiaSharp.nuspec b/nuget/SkiaSharp.nuspec index 8d7b362c09..7fc00ed706 100644 --- a/nuget/SkiaSharp.nuspec +++ b/nuget/SkiaSharp.nuspec @@ -57,6 +57,16 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + + + @@ -85,6 +95,16 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + + + @@ -93,14 +113,22 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release + + + + + + + + @@ -128,23 +156,25 @@ Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release - - - - + + + + - + + + - + - + - + \ No newline at end of file diff --git a/samples/Basic/Maui/Directory.Build.targets b/samples/Basic/Maui/Directory.Build.targets new file mode 100644 index 0000000000..fa64a8926d --- /dev/null +++ b/samples/Basic/Maui/Directory.Build.targets @@ -0,0 +1,21 @@ + + + + + <_KeepLaunchProfiles>true + + + + + + + + + + + + + + + + diff --git a/samples/Basic/Maui/SkiaSharpSample.WinUI/Properties/launchSettings.json b/samples/Basic/Maui/SkiaSharpSample.WinUI/Properties/launchSettings.json new file mode 100644 index 0000000000..fe30f65c7b --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample.WinUI/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "SkiaSharpSample.WinUI": { + "commandName": "AppContainer" + } + } +} \ No newline at end of file diff --git a/samples/Basic/Maui/SkiaSharpSample.WinUI/SkiaSharpSample.WinUI.csproj b/samples/Basic/Maui/SkiaSharpSample.WinUI/SkiaSharpSample.WinUI.csproj new file mode 100644 index 0000000000..fc043e96da --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample.WinUI/SkiaSharpSample.WinUI.csproj @@ -0,0 +1,48 @@ + + + + net6.0-windows10.0.19041 + WinExe + 10.0.17763.0 + true + SkiaSharpSample + + + true + MSIX + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + libSkiaSharp.dll + PreserveNewest + + + + diff --git a/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/App.xaml b/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/App.xaml new file mode 100644 index 0000000000..91041cb690 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/App.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/App.xaml.cs b/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/App.xaml.cs new file mode 100644 index 0000000000..5e7d9fee88 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/App.xaml.cs @@ -0,0 +1,34 @@ +using Microsoft.Maui; +using Microsoft.UI.Xaml; +using Windows.ApplicationModel; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace SkiaSharpSample.WinUI +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : MiddleApp + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + base.OnLaunched(args); + + Microsoft.Maui.Essentials.Platform.OnLaunched(args); + } + } + public class MiddleApp : MauiWinUIApplication + { + } +} diff --git a/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/Package.appxmanifest b/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/Package.appxmanifest new file mode 100644 index 0000000000..a706079bce --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/Package.appxmanifest @@ -0,0 +1,58 @@ + + + + + + + + SkiaSharpSample + Microsoft + Assets\appiconStoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/app.manifest b/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/app.manifest new file mode 100644 index 0000000000..2c0005cbbd --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample.WinUI/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/samples/Basic/Maui/SkiaSharpSample.Windows.sln b/samples/Basic/Maui/SkiaSharpSample.Windows.sln new file mode 100644 index 0000000000..fdbd3cdcb4 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample.Windows.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31220.234 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharpSample", "SkiaSharpSample\SkiaSharpSample.csproj", "{4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharpSample.WinUI", "SkiaSharpSample.WinUI\SkiaSharpSample.WinUI.csproj", "{7FC4C884-2318-4FEC-9B5E-7A891F9A439D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharp", "..\..\..\binding\SkiaSharp\SkiaSharp.csproj", "{3258831C-E589-4A15-869B-877737D01F21}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Release|Any CPU.Build.0 = Release|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Release|Any CPU.Deploy.0 = Release|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Release|Any CPU.Build.0 = Release|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Release|Any CPU.Deploy.0 = Release|Any CPU + {3258831C-E589-4A15-869B-877737D01F21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3258831C-E589-4A15-869B-877737D01F21}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3258831C-E589-4A15-869B-877737D01F21}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3258831C-E589-4A15-869B-877737D01F21}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/samples/Basic/Maui/SkiaSharpSample.sln b/samples/Basic/Maui/SkiaSharpSample.sln new file mode 100644 index 0000000000..fdbd3cdcb4 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31220.234 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharpSample", "SkiaSharpSample\SkiaSharpSample.csproj", "{4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharpSample.WinUI", "SkiaSharpSample.WinUI\SkiaSharpSample.WinUI.csproj", "{7FC4C884-2318-4FEC-9B5E-7A891F9A439D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharp", "..\..\..\binding\SkiaSharp\SkiaSharp.csproj", "{3258831C-E589-4A15-869B-877737D01F21}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Release|Any CPU.Build.0 = Release|Any CPU + {4AD1D2A5-5A7B-4E7B-87C5-C21756DA8D02}.Release|Any CPU.Deploy.0 = Release|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Release|Any CPU.Build.0 = Release|Any CPU + {7FC4C884-2318-4FEC-9B5E-7A891F9A439D}.Release|Any CPU.Deploy.0 = Release|Any CPU + {3258831C-E589-4A15-869B-877737D01F21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3258831C-E589-4A15-869B-877737D01F21}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3258831C-E589-4A15-869B-877737D01F21}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3258831C-E589-4A15-869B-877737D01F21}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/samples/Basic/Maui/SkiaSharpSample/Android/AndroidManifest.xml b/samples/Basic/Maui/SkiaSharpSample/Android/AndroidManifest.xml new file mode 100644 index 0000000000..6a35c95a93 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/samples/Basic/Maui/SkiaSharpSample/Android/MainActivity.cs b/samples/Basic/Maui/SkiaSharpSample/Android/MainActivity.cs new file mode 100644 index 0000000000..a7732712d7 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/Android/MainActivity.cs @@ -0,0 +1,11 @@ +using Android.App; +using Android.Content.PM; +using Microsoft.Maui; + +namespace SkiaSharpSample +{ + [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)] + public class MainActivity : MauiAppCompatActivity + { + } +} \ No newline at end of file diff --git a/samples/Basic/Maui/SkiaSharpSample/Android/MainApplication.cs b/samples/Basic/Maui/SkiaSharpSample/Android/MainApplication.cs new file mode 100644 index 0000000000..1812993bc1 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/Android/MainApplication.cs @@ -0,0 +1,16 @@ +using System; +using Android.App; +using Android.Runtime; +using Microsoft.Maui; + +namespace SkiaSharpSample +{ + [Application] + public class MainApplication : MauiApplication + { + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + } +} \ No newline at end of file diff --git a/samples/Basic/Maui/SkiaSharpSample/App.xaml b/samples/Basic/Maui/SkiaSharpSample/App.xaml new file mode 100644 index 0000000000..9d3ea833fb --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/samples/Basic/Maui/SkiaSharpSample/App.xaml.cs b/samples/Basic/Maui/SkiaSharpSample/App.xaml.cs new file mode 100644 index 0000000000..790f011810 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/App.xaml.cs @@ -0,0 +1,23 @@ +using Microsoft.Maui; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific; +using Application = Microsoft.Maui.Controls.Application; +using WindowsConfiguration = Microsoft.Maui.Controls.PlatformConfiguration.Windows; + +namespace SkiaSharpSample +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + } + + protected override IWindow CreateWindow(IActivationState activationState) + { + On().SetImageDirectory("Assets"); + + return new Window(new MainPage()); + } + } +} diff --git a/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/AppDelegate.cs b/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000000..8a96b63f15 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; +using Microsoft.Maui; + +namespace SkiaSharpSample +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + } +} \ No newline at end of file diff --git a/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/Entitlements.plist b/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/Entitlements.plist new file mode 100644 index 0000000000..36a8706706 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/Info.plist b/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/Info.plist new file mode 100644 index 0000000000..c70cb4ad8b --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/Info.plist @@ -0,0 +1,34 @@ + + + + + LSMinimumSystemVersion + 10.15 + UIDeviceFamily + + 1 + 2 + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/Program.cs b/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/Program.cs new file mode 100644 index 0000000000..6175f1b237 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/MacCatalyst/Program.cs @@ -0,0 +1,15 @@ +using UIKit; + +namespace SkiaSharpSample +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, "AppDelegate"); + } + } +} \ No newline at end of file diff --git a/samples/Basic/Maui/SkiaSharpSample/MainPage.xaml b/samples/Basic/Maui/SkiaSharpSample/MainPage.xaml new file mode 100644 index 0000000000..c44c8e7e7c --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/MainPage.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/samples/Basic/Maui/SkiaSharpSample/MainPage.xaml.cs b/samples/Basic/Maui/SkiaSharpSample/MainPage.xaml.cs new file mode 100644 index 0000000000..b31afd6b86 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/MainPage.xaml.cs @@ -0,0 +1,47 @@ +using System.IO; +using Microsoft.Maui.Controls; +using SkiaSharp; + +namespace SkiaSharpSample +{ + public partial class MainPage : ContentPage + { + public MainPage() + { + InitializeComponent(); + + imageView.Source = ImageSource.FromStream(() => CreateImage()); + } + + private Stream CreateImage() + { + // crate a surface + var info = new SKImageInfo(256, 256); + using var surface = SKSurface.Create(info); + + // the the canvas and properties + var canvas = surface.Canvas; + + // make sure the canvas is blank + canvas.Clear(SKColors.White); + + // draw some text + using var paint = new SKPaint + { + Color = SKColors.Black, + IsAntialias = true, + Style = SKPaintStyle.Fill, + TextAlign = SKTextAlign.Center, + TextSize = 24 + }; + var coord = new SKPoint(info.Width / 2, (info.Height + paint.TextSize) / 2); + canvas.DrawText("SkiaSharp", coord, paint); + + // encode the file + using var image = surface.Snapshot(); + + var data = image.Encode(SKEncodedImageFormat.Png, 100); + return data.AsStream(true); + } + } +} diff --git a/samples/Basic/Maui/SkiaSharpSample/Resources/appicon.png b/samples/Basic/Maui/SkiaSharpSample/Resources/appicon.png new file mode 100644 index 0000000000..358a36dc46 Binary files /dev/null and b/samples/Basic/Maui/SkiaSharpSample/Resources/appicon.png differ diff --git a/samples/Basic/Maui/SkiaSharpSample/Resources/skiasharplogo.png b/samples/Basic/Maui/SkiaSharpSample/Resources/skiasharplogo.png new file mode 100644 index 0000000000..358a36dc46 Binary files /dev/null and b/samples/Basic/Maui/SkiaSharpSample/Resources/skiasharplogo.png differ diff --git a/samples/Basic/Maui/SkiaSharpSample/SkiaSharpSample.csproj b/samples/Basic/Maui/SkiaSharpSample/SkiaSharpSample.csproj new file mode 100644 index 0000000000..89ad4e4f11 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/SkiaSharpSample.csproj @@ -0,0 +1,35 @@ + + + + net6.0-ios;net6.0-android + Exe + true + SkiaSharpSample + SkiaSharpSample + com.companyname.SkiaSharpSample + 1.0 + 1 + + + + + + + + + + + + + + + + + true + iossimulator-x64 + maccatalyst-x64 + + + + + diff --git a/samples/Basic/Maui/SkiaSharpSample/Startup.cs b/samples/Basic/Maui/SkiaSharpSample/Startup.cs new file mode 100644 index 0000000000..3fb85ccbb9 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/Startup.cs @@ -0,0 +1,12 @@ +using Microsoft.Maui; +using Microsoft.Maui.Controls.Hosting; +using Microsoft.Maui.Hosting; + +namespace SkiaSharpSample +{ + public class Startup : IStartup + { + public void Configure(IAppHostBuilder appBuilder) => + appBuilder.UseMauiApp(); + } +} diff --git a/samples/Basic/Maui/SkiaSharpSample/iOS/AppDelegate.cs b/samples/Basic/Maui/SkiaSharpSample/iOS/AppDelegate.cs new file mode 100644 index 0000000000..8a96b63f15 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/iOS/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; +using Microsoft.Maui; + +namespace SkiaSharpSample +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + } +} \ No newline at end of file diff --git a/samples/Basic/Maui/SkiaSharpSample/iOS/Entitlements.plist b/samples/Basic/Maui/SkiaSharpSample/iOS/Entitlements.plist new file mode 100644 index 0000000000..36a8706706 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/iOS/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/samples/Basic/Maui/SkiaSharpSample/iOS/Info.plist b/samples/Basic/Maui/SkiaSharpSample/iOS/Info.plist new file mode 100644 index 0000000000..ed2ffb61b4 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/iOS/Info.plist @@ -0,0 +1,34 @@ + + + + + LSRequiresIPhoneOS + + MinimumOSVersion + 10.3.4 + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/samples/Basic/Maui/SkiaSharpSample/iOS/Program.cs b/samples/Basic/Maui/SkiaSharpSample/iOS/Program.cs new file mode 100644 index 0000000000..6175f1b237 --- /dev/null +++ b/samples/Basic/Maui/SkiaSharpSample/iOS/Program.cs @@ -0,0 +1,15 @@ +using UIKit; + +namespace SkiaSharpSample +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, "AppDelegate"); + } + } +} \ No newline at end of file diff --git a/scripts/azure-pipelines.yml b/scripts/azure-pipelines.yml index 20e3525170..2306c611df 100644 --- a/scripts/azure-pipelines.yml +++ b/scripts/azure-pipelines.yml @@ -23,8 +23,11 @@ variables: MONO_VERSION_MACOS: '6_12_7' MONO_VERSION_LINUX: '' XCODE_VERSION: 12.4 - DOTNET_VERSION_PREVIOUS: 3.1.408 - DOTNET_VERSION: 5.0.202 + DOTNET_VERSION_PREVIOUS: 3.1.410 + DOTNET_VERSION: 5.0.301 + DOTNET_VERSION_PREVIEW: 6.0.100-preview.5.21302.13 + VS_VERSION_PREVIEW: 16/pre + MAUI_CHECK_MANIFEST: https://raw.githubusercontent.com/Redth/dotnet-maui-check/165c910079623e73ecb04c50bade01da1f78f6c9/manifests/maui-preview.manifest.json CONFIGURATION: 'Release' VM_IMAGE_WINDOWS: windows-2019 VM_IMAGE_WINDOWS_PREVIOUS: vs2017-win2016 @@ -35,7 +38,7 @@ variables: NUGET_DIFF_PRERELEASE: false ENABLE_CODE_COVERAGE: true EMSCRIPTEN_VERSION: 2.0.12 - XHARNESS_VERSION: 1.0.0-prerelease.21180.1 + XHARNESS_VERSION: 1.0.0-prerelease.21314.1 resources: repositories: @@ -392,6 +395,7 @@ stages: target: nuget additionalArgs: --packall=true --skipbuild=true installWindowsSdk: false + installDotNet: false shouldPublish: true requiredArtifacts: - managed_linux @@ -431,6 +435,7 @@ stages: target: docs-api-diff additionalArgs: --nugetDiffPrerelease=$(NUGET_DIFF_PRERELEASE) installWindowsSdk: false + installPreviewVs: false shouldPublish: false requiredArtifacts: - package_windows @@ -790,6 +795,7 @@ stages: vmImage: $(VM_IMAGE_WINDOWS_PREVIOUS) target: git-sync-deps installWindowsSdk: false + installDotNet: false shouldPublish: false postBuildSteps: - task: CredScan@2 diff --git a/scripts/azure-templates-bootstrapper.yml b/scripts/azure-templates-bootstrapper.yml index ee62ddea32..19b197c1da 100644 --- a/scripts/azure-templates-bootstrapper.yml +++ b/scripts/azure-templates-bootstrapper.yml @@ -5,6 +5,7 @@ parameters: packages: '' # any additional packages target: '' # the bootstrapper target dependsOn: [] # the dependiencies + variables: [] # the job variables requiredArtifacts: [] # the artifacts that this build needs to download demands: [] # the demands preBuildSteps: [] # any steps to run before the build @@ -22,6 +23,8 @@ parameters: installAndroidNdk: true # whether or not to install the Android NDK installTizenSdk: true # whether or not to install the Tizen SDK installWindowsSdk: true # whether or not to install the Windows SDK + installPreviewVs: true # whether or not to install the preview VS + installDotNet: true # whether or not to install the dotnet SDK installLlvm: true # whether or not to install the LLVM compiler installEmsdk: false # whether or not to install the Emscripten SDK @@ -45,6 +48,7 @@ jobs: demands: ${{ parameters.demands }} dependsOn: ${{ parameters.dependsOn }} condition: ${{ parameters.condition }} + variables: ${{ parameters.variables }} steps: # prepare - checkout: self @@ -99,20 +103,31 @@ jobs: # install extra bits for the manged builds - ${{ if not(startsWith(parameters.name, 'native_')) }}: - - task: UseDotNet@2 - inputs: - packageType: 'sdk' - version: $(DOTNET_VERSION_PREVIOUS) - performMultiLevelLookup: true - displayName: Install the previous version of .NET Core - - task: UseDotNet@2 - inputs: - packageType: 'sdk' - version: $(DOTNET_VERSION) - performMultiLevelLookup: true - displayName: Install the correct version of .NET Core - - pwsh: dotnet --info - displayName: Display all the .NET information + - ${{ if eq(parameters.installDotNet, 'true') }}: + - task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: $(DOTNET_VERSION_PREVIOUS) + performMultiLevelLookup: true + displayName: Install the previous version of .NET Core + - task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: $(DOTNET_VERSION) + performMultiLevelLookup: true + displayName: Install the correct version of .NET Core + # install the bits needed for net6 builds + - pwsh: .\scripts\install-dotnet.ps1 -Version $env:DOTNET_VERSION_PREVIEW -InstallDir "$env:AGENT_TOOLSDIRECTORY/dotnet" + displayName: Install the preview version of .NET Core + - ${{ if and(endsWith(parameters.name, '_windows'), eq(parameters.installPreviewVs, 'true')) }}: + - pwsh: .\scripts\install-vs.ps1 -Version $env:VS_VERSION_PREVIEW + displayName: Install Visual Studio Preview + - ${{ if not(endsWith(parameters.name, '_linux')) }}: + - pwsh: .\scripts\install-maui.ps1 -Manifest $env:MAUI_CHECK_MANIFEST -InstallDir "$env:AGENT_TOOLSDIRECTORY/dotnet" + displayName: Install the .NET Core workloads + # display dotnet info + - pwsh: dotnet --info + displayName: Display all the .NET information # install the mac tools - ${{ if endsWith(parameters.name, '_macos') }}: diff --git a/scripts/install-dotnet.ps1 b/scripts/install-dotnet.ps1 new file mode 100644 index 0000000000..f86bc46a29 --- /dev/null +++ b/scripts/install-dotnet.ps1 @@ -0,0 +1,31 @@ +Param( + [string] $Version, + [string] $InstallDir +) + +$ErrorActionPreference = 'Stop' + +if ($IsMacOS -or $IsLinux) { + $url = "https://dot.net/v1/dotnet-install.sh" +} else { + $url = "https://dot.net/v1/dotnet-install.ps1" +} + +Write-Host "Downloading .NET Installer..." +Invoke-WebRequest ` + -Uri "$url" ` + -OutFile (Split-Path $url -Leaf) + +Write-Host "Installing .NET $Version..." +if ($IsMacOS) { + & sh dotnet-install.sh --version "$Version" --install-dir "$InstallDir" --verbose +} elseif ($IsLinux) { + & bash dotnet-install.sh --version "$Version" --install-dir "$InstallDir" --verbose +} else { + .\dotnet-install.ps1 -Version "$Version" -InstallDir "$InstallDir" -Verbose +} + +Write-Host "Installed .NET Versions:" +& dotnet --list-sdks + +exit $LASTEXITCODE diff --git a/scripts/install-maui.ps1 b/scripts/install-maui.ps1 new file mode 100644 index 0000000000..c8b9c26eeb --- /dev/null +++ b/scripts/install-maui.ps1 @@ -0,0 +1,22 @@ +Param( + [string] $InstallDir, + [string] $Manifest +) + +$ErrorActionPreference = 'Stop' + +$env:DOTNET_ROOT="$InstallDir" + +Write-Host "Installing maui-check..." +& dotnet tool update --global redth.net.maui.check + +Write-Host "Installing Maui..." +& maui-check ` + --manifest "$Manifest" ` + --verbose --ci --fix --non-interactive ` + --skip androidsdk ` + --skip xcode ` + --skip vswin ` + --skip vsmac + +exit $LASTEXITCODE diff --git a/scripts/install-vs.ps1 b/scripts/install-vs.ps1 new file mode 100644 index 0000000000..b71d2fb65d --- /dev/null +++ b/scripts/install-vs.ps1 @@ -0,0 +1,32 @@ +Param( + [string] $Version = "16/pre" +) + +$ErrorActionPreference = 'Stop' + +Write-Host "Downloading Visual Studio..." +Invoke-WebRequest -UseBasicParsing ` + -Uri "https://aka.ms/vs/$Version/vs_community.exe" ` + -OutFile vs_community.exe + +Write-Host "Installing Visual Studio..." +./vs_community.exe --passive --norestart --wait ` + --add Microsoft.VisualStudio.Workload.NetCrossPlat ` + --add Microsoft.VisualStudio.Workload.NetCoreTools ` + --add Microsoft.VisualStudio.Workload.ManagedDesktop ` + --add Microsoft.VisualStudio.Workload.Universal ` + | Out-Null + +Remove-Item vs_community.exe + +$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + +Write-Host "Setting Environment Variables..." +$installationPath = & $vswhere -latest -prerelease -property installationPath +Write-Host "##vso[task.prependpath]$installationPath\MSBuild\Current\Bin" +Write-Host "##vso[task.setvariable variable=VS_INSTALL]$installationPath" + +Write-Host "Installed Visual Studio Versions:" +& $vswhere -all -prerelease -property installationPath + +exit $LASTEXITCODE diff --git a/source/SkiaSharp.Build.props b/source/SkiaSharp.Build.props index c0646a46cc..00feefa2fa 100644 --- a/source/SkiaSharp.Build.props +++ b/source/SkiaSharp.Build.props @@ -8,10 +8,18 @@ - part of SkiaSharp.Views.Forms: SKx00x --> + + $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows))) + $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX))) + $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux))) + + true true + true + false $(MSBuildThisFileDirectory)..\docs\SkiaSharpAPI 8.0 @@ -35,12 +43,6 @@ true - - $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows))) - $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX))) - $([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux))) - - 1) - throw new OptionException(); + throw new OptionException("To many extras provided.", "extras"); Url = extra.FirstOrDefault() ?? DefaultUrl; if (string.IsNullOrEmpty(OutputPath)) @@ -56,11 +56,13 @@ public static int Main(string[] args) if (!string.IsNullOrEmpty(dir)) Directory.CreateDirectory(dir); } - catch (OptionException e) + catch (OptionException ex) { Console.Error.Write("wasm-test: "); - Console.Error.WriteLine(e.Message); + Console.Error.WriteLine(ex.Message); Console.Error.WriteLine("Try `wasm-test --help' for more information."); + if (Verbose) + Console.Error.WriteLine(ex); return 1; } diff --git a/utils/WasmTestRunner/WasmTestRunner.csproj b/utils/WasmTestRunner/WasmTestRunner.csproj index fbe1421883..7f73c189b1 100644 --- a/utils/WasmTestRunner/WasmTestRunner.csproj +++ b/utils/WasmTestRunner/WasmTestRunner.csproj @@ -10,7 +10,7 @@ - + \ No newline at end of file