diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index b24b8faa4..12cd459dd 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -27,6 +27,18 @@ jobs: with: dotnet-version: 3.1.x + - name: Install .NET 5 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + + - name: Add MSBuild to PATH + uses: glennawatson/setup-msbuild@v1.0.3 + + - name: Update VS2019 + shell: powershell + run: Start-Process -Wait -PassThru -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise""" + - name: NBGV id: nbgv uses: dotnet/nbgv@master @@ -37,11 +49,8 @@ jobs: run: dotnet restore working-directory: src - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1 - - name: Build - run: msbuild /t:build,pack /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=${{ env.configuration }} + run: msbuild /t:build,pack /nowarn:MSB4011 /maxcpucount /p:NoPackageAnalysis=true /verbosity:minimal /p:Configuration=${{ env.configuration }} working-directory: src - name: Run Unit Tests and Generate Coverage @@ -52,7 +61,6 @@ jobs: exclude-filter: '[${{env.productNamespacePrefix}}.*.Tests.*]*' include-filter: '[${{env.productNamespacePrefix}}*]*' output-format: cobertura - merge-with: '../../artifacts/coverage.json' output: '../../artifacts/' configuration: ${{ env.configuration }} diff --git a/src/Directory.build.props b/src/Directory.build.props index 5e7faf37f..3efe27506 100644 --- a/src/Directory.build.props +++ b/src/Directory.build.props @@ -40,9 +40,9 @@ - + - + @@ -68,7 +68,7 @@ - + diff --git a/src/Splat.AppCenter/Splat.AppCenter.csproj b/src/Splat.AppCenter/Splat.AppCenter.csproj index bc74ced1c..8f0396505 100644 --- a/src/Splat.AppCenter/Splat.AppCenter.csproj +++ b/src/Splat.AppCenter/Splat.AppCenter.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard2.0;net5.0 Splat.AppCenter Splat .NET Foundation and Contributors diff --git a/src/Splat.ApplicationInsights/Splat.ApplicationInsights.csproj b/src/Splat.ApplicationInsights/Splat.ApplicationInsights.csproj index cbd471e03..0e0dab1fe 100644 --- a/src/Splat.ApplicationInsights/Splat.ApplicationInsights.csproj +++ b/src/Splat.ApplicationInsights/Splat.ApplicationInsights.csproj @@ -1,6 +1,7 @@ - + - netstandard2.0 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Splat.ApplicationInsights Splat .NET Foundation and Contributors @@ -9,7 +10,7 @@ latest - + diff --git a/src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj b/src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj index 39e0b30d3..0c09fe3f9 100644 --- a/src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj +++ b/src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0;netcoreapp3.1 false $(NoWarn);1591;CA1707;SA1633;CA2000 diff --git a/src/Splat.Autofac/Splat.Autofac.csproj b/src/Splat.Autofac/Splat.Autofac.csproj index 5eceafd32..8f26704a9 100644 --- a/src/Splat.Autofac/Splat.Autofac.csproj +++ b/src/Splat.Autofac/Splat.Autofac.csproj @@ -1,8 +1,8 @@ - + - netstandard2.0 - $(TargetFrameworks);net461;uap10.0.16299 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Autofac adapter for Splat latest diff --git a/src/Splat.Common.Test/Splat.Common.Test.csproj b/src/Splat.Common.Test/Splat.Common.Test.csproj index 37ac428a8..2d14f994c 100644 --- a/src/Splat.Common.Test/Splat.Common.Test.csproj +++ b/src/Splat.Common.Test/Splat.Common.Test.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard2.0;net5.0 $(NoWarn);CA2000 latest diff --git a/src/Splat.Tests/API/ApiApprovalTests.SplatUIProject.net472.approved.txt b/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject..approved.txt similarity index 98% rename from src/Splat.Tests/API/ApiApprovalTests.SplatUIProject.net472.approved.txt rename to src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject..approved.txt index 2ba1cea19..ff4c5127a 100644 --- a/src/Splat.Tests/API/ApiApprovalTests.SplatUIProject.net472.approved.txt +++ b/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject..approved.txt @@ -1,8 +1,11 @@ [assembly: System.Resources.NeutralResourcesLanguage("en-US")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Drawing.Tests")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Android")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Uwp")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Tests")] -[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName=".NET Framework 4.6.1")] +[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows7.0")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v5.0", FrameworkDisplayName="")] +[assembly: System.Runtime.Versioning.TargetPlatform("Windows7.0")] namespace Splat { public static class BitmapLoader diff --git a/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject.net5.0.approved.txt b/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject.net5.0.approved.txt new file mode 100644 index 000000000..ff4c5127a --- /dev/null +++ b/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject.net5.0.approved.txt @@ -0,0 +1,449 @@ +[assembly: System.Resources.NeutralResourcesLanguage("en-US")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Drawing.Tests")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Android")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Uwp")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Tests")] +[assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows7.0")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v5.0", FrameworkDisplayName="")] +[assembly: System.Runtime.Versioning.TargetPlatform("Windows7.0")] +namespace Splat +{ + public static class BitmapLoader + { + public static Splat.IBitmapLoader Current { get; set; } + } + [System.Serializable] + public class BitmapLoaderException : System.Exception + { + public BitmapLoaderException() { } + public BitmapLoaderException(string message) { } + protected BitmapLoaderException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + public BitmapLoaderException(string message, System.Exception innerException) { } + } + public static class BitmapMixins + { + public static Splat.IBitmap FromNative(this System.Windows.Media.Imaging.BitmapSource value) { } + public static System.Windows.Media.Imaging.BitmapSource ToNative(this Splat.IBitmap value) { } + } + public static class ColorExtensions + { + public static System.Drawing.Color FromNative(this System.Windows.Media.Color value) { } + public static System.Windows.Media.Color ToNative(this System.Drawing.Color value) { } + public static System.Windows.Media.SolidColorBrush ToNativeBrush(this System.Drawing.Color value) { } + } + public enum CompressedBitmapFormat + { + Png = 0, + Jpeg = 1, + } + public class DefaultPlatformModeDetector : Splat.IPlatformModeDetector + { + public DefaultPlatformModeDetector() { } + public bool? InDesignMode() { } + } + public interface IBitmap : System.IDisposable + { + float Height { get; } + float Width { get; } + System.Threading.Tasks.Task Save(Splat.CompressedBitmapFormat format, float quality, System.IO.Stream target); + } + public interface IBitmapLoader + { + Splat.IBitmap Create(float width, float height); + System.Threading.Tasks.Task Load(System.IO.Stream sourceStream, float? desiredWidth, float? desiredHeight); + System.Threading.Tasks.Task LoadFromResource(string source, float? desiredWidth, float? desiredHeight); + } + public interface IPlatformModeDetector + { + bool? InDesignMode(); + } + public enum KnownColor + { + ActiveBorder = 1, + ActiveCaption = 2, + ActiveCaptionText = 3, + AppWorkspace = 4, + Control = 5, + ControlDark = 6, + ControlDarkDark = 7, + ControlLight = 8, + ControlLightLight = 9, + ControlText = 10, + Desktop = 11, + GrayText = 12, + Highlight = 13, + HighlightText = 14, + HotTrack = 15, + InactiveBorder = 16, + InactiveCaption = 17, + InactiveCaptionText = 18, + Info = 19, + InfoText = 20, + Menu = 21, + MenuText = 22, + ScrollBar = 23, + Window = 24, + WindowFrame = 25, + WindowText = 26, + Transparent = 27, + AliceBlue = 28, + AntiqueWhite = 29, + Aqua = 30, + Aquamarine = 31, + Azure = 32, + Beige = 33, + Bisque = 34, + Black = 35, + BlanchedAlmond = 36, + Blue = 37, + BlueViolet = 38, + Brown = 39, + BurlyWood = 40, + CadetBlue = 41, + Chartreuse = 42, + Chocolate = 43, + Coral = 44, + CornflowerBlue = 45, + Cornsilk = 46, + Crimson = 47, + Cyan = 48, + DarkBlue = 49, + DarkCyan = 50, + DarkGoldenrod = 51, + DarkGray = 52, + DarkGreen = 53, + DarkKhaki = 54, + DarkMagenta = 55, + DarkOliveGreen = 56, + DarkOrange = 57, + DarkOrchid = 58, + DarkRed = 59, + DarkSalmon = 60, + DarkSeaGreen = 61, + DarkSlateBlue = 62, + DarkSlateGray = 63, + DarkTurquoise = 64, + DarkViolet = 65, + DeepPink = 66, + DeepSkyBlue = 67, + DimGray = 68, + DodgerBlue = 69, + Firebrick = 70, + FloralWhite = 71, + ForestGreen = 72, + Fuchsia = 73, + Gainsboro = 74, + GhostWhite = 75, + Gold = 76, + Goldenrod = 77, + Gray = 78, + Green = 79, + GreenYellow = 80, + Honeydew = 81, + HotPink = 82, + IndianRed = 83, + Indigo = 84, + Ivory = 85, + Khaki = 86, + Lavender = 87, + LavenderBlush = 88, + LawnGreen = 89, + LemonChiffon = 90, + LightBlue = 91, + LightCoral = 92, + LightCyan = 93, + LightGoldenrodYellow = 94, + LightGray = 95, + LightGreen = 96, + LightPink = 97, + LightSalmon = 98, + LightSeaGreen = 99, + LightSkyBlue = 100, + LightSlateGray = 101, + LightSteelBlue = 102, + LightYellow = 103, + Lime = 104, + LimeGreen = 105, + Linen = 106, + Magenta = 107, + Maroon = 108, + MediumAquamarine = 109, + MediumBlue = 110, + MediumOrchid = 111, + MediumPurple = 112, + MediumSeaGreen = 113, + MediumSlateBlue = 114, + MediumSpringGreen = 115, + MediumTurquoise = 116, + MediumVioletRed = 117, + MidnightBlue = 118, + MintCream = 119, + MistyRose = 120, + Moccasin = 121, + NavajoWhite = 122, + Navy = 123, + OldLace = 124, + Olive = 125, + OliveDrab = 126, + Orange = 127, + OrangeRed = 128, + Orchid = 129, + PaleGoldenrod = 130, + PaleGreen = 131, + PaleTurquoise = 132, + PaleVioletRed = 133, + PapayaWhip = 134, + PeachPuff = 135, + Peru = 136, + Pink = 137, + Plum = 138, + PowderBlue = 139, + Purple = 140, + Red = 141, + RosyBrown = 142, + RoyalBlue = 143, + SaddleBrown = 144, + Salmon = 145, + SandyBrown = 146, + SeaGreen = 147, + SeaShell = 148, + Sienna = 149, + Silver = 150, + SkyBlue = 151, + SlateBlue = 152, + SlateGray = 153, + Snow = 154, + SpringGreen = 155, + SteelBlue = 156, + Tan = 157, + Teal = 158, + Thistle = 159, + Tomato = 160, + Turquoise = 161, + Violet = 162, + Wheat = 163, + White = 164, + WhiteSmoke = 165, + Yellow = 166, + YellowGreen = 167, + ButtonFace = 168, + ButtonHighlight = 169, + ButtonShadow = 170, + GradientActiveCaption = 171, + GradientInactiveCaption = 172, + MenuBar = 173, + MenuHighlight = 174, + } + public class PlatformBitmapLoader : Splat.IBitmapLoader + { + public PlatformBitmapLoader() { } + public Splat.IBitmap Create(float width, float height) { } + public System.Threading.Tasks.Task Load(System.IO.Stream sourceStream, float? desiredWidth, float? desiredHeight) { } + public System.Threading.Tasks.Task LoadFromResource(string resource, float? desiredWidth, float? desiredHeight) { } + } + public static class PlatformModeDetector + { + public static bool InDesignMode() { } + public static void OverrideModeDetector(Splat.IPlatformModeDetector modeDetector) { } + } + public static class PointExtensions + { + public static System.Drawing.PointF FromNative(this System.Windows.Point value) { } + public static System.Windows.Point ToNative(this System.Drawing.Point value) { } + public static System.Windows.Point ToNative(this System.Drawing.PointF value) { } + } + public static class RectExtensions + { + public static System.Drawing.RectangleF FromNative(this System.Windows.Rect value) { } + public static System.Windows.Rect ToNative(this System.Drawing.Rectangle value) { } + public static System.Windows.Rect ToNative(this System.Drawing.RectangleF value) { } + } + public static class ServiceLocationDrawingInitialization + { + public static void RegisterPlatformBitmapLoader(this Splat.IMutableDependencyResolver resolver) { } + } + public static class SizeExtensions + { + public static System.Drawing.SizeF FromNative(this System.Windows.Size value) { } + public static System.Windows.Size ToNative(this System.Drawing.Size value) { } + public static System.Windows.Size ToNative(this System.Drawing.SizeF value) { } + } + [System.Runtime.Serialization.DataContract] + public struct SplatColor : System.IEquatable + { + public byte A { get; } + public byte B { get; } + public byte G { get; } + public bool IsEmpty { get; } + public bool IsKnownColor { get; } + public bool IsNamedColor { get; } + public bool IsSystemColor { get; } + public string Name { get; } + public byte R { get; } + public static Splat.SplatColor AliceBlue { get; } + public static Splat.SplatColor AntiqueWhite { get; } + public static Splat.SplatColor Aqua { get; } + public static Splat.SplatColor Aquamarine { get; } + public static Splat.SplatColor Azure { get; } + public static Splat.SplatColor Beige { get; } + public static Splat.SplatColor Bisque { get; } + public static Splat.SplatColor Black { get; } + public static Splat.SplatColor BlanchedAlmond { get; } + public static Splat.SplatColor Blue { get; } + public static Splat.SplatColor BlueViolet { get; } + public static Splat.SplatColor Brown { get; } + public static Splat.SplatColor BurlyWood { get; } + public static Splat.SplatColor CadetBlue { get; } + public static Splat.SplatColor Chartreuse { get; } + public static Splat.SplatColor Chocolate { get; } + public static Splat.SplatColor Coral { get; } + public static Splat.SplatColor CornflowerBlue { get; } + public static Splat.SplatColor Cornsilk { get; } + public static Splat.SplatColor Crimson { get; } + public static Splat.SplatColor Cyan { get; } + public static Splat.SplatColor DarkBlue { get; } + public static Splat.SplatColor DarkCyan { get; } + public static Splat.SplatColor DarkGoldenrod { get; } + public static Splat.SplatColor DarkGray { get; } + public static Splat.SplatColor DarkGreen { get; } + public static Splat.SplatColor DarkKhaki { get; } + public static Splat.SplatColor DarkMagenta { get; } + public static Splat.SplatColor DarkOliveGreen { get; } + public static Splat.SplatColor DarkOrange { get; } + public static Splat.SplatColor DarkOrchid { get; } + public static Splat.SplatColor DarkRed { get; } + public static Splat.SplatColor DarkSalmon { get; } + public static Splat.SplatColor DarkSeaGreen { get; } + public static Splat.SplatColor DarkSlateBlue { get; } + public static Splat.SplatColor DarkSlateGray { get; } + public static Splat.SplatColor DarkTurquoise { get; } + public static Splat.SplatColor DarkViolet { get; } + public static Splat.SplatColor DeepPink { get; } + public static Splat.SplatColor DeepSkyBlue { get; } + public static Splat.SplatColor DimGray { get; } + public static Splat.SplatColor DodgerBlue { get; } + public static Splat.SplatColor Empty { get; } + public static Splat.SplatColor Firebrick { get; } + public static Splat.SplatColor FloralWhite { get; } + public static Splat.SplatColor ForestGreen { get; } + public static Splat.SplatColor Fuchsia { get; } + public static Splat.SplatColor Gainsboro { get; } + public static Splat.SplatColor GhostWhite { get; } + public static Splat.SplatColor Gold { get; } + public static Splat.SplatColor Goldenrod { get; } + public static Splat.SplatColor Gray { get; } + public static Splat.SplatColor Green { get; } + public static Splat.SplatColor GreenYellow { get; } + public static Splat.SplatColor Honeydew { get; } + public static Splat.SplatColor HotPink { get; } + public static Splat.SplatColor IndianRed { get; } + public static Splat.SplatColor Indigo { get; } + public static Splat.SplatColor Ivory { get; } + public static Splat.SplatColor Khaki { get; } + public static Splat.SplatColor Lavender { get; } + public static Splat.SplatColor LavenderBlush { get; } + public static Splat.SplatColor LawnGreen { get; } + public static Splat.SplatColor LemonChiffon { get; } + public static Splat.SplatColor LightBlue { get; } + public static Splat.SplatColor LightCoral { get; } + public static Splat.SplatColor LightCyan { get; } + public static Splat.SplatColor LightGoldenrodYellow { get; } + public static Splat.SplatColor LightGray { get; } + public static Splat.SplatColor LightGreen { get; } + public static Splat.SplatColor LightPink { get; } + public static Splat.SplatColor LightSalmon { get; } + public static Splat.SplatColor LightSeaGreen { get; } + public static Splat.SplatColor LightSkyBlue { get; } + public static Splat.SplatColor LightSlateGray { get; } + public static Splat.SplatColor LightSteelBlue { get; } + public static Splat.SplatColor LightYellow { get; } + public static Splat.SplatColor Lime { get; } + public static Splat.SplatColor LimeGreen { get; } + public static Splat.SplatColor Linen { get; } + public static Splat.SplatColor Magenta { get; } + public static Splat.SplatColor Maroon { get; } + public static Splat.SplatColor MediumAquamarine { get; } + public static Splat.SplatColor MediumBlue { get; } + public static Splat.SplatColor MediumOrchid { get; } + public static Splat.SplatColor MediumPurple { get; } + public static Splat.SplatColor MediumSeaGreen { get; } + public static Splat.SplatColor MediumSlateBlue { get; } + public static Splat.SplatColor MediumSpringGreen { get; } + public static Splat.SplatColor MediumTurquoise { get; } + public static Splat.SplatColor MediumVioletRed { get; } + public static Splat.SplatColor MidnightBlue { get; } + public static Splat.SplatColor MintCream { get; } + public static Splat.SplatColor MistyRose { get; } + public static Splat.SplatColor Moccasin { get; } + public static Splat.SplatColor NavajoWhite { get; } + public static Splat.SplatColor Navy { get; } + public static Splat.SplatColor OldLace { get; } + public static Splat.SplatColor Olive { get; } + public static Splat.SplatColor OliveDrab { get; } + public static Splat.SplatColor Orange { get; } + public static Splat.SplatColor OrangeRed { get; } + public static Splat.SplatColor Orchid { get; } + public static Splat.SplatColor PaleGoldenrod { get; } + public static Splat.SplatColor PaleGreen { get; } + public static Splat.SplatColor PaleTurquoise { get; } + public static Splat.SplatColor PaleVioletRed { get; } + public static Splat.SplatColor PapayaWhip { get; } + public static Splat.SplatColor PeachPuff { get; } + public static Splat.SplatColor Peru { get; } + public static Splat.SplatColor Pink { get; } + public static Splat.SplatColor Plum { get; } + public static Splat.SplatColor PowderBlue { get; } + public static Splat.SplatColor Purple { get; } + public static Splat.SplatColor Red { get; } + public static Splat.SplatColor RosyBrown { get; } + public static Splat.SplatColor RoyalBlue { get; } + public static Splat.SplatColor SaddleBrown { get; } + public static Splat.SplatColor Salmon { get; } + public static Splat.SplatColor SandyBrown { get; } + public static Splat.SplatColor SeaGreen { get; } + public static Splat.SplatColor SeaShell { get; } + public static Splat.SplatColor Sienna { get; } + public static Splat.SplatColor Silver { get; } + public static Splat.SplatColor SkyBlue { get; } + public static Splat.SplatColor SlateBlue { get; } + public static Splat.SplatColor SlateGray { get; } + public static Splat.SplatColor Snow { get; } + public static Splat.SplatColor SpringGreen { get; } + public static Splat.SplatColor SteelBlue { get; } + public static Splat.SplatColor Tan { get; } + public static Splat.SplatColor Teal { get; } + public static Splat.SplatColor Thistle { get; } + public static Splat.SplatColor Tomato { get; } + public static Splat.SplatColor Transparent { get; } + public static Splat.SplatColor Turquoise { get; } + public static Splat.SplatColor Violet { get; } + public static Splat.SplatColor Wheat { get; } + public static Splat.SplatColor White { get; } + public static Splat.SplatColor WhiteSmoke { get; } + public static Splat.SplatColor Yellow { get; } + public static Splat.SplatColor YellowGreen { get; } + public bool Equals(Splat.SplatColor other) { } + public override bool Equals(object obj) { } + public float GetBrightness() { } + public override int GetHashCode() { } + public float GetHue() { } + public float GetSaturation() { } + public int ToArgb() { } + public Splat.KnownColor ToKnownColor() { } + public override string ToString() { } + public static Splat.SplatColor FromArgb(int argb) { } + public static Splat.SplatColor FromArgb(int alpha, Splat.SplatColor baseColor) { } + public static Splat.SplatColor FromArgb(int red, int green, int blue) { } + public static Splat.SplatColor FromArgb(int alpha, int red, int green, int blue) { } + public static Splat.SplatColor FromKnownColor(Splat.KnownColor color) { } + public static Splat.SplatColor FromName(string name) { } + public static bool operator !=(Splat.SplatColor left, Splat.SplatColor right) { } + public static bool operator ==(Splat.SplatColor left, Splat.SplatColor right) { } + } + public static class SplatColorExtensions + { + public static Splat.SplatColor FromNative(this System.Windows.Media.Color value) { } + public static System.Windows.Media.Color ToNative(this Splat.SplatColor value) { } + public static System.Windows.Media.SolidColorBrush ToNativeBrush(this Splat.SplatColor value) { } + } +} \ No newline at end of file diff --git a/src/Splat.Tests/API/ApiApprovalTests.SplatUIProject.netcoreapp3.1.approved.txt b/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject.netcoreapp3.1.approved.txt similarity index 99% rename from src/Splat.Tests/API/ApiApprovalTests.SplatUIProject.netcoreapp3.1.approved.txt rename to src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject.netcoreapp3.1.approved.txt index 62edf5b4f..c324598db 100644 --- a/src/Splat.Tests/API/ApiApprovalTests.SplatUIProject.netcoreapp3.1.approved.txt +++ b/src/Splat.Drawing.Tests/API/ApiApprovalTests.SplatUIProject.netcoreapp3.1.approved.txt @@ -1,4 +1,5 @@ [assembly: System.Resources.NeutralResourcesLanguage("en-US")] +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Drawing.Tests")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Android")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Uwp")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Tests")] diff --git a/src/Splat.Drawing.Tests/API/ApiApprovalTests.cs b/src/Splat.Drawing.Tests/API/ApiApprovalTests.cs new file mode 100644 index 000000000..6f92b3e7e --- /dev/null +++ b/src/Splat.Drawing.Tests/API/ApiApprovalTests.cs @@ -0,0 +1,26 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Diagnostics.CodeAnalysis; +using Xunit; + +namespace Splat.Tests +{ + /// + /// Tests to make sure that the API matches the approved ones. + /// + [ExcludeFromCodeCoverage] + public class ApiApprovalTests + { + /// + /// Tests to make sure the splat project is approved. + /// + [Fact] + public void SplatUIProject() + { + typeof(IPlatformModeDetector).Assembly.CheckApproval(); + } + } +} diff --git a/src/Splat.Tests/BitmapLoaderTests.cs b/src/Splat.Drawing.Tests/BitmapLoaderTests.cs similarity index 100% rename from src/Splat.Tests/BitmapLoaderTests.cs rename to src/Splat.Drawing.Tests/BitmapLoaderTests.cs diff --git a/src/Splat.Tests/Colors/KnownColorTests.cs b/src/Splat.Drawing.Tests/Colors/KnownColorTests.cs similarity index 100% rename from src/Splat.Tests/Colors/KnownColorTests.cs rename to src/Splat.Drawing.Tests/Colors/KnownColorTests.cs diff --git a/src/Splat.Tests/Colors/SplatColorTests.cs b/src/Splat.Drawing.Tests/Colors/SplatColorTests.cs similarity index 100% rename from src/Splat.Tests/Colors/SplatColorTests.cs rename to src/Splat.Drawing.Tests/Colors/SplatColorTests.cs diff --git a/src/Splat.Tests/Platform/PlatformBitmapLoaderTests.cs b/src/Splat.Drawing.Tests/PlatformBitmapLoaderTests.cs similarity index 100% rename from src/Splat.Tests/Platform/PlatformBitmapLoaderTests.cs rename to src/Splat.Drawing.Tests/PlatformBitmapLoaderTests.cs diff --git a/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj b/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj new file mode 100644 index 000000000..5e537b02b --- /dev/null +++ b/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp3.1;net5.0-windows + false + $(NoWarn);1591;CA1707;SA1633;CA2000;CA1034 + latest + + + + true + true + + + + + + + + diff --git a/src/Splat.Drawing/Platforms/net5/Bitmaps/BitmapMixins.cs b/src/Splat.Drawing/Platforms/net5/Bitmaps/BitmapMixins.cs new file mode 100644 index 000000000..69e859ec5 --- /dev/null +++ b/src/Splat.Drawing/Platforms/net5/Bitmaps/BitmapMixins.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Windows.Media.Imaging; + +namespace Splat +{ + /// + /// Extension methods to assist with dealing with Bitmaps. + /// + public static class BitmapMixins + { + /// + /// Converts to a native type. + /// + /// The bitmap to convert. + /// A bitmap. + public static IBitmap FromNative(this BitmapSource value) + { + return new BitmapSourceBitmap(value); + } + + /// + /// Converts a to a splat . + /// + /// The native bitmap to convert from. + /// A bitmap. + public static BitmapSource ToNative(this IBitmap value) + { + if (value is null) + { + throw new System.ArgumentNullException(nameof(value)); + } + + return ((BitmapSourceBitmap)value).Inner; + } + } +} diff --git a/src/Splat.Drawing/Platforms/net5/Bitmaps/BitmapSourceBitmap.cs b/src/Splat.Drawing/Platforms/net5/Bitmaps/BitmapSourceBitmap.cs new file mode 100644 index 000000000..a5fe1b6a1 --- /dev/null +++ b/src/Splat.Drawing/Platforms/net5/Bitmaps/BitmapSourceBitmap.cs @@ -0,0 +1,57 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.IO; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace Splat +{ + /// + /// A bitmap that wraps a . + /// + internal sealed class BitmapSourceBitmap : IBitmap + { + /// + /// Initializes a new instance of the class. + /// + /// The platform native bitmap we are wrapping. + public BitmapSourceBitmap(BitmapSource bitmap) + { + Inner = bitmap; + } + + /// + public float Width => (float)Inner.Width; + + /// + public float Height => (float)Inner.Height; + + /// + /// Gets the platform . + /// + public BitmapSource Inner { get; private set; } + + /// + public Task Save(CompressedBitmapFormat format, float quality, Stream target) + { + return Task.Run(() => + { + var encoder = format == CompressedBitmapFormat.Jpeg ? + new JpegBitmapEncoder() { QualityLevel = (int)(quality * 100.0f) } : + (BitmapEncoder)new PngBitmapEncoder(); + + encoder.Frames.Add(BitmapFrame.Create(Inner)); + encoder.Save(target); + }); + } + + /// + public void Dispose() + { + Inner = null; + } + } +} diff --git a/src/Splat.Drawing/Platforms/net5/Bitmaps/PlatformBitmapLoader.cs b/src/Splat.Drawing/Platforms/net5/Bitmaps/PlatformBitmapLoader.cs new file mode 100644 index 000000000..ecf9d16ad --- /dev/null +++ b/src/Splat.Drawing/Platforms/net5/Bitmaps/PlatformBitmapLoader.cs @@ -0,0 +1,92 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System; +using System.IO; +using System.Threading.Tasks; +using System.Windows.Media; +using System.Windows.Media.Imaging; + +namespace Splat +{ + /// + /// A XAML based platform bitmap loader which will load our bitmaps for us. + /// + public class PlatformBitmapLoader : IBitmapLoader + { + /// + public Task Load(Stream sourceStream, float? desiredWidth, float? desiredHeight) + { + return Task.Run(() => + { + var ret = new BitmapImage(); + + WithInit(ret, source => + { + if (desiredWidth != null) + { + source.DecodePixelWidth = (int)desiredWidth; + } + + if (desiredHeight != null) + { + source.DecodePixelHeight = (int)desiredHeight; + } + + source.StreamSource = sourceStream; + source.CacheOption = BitmapCacheOption.OnLoad; + }); + + return (IBitmap)new BitmapSourceBitmap(ret); + }); + } + + /// + public Task LoadFromResource(string resource, float? desiredWidth, float? desiredHeight) + { + return Task.Run(() => + { + var ret = new BitmapImage(); + WithInit(ret, x => + { + if (desiredWidth != null) + { + x.DecodePixelWidth = (int)desiredWidth; + } + + if (desiredHeight != null) + { + x.DecodePixelHeight = (int)desiredHeight; + } + + x.UriSource = new Uri(resource, UriKind.RelativeOrAbsolute); + }); + + return (IBitmap)new BitmapSourceBitmap(ret); + }); + } + + /// + public IBitmap Create(float width, float height) + { + /* + * Taken from MSDN: + * + * The preferred values for pixelFormat are Bgr32 and Pbgra32. + * These formats are natively supported and do not require a format conversion. + * Other pixelFormat values require a format conversion for each frame update, which reduces performance. + */ + return new BitmapSourceBitmap(new WriteableBitmap((int)width, (int)height, 96, 96, PixelFormats.Pbgra32, null)); + } + + private static void WithInit(BitmapImage source, Action block) + { + source.BeginInit(); + block(source); + source.EndInit(); + source.Freeze(); + } + } +} diff --git a/src/Splat.Drawing/Platforms/net5/Colors/ColorExtensions.cs b/src/Splat.Drawing/Platforms/net5/Colors/ColorExtensions.cs new file mode 100644 index 000000000..b6546abe4 --- /dev/null +++ b/src/Splat.Drawing/Platforms/net5/Colors/ColorExtensions.cs @@ -0,0 +1,47 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Windows.Media; + +namespace Splat +{ + /// + /// Provides extension methods for interacting with colors, to and from the XAML colors. + /// + public static class ColorExtensions + { + /// + /// Converts a to a XAML native color. + /// + /// The System.Drawing.Color to convert. + /// A native XAML color. + public static Color ToNative(this System.Drawing.Color value) + { + return Color.FromArgb(value.A, value.R, value.G, value.B); + } + + /// + /// Converts a into the cocoa native . + /// + /// The color to convert. + /// The generated. + public static SolidColorBrush ToNativeBrush(this System.Drawing.Color value) + { + var ret = new SolidColorBrush(value.ToNative()); + ret.Freeze(); + return ret; + } + + /// + /// Converts a into the XAML . + /// + /// The color to convert. + /// The generated. + public static System.Drawing.Color FromNative(this Color value) + { + return System.Drawing.Color.FromArgb(value.A, value.R, value.G, value.B); + } + } +} diff --git a/src/Splat.Drawing/Platforms/net5/Colors/SplatColorExtensions.cs b/src/Splat.Drawing/Platforms/net5/Colors/SplatColorExtensions.cs new file mode 100644 index 000000000..b05ba0664 --- /dev/null +++ b/src/Splat.Drawing/Platforms/net5/Colors/SplatColorExtensions.cs @@ -0,0 +1,47 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Windows.Media; + +namespace Splat +{ + /// + /// Extension methods associated with the struct. + /// + public static class SplatColorExtensions + { + /// + /// Converts a into the XAML . + /// + /// The color to convert. + /// The generated. + public static Color ToNative(this SplatColor value) + { + return Color.FromArgb(value.A, value.R, value.G, value.B); + } + + /// + /// Converts a into the XAML . + /// + /// The color to convert. + /// The generated. + public static SolidColorBrush ToNativeBrush(this SplatColor value) + { + var ret = new SolidColorBrush(value.ToNative()); + ret.Freeze(); + return ret; + } + + /// + /// Converts a into the XAML . + /// + /// The color to convert. + /// The generated. + public static SplatColor FromNative(this Color value) + { + return SplatColor.FromArgb(value.A, value.R, value.G, value.B); + } + } +} diff --git a/src/Splat.Drawing/Platforms/net5/Maths/PointExtensions.cs b/src/Splat.Drawing/Platforms/net5/Maths/PointExtensions.cs new file mode 100644 index 000000000..a8fc994d2 --- /dev/null +++ b/src/Splat.Drawing/Platforms/net5/Maths/PointExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Windows; + +namespace Splat +{ + /// + /// A set of extension methods which will convert between System.Drawing point's and a native point classes. + /// + public static class PointExtensions + { + /// + /// Convert a to the android native . + /// + /// The value to convert. + /// A of the value. + public static Point ToNative(this System.Drawing.Point value) + { + return new Point(value.X, value.Y); + } + + /// + /// Convert a to the android native . + /// + /// The value to convert. + /// A of the value. + public static Point ToNative(this System.Drawing.PointF value) + { + return new Point(value.X, value.Y); + } + + /// + /// Converts a to a . + /// + /// The value to convert. + /// A of the value. + public static System.Drawing.PointF FromNative(this Point value) + { + return new System.Drawing.PointF((float)value.X, (float)value.Y); + } + } +} diff --git a/src/Splat.Drawing/Platforms/net5/Maths/RectExtensions.cs b/src/Splat.Drawing/Platforms/net5/Maths/RectExtensions.cs new file mode 100644 index 000000000..c595cdeaf --- /dev/null +++ b/src/Splat.Drawing/Platforms/net5/Maths/RectExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Windows; + +namespace Splat +{ + /// + /// A set of extension methods which will convert between System.Drawing rectangle's and a native rectangle classes. + /// + public static class RectExtensions + { + /// + /// Convert a to the android native . + /// + /// The value to convert. + /// A of the value. + public static Rect ToNative(this System.Drawing.Rectangle value) + { + return new Rect(value.X, value.Y, value.Width, value.Height); + } + + /// + /// Convert a to the android native . + /// + /// The value to convert. + /// A of the value. + public static Rect ToNative(this System.Drawing.RectangleF value) + { + return new Rect(value.X, value.Y, value.Width, value.Height); + } + + /// + /// Converts a to a . + /// + /// The value to convert. + /// A of the value. + public static System.Drawing.RectangleF FromNative(this Rect value) + { + return new System.Drawing.RectangleF((float)value.X, (float)value.Y, (float)value.Width, (float)value.Height); + } + } +} diff --git a/src/Splat.Drawing/Platforms/net5/Maths/SizeExtensions.cs b/src/Splat.Drawing/Platforms/net5/Maths/SizeExtensions.cs new file mode 100644 index 000000000..6a7483a61 --- /dev/null +++ b/src/Splat.Drawing/Platforms/net5/Maths/SizeExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Windows; + +namespace Splat +{ + /// + /// A set of extension methods which will convert between System.Drawing size's and a native size classes. + /// + public static class SizeExtensions + { + /// + /// Convert a to the android native . + /// + /// The value to convert. + /// A of the value. + public static Size ToNative(this System.Drawing.Size value) + { + return new Size(value.Width, value.Height); + } + + /// + /// Convert a to the android native . + /// + /// The value to convert. + /// A of the value. + public static Size ToNative(this System.Drawing.SizeF value) + { + return new Size(value.Width, value.Height); + } + + /// + /// Converts a to a . + /// + /// The value to convert. + /// A of the value. + public static System.Drawing.SizeF FromNative(this Size value) + { + return new System.Drawing.SizeF((float)value.Width, (float)value.Height); + } + } +} diff --git a/src/Splat.Drawing/Properties/AssemblyInfo.cs b/src/Splat.Drawing/Properties/AssemblyInfo.cs index 7b4fd8999..46a00ca05 100644 --- a/src/Splat.Drawing/Properties/AssemblyInfo.cs +++ b/src/Splat.Drawing/Properties/AssemblyInfo.cs @@ -8,5 +8,6 @@ [assembly: NeutralResourcesLanguage("en-US")] [assembly: InternalsVisibleTo("Splat.Tests")] +[assembly: InternalsVisibleTo("Splat.Drawing.Tests")] [assembly: InternalsVisibleTo("Splat.TestRunner.Android")] [assembly: InternalsVisibleTo("Splat.TestRunner.Uwp")] diff --git a/src/Splat.Drawing/Splat.Drawing.csproj b/src/Splat.Drawing/Splat.Drawing.csproj index ed675d791..c5b04642b 100644 --- a/src/Splat.Drawing/Splat.Drawing.csproj +++ b/src/Splat.Drawing/Splat.Drawing.csproj @@ -2,7 +2,7 @@ MonoAndroid90;Xamarin.iOS10;Xamarin.Mac20;Xamarin.TVOS10;Xamarin.WatchOS10;tizen40;netstandard2.0 - $(TargetFrameworks);net461;uap10.0.16299;netcoreapp3.1 + $(TargetFrameworks);net461;uap10.0.16299;netcoreapp3.1;net5.0-windows Splat .NET Foundation and Contributors A library to make things cross-platform that should be @@ -11,7 +11,7 @@ latest - + true true @@ -49,7 +49,7 @@ - + @@ -60,27 +60,24 @@ - - - - - + + - - + - + + + - - - - - + + + + - + diff --git a/src/Splat.DryIoc.Tests/Splat.DryIoc.Tests.csproj b/src/Splat.DryIoc.Tests/Splat.DryIoc.Tests.csproj index 4a8827bee..166804f64 100644 --- a/src/Splat.DryIoc.Tests/Splat.DryIoc.Tests.csproj +++ b/src/Splat.DryIoc.Tests/Splat.DryIoc.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0;netcoreapp3.1 $(NoWarn);1591;CA1707;SA1633;CA2000 latest diff --git a/src/Splat.DryIoc/Splat.DryIoc.csproj b/src/Splat.DryIoc/Splat.DryIoc.csproj index c060b7be7..9bb42d373 100644 --- a/src/Splat.DryIoc/Splat.DryIoc.csproj +++ b/src/Splat.DryIoc/Splat.DryIoc.csproj @@ -1,6 +1,7 @@ - + - netstandard2.0 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 $(NoWarn);CA1801 DryIoc adapter for Splat latest diff --git a/src/Splat.Exceptionless/Splat.Exceptionless.csproj b/src/Splat.Exceptionless/Splat.Exceptionless.csproj index be3ce4609..7a0215218 100644 --- a/src/Splat.Exceptionless/Splat.Exceptionless.csproj +++ b/src/Splat.Exceptionless/Splat.Exceptionless.csproj @@ -1,6 +1,7 @@ - + - netstandard2.0 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Splat.Exceptionless Splat .NET Foundation and Contributors @@ -10,7 +11,7 @@ - + diff --git a/src/Splat.Log4Net/Splat.Log4Net.csproj b/src/Splat.Log4Net/Splat.Log4Net.csproj index 2e9c379ed..2f8c9d86a 100644 --- a/src/Splat.Log4Net/Splat.Log4Net.csproj +++ b/src/Splat.Log4Net/Splat.Log4Net.csproj @@ -1,7 +1,7 @@ - + - netstandard2.0 - $(TargetFrameworks);net461;uap10.0.16299 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Splat.Log4Net Splat .NET Foundation and Contributors diff --git a/src/Splat.Microsoft.Extensions.DependencyInjection.Tests/Splat.Microsoft.Extensions.DependencyInjection.Tests.csproj b/src/Splat.Microsoft.Extensions.DependencyInjection.Tests/Splat.Microsoft.Extensions.DependencyInjection.Tests.csproj index 775ca3ca6..98b3b9f3a 100644 --- a/src/Splat.Microsoft.Extensions.DependencyInjection.Tests/Splat.Microsoft.Extensions.DependencyInjection.Tests.csproj +++ b/src/Splat.Microsoft.Extensions.DependencyInjection.Tests/Splat.Microsoft.Extensions.DependencyInjection.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0;netcoreapp3.1 $(NoWarn);1591;CA1707;SA1633;CA2000 false latest diff --git a/src/Splat.Microsoft.Extensions.DependencyInjection/Splat.Microsoft.Extensions.DependencyInjection.csproj b/src/Splat.Microsoft.Extensions.DependencyInjection/Splat.Microsoft.Extensions.DependencyInjection.csproj index f462c44ab..62cc21db5 100644 --- a/src/Splat.Microsoft.Extensions.DependencyInjection/Splat.Microsoft.Extensions.DependencyInjection.csproj +++ b/src/Splat.Microsoft.Extensions.DependencyInjection/Splat.Microsoft.Extensions.DependencyInjection.csproj @@ -1,12 +1,13 @@  - netstandard2.0 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 latest - + diff --git a/src/Splat.Microsoft.Extensions.Logging/Splat.Microsoft.Extensions.Logging.csproj b/src/Splat.Microsoft.Extensions.Logging/Splat.Microsoft.Extensions.Logging.csproj index 6b3278096..5485a12d4 100644 --- a/src/Splat.Microsoft.Extensions.Logging/Splat.Microsoft.Extensions.Logging.csproj +++ b/src/Splat.Microsoft.Extensions.Logging/Splat.Microsoft.Extensions.Logging.csproj @@ -1,7 +1,7 @@ - + - netstandard2.0 - $(TargetFrameworks);net461;uap10.0.16299 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Splat.Microsoft.Extensions.Logging Splat .NET Foundation and Contributors @@ -10,8 +10,8 @@ latest - - + + diff --git a/src/Splat.NLog/Splat.NLog.csproj b/src/Splat.NLog/Splat.NLog.csproj index 35a2d21ac..b0f1cf97c 100644 --- a/src/Splat.NLog/Splat.NLog.csproj +++ b/src/Splat.NLog/Splat.NLog.csproj @@ -1,7 +1,7 @@ - + - netstandard2.0 - $(TargetFrameworks);net461;uap10.0.16299 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Splat.NLog Splat .NET Foundation and Contributors @@ -11,7 +11,7 @@ - + diff --git a/src/Splat.Ninject.Tests/Splat.Ninject.Tests.csproj b/src/Splat.Ninject.Tests/Splat.Ninject.Tests.csproj index cb4674f39..e95153654 100644 --- a/src/Splat.Ninject.Tests/Splat.Ninject.Tests.csproj +++ b/src/Splat.Ninject.Tests/Splat.Ninject.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0;netcoreapp3.1 $(NoWarn);1591;CA1707;SA1633;CA2000 false latest diff --git a/src/Splat.Ninject/Splat.Ninject.csproj b/src/Splat.Ninject/Splat.Ninject.csproj index c7fdc8e29..56252f8af 100644 --- a/src/Splat.Ninject/Splat.Ninject.csproj +++ b/src/Splat.Ninject/Splat.Ninject.csproj @@ -1,7 +1,8 @@ - netstandard2.0 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Autofac adapter for Splat latest diff --git a/src/Splat.Prism.Forms/Splat.Prism.Forms.csproj b/src/Splat.Prism.Forms/Splat.Prism.Forms.csproj index f48a6ca63..c08fa8739 100644 --- a/src/Splat.Prism.Forms/Splat.Prism.Forms.csproj +++ b/src/Splat.Prism.Forms/Splat.Prism.Forms.csproj @@ -1,7 +1,8 @@  - netstandard2.0 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Prism adapter for Splat including Xamarin Forms adapters. latest diff --git a/src/Splat.Prism.Tests/Splat.Prism.Tests.csproj b/src/Splat.Prism.Tests/Splat.Prism.Tests.csproj index 25b4f76e9..3112e0e86 100644 --- a/src/Splat.Prism.Tests/Splat.Prism.Tests.csproj +++ b/src/Splat.Prism.Tests/Splat.Prism.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0;netcoreapp3.1 $(NoWarn);CA1707;CS1574 latest diff --git a/src/Splat.Prism/Splat.Prism.csproj b/src/Splat.Prism/Splat.Prism.csproj index 982c33050..f6296e38b 100644 --- a/src/Splat.Prism/Splat.Prism.csproj +++ b/src/Splat.Prism/Splat.Prism.csproj @@ -1,7 +1,8 @@  - netstandard2.0 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Prism adapter for Splat latest diff --git a/src/Splat.Raygun/RaygunFeatureUsageTrackingSession.cs b/src/Splat.Raygun/RaygunFeatureUsageTrackingSession.cs index 44945332a..15a5dc266 100644 --- a/src/Splat.Raygun/RaygunFeatureUsageTrackingSession.cs +++ b/src/Splat.Raygun/RaygunFeatureUsageTrackingSession.cs @@ -66,7 +66,7 @@ internal RaygunFeatureUsageTrackingSession( // keep an eye on // https://raygun.com/forums/thread/92182 -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 var messageBuilder = RaygunMessageBuilder.New(raygunSettings) #else var messageBuilder = RaygunMessageBuilder.New diff --git a/src/Splat.Raygun/Splat.Raygun.csproj b/src/Splat.Raygun/Splat.Raygun.csproj index b150ab0e7..efa0b030d 100644 --- a/src/Splat.Raygun/Splat.Raygun.csproj +++ b/src/Splat.Raygun/Splat.Raygun.csproj @@ -1,7 +1,8 @@  - netstandard2.0;net461 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Splat.Raygun Splat .NET Foundation and Contributors @@ -10,16 +11,25 @@ latest - - - - - - - + + + + + + + + + + + + + + + + + - diff --git a/src/Splat.Serilog/Splat.Serilog.csproj b/src/Splat.Serilog/Splat.Serilog.csproj index 92ba87b2d..50b81c60c 100644 --- a/src/Splat.Serilog/Splat.Serilog.csproj +++ b/src/Splat.Serilog/Splat.Serilog.csproj @@ -1,7 +1,7 @@ - + - netstandard2.0 - $(TargetFrameworks);net461;uap10.0.16299 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Splat.Serilog Splat .NET Foundation and Contributors @@ -11,7 +11,7 @@ - + diff --git a/src/Splat.SimpleInjector.Tests/Splat.SimpleInjector.Tests.csproj b/src/Splat.SimpleInjector.Tests/Splat.SimpleInjector.Tests.csproj index 7d524c456..e284ec60d 100644 --- a/src/Splat.SimpleInjector.Tests/Splat.SimpleInjector.Tests.csproj +++ b/src/Splat.SimpleInjector.Tests/Splat.SimpleInjector.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net5.0;netcoreapp3.1 $(NoWarn);1591;CA1707;SA1633;CA2000 latest diff --git a/src/Splat.SimpleInjector/Splat.SimpleInjector.csproj b/src/Splat.SimpleInjector/Splat.SimpleInjector.csproj index c50839b65..0f5ed322b 100644 --- a/src/Splat.SimpleInjector/Splat.SimpleInjector.csproj +++ b/src/Splat.SimpleInjector/Splat.SimpleInjector.csproj @@ -1,8 +1,8 @@ - + - netstandard2.0 - $(TargetFrameworks);net461;uap10.0.16299 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 SimpleInjector adapter for Splat latest diff --git a/src/Splat.TestRunner.Android/Splat.TestRunner.Android.csproj b/src/Splat.TestRunner.Android/Splat.TestRunner.Android.csproj index fd6c746ca..9f7a9eb44 100644 --- a/src/Splat.TestRunner.Android/Splat.TestRunner.Android.csproj +++ b/src/Splat.TestRunner.Android/Splat.TestRunner.Android.csproj @@ -112,7 +112,7 @@ 2.* - + diff --git a/src/Splat.TestRunner.Uwp/Splat.TestRunner.Uwp.GeneratedMSBuildEditorConfig.editorconfig b/src/Splat.TestRunner.Uwp/Splat.TestRunner.Uwp.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 000000000..4d3bc9469 --- /dev/null +++ b/src/Splat.TestRunner.Uwp/Splat.TestRunner.Uwp.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,36 @@ +is_global = true +build_property.TargetFramework = +build_property.TargetFramework = +build_property.TargetFramework = +build_property.TargetFramework = +build_property.TargetFramework = +build_property.TargetPlatformMinVersion = 10.0.16299.0 +build_property.TargetPlatformMinVersion = 10.0.16299.0 +build_property.TargetPlatformMinVersion = 10.0.16299.0 +build_property.TargetPlatformMinVersion = 10.0.16299.0 +build_property.TargetPlatformMinVersion = 10.0.16299.0 +build_property.UsingMicrosoftNETSdkWeb = +build_property.UsingMicrosoftNETSdkWeb = +build_property.UsingMicrosoftNETSdkWeb = +build_property.UsingMicrosoftNETSdkWeb = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.ProjectTypeGuids = {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} +build_property.PublishSingleFile = +build_property.PublishSingleFile = +build_property.PublishSingleFile = +build_property.PublishSingleFile = +build_property.PublishSingleFile = +build_property.IncludeAllContentForSelfExtract = +build_property.IncludeAllContentForSelfExtract = +build_property.IncludeAllContentForSelfExtract = +build_property.IncludeAllContentForSelfExtract = +build_property.IncludeAllContentForSelfExtract = +build_property._SupportedPlatformList = +build_property._SupportedPlatformList = +build_property._SupportedPlatformList = +build_property._SupportedPlatformList = +build_property._SupportedPlatformList = diff --git a/src/Splat.TestRunner.Uwp/Splat.TestRunner.Uwp.csproj b/src/Splat.TestRunner.Uwp/Splat.TestRunner.Uwp.csproj index 07b45b115..f27ac571d 100644 --- a/src/Splat.TestRunner.Uwp/Splat.TestRunner.Uwp.csproj +++ b/src/Splat.TestRunner.Uwp/Splat.TestRunner.Uwp.csproj @@ -152,7 +152,7 @@ 2.5.25 - + diff --git a/src/Splat.Tests/API/ApiApprovalTests.SplatProject.net472.approved.txt b/src/Splat.Tests/API/ApiApprovalTests.SplatProject.net5.0.approved.txt similarity index 99% rename from src/Splat.Tests/API/ApiApprovalTests.SplatProject.net472.approved.txt rename to src/Splat.Tests/API/ApiApprovalTests.SplatProject.net5.0.approved.txt index 81c4edcc6..f632d6cea 100644 --- a/src/Splat.Tests/API/ApiApprovalTests.SplatProject.net472.approved.txt +++ b/src/Splat.Tests/API/ApiApprovalTests.SplatProject.net5.0.approved.txt @@ -1,7 +1,8 @@ +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Drawing.Tests")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Android")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Uwp")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Tests")] -[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName=".NET Framework 4.6.1")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v5.0", FrameworkDisplayName="")] namespace Splat { public class ActionLogger : Splat.ILogger diff --git a/src/Splat.Tests/API/ApiApprovalTests.SplatProject.netcoreapp3.1.approved.txt b/src/Splat.Tests/API/ApiApprovalTests.SplatProject.netcoreapp3.1.approved.txt index 20c8d3ce3..614a971bd 100644 --- a/src/Splat.Tests/API/ApiApprovalTests.SplatProject.netcoreapp3.1.approved.txt +++ b/src/Splat.Tests/API/ApiApprovalTests.SplatProject.netcoreapp3.1.approved.txt @@ -1,3 +1,4 @@ +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Drawing.Tests")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Android")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.TestRunner.Uwp")] [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Splat.Tests")] diff --git a/src/Splat.Tests/API/ApiApprovalTests.cs b/src/Splat.Tests/API/ApiApprovalTests.cs index 659af87ab..c0e386d5e 100644 --- a/src/Splat.Tests/API/ApiApprovalTests.cs +++ b/src/Splat.Tests/API/ApiApprovalTests.cs @@ -5,15 +5,7 @@ #if !WINDOWS_UWP && !ANDROID -using System; using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Text.RegularExpressions; -using DiffEngine; -using PublicApiGenerator; using Xunit; namespace Splat.Tests @@ -24,68 +16,13 @@ namespace Splat.Tests [ExcludeFromCodeCoverage] public class ApiApprovalTests { - private static readonly Regex _removeCoverletSectionRegex = new Regex(@"^namespace Coverlet\.Core\.Instrumentation\.Tracker.*?^}", RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.Compiled); - /// /// Tests to make sure the splat project is approved. /// [Fact] public void SplatProject() { - CheckApproval(typeof(AssemblyFinder).Assembly); - } - - /// - /// Tests to make sure the splat project is approved. - /// - [Fact] - public void SplatUIProject() - { - CheckApproval(typeof(IPlatformModeDetector).Assembly); - } - - private static void CheckApproval(Assembly assembly, [CallerMemberName]string memberName = null, [CallerFilePath]string filePath = null) - { - var targetFrameworkName = Assembly.GetExecutingAssembly().GetTargetFrameworkName(); - - var sourceDirectory = Path.GetDirectoryName(filePath); - - var approvedFileName = Path.Combine(sourceDirectory, $"ApiApprovalTests.{memberName}.{targetFrameworkName}.approved.txt"); - var receivedFileName = Path.Combine(sourceDirectory, $"ApiApprovalTests.{memberName}.{targetFrameworkName}.received.txt"); - - string approvedPublicApi = string.Empty; - - if (File.Exists(approvedFileName)) - { - approvedPublicApi = File.ReadAllText(approvedFileName); - } - - var generatorOptions = new ApiGeneratorOptions { WhitelistedNamespacePrefixes = new[] { "Splat" } }; - var receivedPublicApi = Filter(ApiGenerator.GeneratePublicApi(assembly, generatorOptions)); - - if (!string.Equals(receivedPublicApi, approvedPublicApi, StringComparison.InvariantCulture)) - { - File.WriteAllText(receivedFileName, receivedPublicApi); - DiffRunner.Launch(receivedFileName, approvedFileName); - } - - Assert.Equal(approvedPublicApi, receivedPublicApi); - } - - private static string Filter(string text) - { - text = _removeCoverletSectionRegex.Replace(text, string.Empty); - return string.Join(Environment.NewLine, text.Split( - new[] - { - Environment.NewLine - }, StringSplitOptions.RemoveEmptyEntries) - .Where(l => - !l.StartsWith("[assembly: AssemblyVersion(", StringComparison.InvariantCulture) && - !l.StartsWith("[assembly: AssemblyFileVersion(", StringComparison.InvariantCulture) && - !l.StartsWith("[assembly: AssemblyInformationalVersion(", StringComparison.InvariantCulture) && - !l.StartsWith("[assembly: System.Reflection.AssemblyMetadata(", StringComparison.InvariantCulture) && - !string.IsNullOrWhiteSpace(l))); + typeof(AssemblyFinder).Assembly.CheckApproval(); } } } diff --git a/src/Splat.Tests/ApiExtensions.cs b/src/Splat.Tests/ApiExtensions.cs new file mode 100644 index 000000000..4f858eea7 --- /dev/null +++ b/src/Splat.Tests/ApiExtensions.cs @@ -0,0 +1,82 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +using DiffEngine; + +using PublicApiGenerator; + +using Xunit; + +namespace Splat.Tests +{ + /// + /// A helper for doing API approvals. + /// + public static class ApiExtensions + { + private static readonly Regex _removeCoverletSectionRegex = new Regex(@"^namespace Coverlet\.Core\.Instrumentation\.Tracker.*?^}", RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.Compiled); + + /// + /// Checks to make sure the API is approved. + /// + /// The assembly that is being checked. + /// The caller member. + /// The caller file path. + public static void CheckApproval(this Assembly assembly, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null) + { + var targetFrameworkName = Assembly.GetExecutingAssembly().GetTargetFrameworkName(); + + var sourceDirectory = Path.GetDirectoryName(filePath); + + var approvedFileName = Path.Combine(sourceDirectory, $"ApiApprovalTests.{memberName}.{targetFrameworkName}.approved.txt"); + var receivedFileName = Path.Combine(sourceDirectory, $"ApiApprovalTests.{memberName}.{targetFrameworkName}.received.txt"); + + string approvedPublicApi = string.Empty; + + if (File.Exists(approvedFileName)) + { + approvedPublicApi = File.ReadAllText(approvedFileName); + } + + var generatorOptions = new ApiGeneratorOptions { WhitelistedNamespacePrefixes = new[] { "Splat" } }; + var receivedPublicApi = Filter(ApiGenerator.GeneratePublicApi(assembly, generatorOptions)); + + if (!string.Equals(receivedPublicApi, approvedPublicApi, StringComparison.InvariantCulture)) + { + File.WriteAllText(receivedFileName, receivedPublicApi); + DiffRunner.Launch(receivedFileName, approvedFileName); + } + + Assert.Equal(approvedPublicApi, receivedPublicApi); + } + + private static string Filter(string text) + { + text = _removeCoverletSectionRegex.Replace(text, string.Empty); + return string.Join(Environment.NewLine, text.Split( + new[] + { + Environment.NewLine + }, + StringSplitOptions.RemoveEmptyEntries) + .Where(l => + !l.StartsWith("[assembly: AssemblyVersion(", StringComparison.InvariantCulture) && + !l.StartsWith("[assembly: AssemblyFileVersion(", StringComparison.InvariantCulture) && + !l.StartsWith("[assembly: AssemblyInformationalVersion(", StringComparison.InvariantCulture) && + !l.StartsWith("[assembly: System.Reflection.AssemblyMetadata(", StringComparison.InvariantCulture) && + !string.IsNullOrWhiteSpace(l))); + } + } +} diff --git a/src/Splat.Tests/Splat.Tests.csproj b/src/Splat.Tests/Splat.Tests.csproj index a14cfedfc..88b9f9b32 100644 --- a/src/Splat.Tests/Splat.Tests.csproj +++ b/src/Splat.Tests/Splat.Tests.csproj @@ -1,25 +1,19 @@  - netcoreapp3.1 + net5.0;netcoreapp3.1 $(NoWarn);1591;CA1707;SA1633;CA2000;CA1034 latest - - true - true - - - + - diff --git a/src/Splat.sln b/src/Splat.sln index 8e98f431f..ce107c545 100644 --- a/src/Splat.sln +++ b/src/Splat.sln @@ -67,7 +67,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Splat.Prism.Forms", "Splat. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Splat.Prism.Tests", "Splat.Prism.Tests\Splat.Prism.Tests.csproj", "{905A96B2-03C9-4D08-8E8B-E5B0F7F9F33A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat.TestRunner.Uwp", "Splat.TestRunner.Uwp\Splat.TestRunner.Uwp.csproj", "{B57E4350-3D23-4995-8978-39522049895D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Splat.Drawing.Tests", "Splat.Drawing.Tests\Splat.Drawing.Tests.csproj", "{7E350DE5-B8C4-4EF1-9211-7B35643B1971}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -583,33 +583,26 @@ Global {905A96B2-03C9-4D08-8E8B-E5B0F7F9F33A}.Release|x64.Build.0 = Release|Any CPU {905A96B2-03C9-4D08-8E8B-E5B0F7F9F33A}.Release|x86.ActiveCfg = Release|Any CPU {905A96B2-03C9-4D08-8E8B-E5B0F7F9F33A}.Release|x86.Build.0 = Release|Any CPU - {B57E4350-3D23-4995-8978-39522049895D}.Debug|Any CPU.ActiveCfg = Debug|x86 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|Any CPU.Build.0 = Debug|x86 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|ARM.ActiveCfg = Debug|ARM - {B57E4350-3D23-4995-8978-39522049895D}.Debug|ARM.Build.0 = Debug|ARM - {B57E4350-3D23-4995-8978-39522049895D}.Debug|ARM.Deploy.0 = Debug|ARM - {B57E4350-3D23-4995-8978-39522049895D}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|ARM64.Build.0 = Debug|ARM64 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|x64.ActiveCfg = Debug|x64 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|x64.Build.0 = Debug|x64 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|x64.Deploy.0 = Debug|x64 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|x86.ActiveCfg = Debug|x86 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|x86.Build.0 = Debug|x86 - {B57E4350-3D23-4995-8978-39522049895D}.Debug|x86.Deploy.0 = Debug|x86 - {B57E4350-3D23-4995-8978-39522049895D}.Release|Any CPU.ActiveCfg = Release|x86 - {B57E4350-3D23-4995-8978-39522049895D}.Release|ARM.ActiveCfg = Release|ARM - {B57E4350-3D23-4995-8978-39522049895D}.Release|ARM.Build.0 = Release|ARM - {B57E4350-3D23-4995-8978-39522049895D}.Release|ARM.Deploy.0 = Release|ARM - {B57E4350-3D23-4995-8978-39522049895D}.Release|ARM64.ActiveCfg = Release|ARM64 - {B57E4350-3D23-4995-8978-39522049895D}.Release|ARM64.Build.0 = Release|ARM64 - {B57E4350-3D23-4995-8978-39522049895D}.Release|ARM64.Deploy.0 = Release|ARM64 - {B57E4350-3D23-4995-8978-39522049895D}.Release|x64.ActiveCfg = Release|x64 - {B57E4350-3D23-4995-8978-39522049895D}.Release|x64.Build.0 = Release|x64 - {B57E4350-3D23-4995-8978-39522049895D}.Release|x64.Deploy.0 = Release|x64 - {B57E4350-3D23-4995-8978-39522049895D}.Release|x86.ActiveCfg = Release|x86 - {B57E4350-3D23-4995-8978-39522049895D}.Release|x86.Build.0 = Release|x86 - {B57E4350-3D23-4995-8978-39522049895D}.Release|x86.Deploy.0 = Release|x86 + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|ARM.ActiveCfg = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|ARM.Build.0 = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|ARM64.Build.0 = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|x64.ActiveCfg = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|x64.Build.0 = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|x86.ActiveCfg = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Debug|x86.Build.0 = Debug|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|Any CPU.Build.0 = Release|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|ARM.ActiveCfg = Release|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|ARM.Build.0 = Release|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|ARM64.ActiveCfg = Release|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|ARM64.Build.0 = Release|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|x64.ActiveCfg = Release|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|x64.Build.0 = Release|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|x86.ActiveCfg = Release|Any CPU + {7E350DE5-B8C4-4EF1-9211-7B35643B1971}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -640,7 +633,7 @@ Global {1D1FE7E6-10FF-4A7F-90D6-6E3696EC7D0D} = {651320D6-1048-4F87-9D8E-75134FAFABDA} {39195824-8E56-4240-A5A0-7FA4E12099D4} = {651320D6-1048-4F87-9D8E-75134FAFABDA} {905A96B2-03C9-4D08-8E8B-E5B0F7F9F33A} = {3F8EA9C2-D6D1-4B18-8670-DFC24B96972E} - {B57E4350-3D23-4995-8978-39522049895D} = {3F8EA9C2-D6D1-4B18-8670-DFC24B96972E} + {7E350DE5-B8C4-4EF1-9211-7B35643B1971} = {3F8EA9C2-D6D1-4B18-8670-DFC24B96972E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E833ED14-B971-4E09-B27E-76E99BC0FC10} diff --git a/src/Splat/Logging/DefaultLogManager.cs b/src/Splat/Logging/DefaultLogManager.cs index 3e72928fb..4246ea6e1 100644 --- a/src/Splat/Logging/DefaultLogManager.cs +++ b/src/Splat/Logging/DefaultLogManager.cs @@ -35,7 +35,8 @@ public DefaultLogManager(IReadonlyDependencyResolver dependencyResolver = null) } return new WrappingFullLogger(new WrappingPrefixLogger(ret, type)); - }, 64); + }, + 64); } /// diff --git a/src/Splat/Properties/AssemblyInfo.cs b/src/Splat/Properties/AssemblyInfo.cs index a7fca135e..1bc73247f 100644 --- a/src/Splat/Properties/AssemblyInfo.cs +++ b/src/Splat/Properties/AssemblyInfo.cs @@ -6,5 +6,6 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Splat.Tests")] +[assembly: InternalsVisibleTo("Splat.Drawing.Tests")] [assembly: InternalsVisibleTo("Splat.TestRunner.Android")] [assembly: InternalsVisibleTo("Splat.TestRunner.Uwp")] diff --git a/src/Splat/ServiceLocation/InternalLocator.cs b/src/Splat/ServiceLocation/InternalLocator.cs index 59e36bb86..0e08f8dd1 100644 --- a/src/Splat/ServiceLocation/InternalLocator.cs +++ b/src/Splat/ServiceLocation/InternalLocator.cs @@ -16,6 +16,7 @@ internal class InternalLocator : IDisposable private volatile int _resolverChangedNotificationSuspendCount; private IDependencyResolver _dependencyResolver; + [System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Global lifetime.")] internal InternalLocator() { _dependencyResolver = new ModernDependencyResolver(); diff --git a/src/Splat/Splat.csproj b/src/Splat/Splat.csproj index 07291e3c2..b443400d9 100644 --- a/src/Splat/Splat.csproj +++ b/src/Splat/Splat.csproj @@ -1,7 +1,7 @@ - + - netstandard2.0 - $(TargetFrameworks);net461;uap10.0.16299 + netstandard2.0;net5.0 + $(TargetFrameworks);net461 Splat Splat .NET Foundation and Contributors diff --git a/src/Splat/TargetFrameworkExtensions.cs b/src/Splat/TargetFrameworkExtensions.cs index 933d58930..10d27d1ba 100644 --- a/src/Splat/TargetFrameworkExtensions.cs +++ b/src/Splat/TargetFrameworkExtensions.cs @@ -29,6 +29,8 @@ internal static string GetTargetFrameworkName(string frameworkName) { switch (frameworkName) { + case ".NETCoreApp,Version=v5.0": + return "net5.0"; case ".NETCoreApp,Version=v3.1": return "netcoreapp3.1"; case ".NETCoreApp,Version=v3.0":