Browse Source

Add new target frameworks

af/merge-core
James Jackson-South 6 years ago
parent
commit
03aa2fb775
  1. 8
      .github/workflows/build-and-test.yml
  2. 27
      Directory.Build.props
  3. 14
      src/ImageSharp/Common/Helpers/TestHelpers.cs
  4. 2
      src/ImageSharp/ImageSharp.csproj
  5. 1
      tests/ImageSharp.Benchmarks/Config.cs
  6. 2
      tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj
  7. 2
      tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj
  8. 2
      tests/ImageSharp.Tests/Image/ImageTests.WrapMemory.cs
  9. 2
      tests/ImageSharp.Tests/ImageSharp.Tests.csproj
  10. 23
      tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs

8
.github/workflows/build-and-test.yml

@ -16,14 +16,18 @@ jobs:
matrix: matrix:
options: options:
- os: ubuntu-latest - os: ubuntu-latest
framework: netcoreapp2.1 framework: netcoreapp3.1
runtime: -x64 runtime: -x64
codecov: false codecov: false
# - os: windows-latest # - os: windows-latest
# framework: netcoreapp2.1 # framework: netcoreapp3.1
# runtime: -x64 # runtime: -x64
# codecov: true # codecov: true
# - os: windows-latest # - os: windows-latest
# framework: netcoreapp2.1
# runtime: -x64
# codecov: false
# - os: windows-latest
# framework: net472 # framework: net472
# runtime: -x64 # runtime: -x64
# codecov: false # codecov: false

27
Directory.Build.props

@ -31,22 +31,21 @@
<!-- <!--
https://apisof.net/ https://apisof.net/
+===================+================+===================+==============================+======================+==========================+ +===================+=======+==========+=====================+=============+=================+====================+
| Target Framework | SUPPORTS_MATHF | SUPPORTS_HASHCODE | SUPPORTS_EXTENDED_INTRINSICS | SUPPORTS_SPAN_STREAM | SUPPORTS_ENCODING_STRING | | SUPPORTS | MATHF | HASHCODE | EXTENDED_INTRINSICS | SPAN_STREAM | ENCODING_STRING | RUNTIME_INTRINSICS |
+===================+================+===================+==============================+======================+==========================+ +===================+=======+==========+=====================+=============+=================+====================+
| netcoreapp3.1 | Y | Y | Y | Y | Y | | netcoreapp3.1 | Y | Y | Y | Y | Y | Y |
| netcoreapp2.1 | Y | Y | Y | Y | Y | | netcoreapp2.1 | Y | Y | Y | Y | Y | N |
| netcoreapp2.0 | Y | N | N | N | N | | netcoreapp2.0 | Y | N | N | N | N | N |
| netstandard2.1 | Y | N | N | Y | Y | | netstandard2.1 | Y | Y | N | Y | Y | N |
| netstandard2.0 | N | N | N | N | N | | netstandard2.0 | N | N | N | N | N | N |
| netstandard1.3 | N | N | N | N | N | | netstandard1.3 | N | N | N | N | N | N |
| net472 | N | N | Y | N | N | | net472 | N | N | Y | N | N | N |
+===================+================+===================+==============================+======================+==========================+ +===================+=======+==========+=====================+=============+=================+====================+
--> -->
<!-- TODO: Include additional targets to TargetFrameworks -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1'"> <PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants> <DefineConstants>$(DefineConstants);MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS;</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'"> <PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants> <DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants>
@ -55,7 +54,7 @@
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;</DefineConstants> <DefineConstants>$(DefineConstants);SUPPORTS_MATHF;</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'"> <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants> <DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING</DefineConstants>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net472'"> <PropertyGroup Condition=" '$(TargetFramework)' == 'net472'">
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants> <DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>

14
src/ImageSharp/Common/Helpers/TestHelpers.cs

@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
namespace SixLabors.ImageSharp.Common.Helpers namespace SixLabors.ImageSharp.Common.Helpers
@ -13,14 +13,18 @@ namespace SixLabors.ImageSharp.Common.Helpers
/// Only intended to be used in tests! /// Only intended to be used in tests!
/// </summary> /// </summary>
internal const string ImageSharpBuiltAgainst = internal const string ImageSharpBuiltAgainst =
#if NET472 #if NETCOREAPP3_1
"netfx4.7.2"; "netcoreapp3.1";
#elif NETCOREAPP2_1 #elif NETCOREAPP2_1
"netcoreapp2.1"; "netcoreapp2.1";
#elif NETSTANDARD2_1
"netstandard2.1";
#elif NETSTANDARD2_0
"netstandard2.0";
#elif NETSTANDARD1_3 #elif NETSTANDARD1_3
"netstandard1.3"; "netstandard1.3";
#else #else
"netstandard2.0"; "net472";
#endif #endif
} }
} }

2
src/ImageSharp/ImageSharp.csproj

@ -10,7 +10,7 @@
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix> <VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix> <VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
<TargetFrameworks>netcoreapp2.1;netstandard2.0;netstandard1.3;net472</TargetFrameworks> <TargetFrameworks>netcoreapp3.1;netcoreapp2.1;netstandard2.1;netstandard2.0;netstandard1.3;net472</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>

1
tests/ImageSharp.Benchmarks/Config.cs

@ -21,6 +21,7 @@ namespace SixLabors.ImageSharp.Benchmarks
{ {
this.Add( this.Add(
Job.Default.With(ClrRuntime.Net472).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3), Job.Default.With(ClrRuntime.Net472).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3),
Job.Default.With(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3),
Job.Default.With(CoreRuntime.Core21).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3) Job.Default.With(CoreRuntime.Core21).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3)
); );
} }

2
tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj

@ -5,7 +5,7 @@
<AssemblyName>ImageSharp.Benchmarks</AssemblyName> <AssemblyName>ImageSharp.Benchmarks</AssemblyName>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>SixLabors.ImageSharp.Benchmarks</RootNamespace> <RootNamespace>SixLabors.ImageSharp.Benchmarks</RootNamespace>
<TargetFrameworks>netcoreapp2.1;net472</TargetFrameworks> <TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net472</TargetFrameworks>
<GenerateProgramFile>false</GenerateProgramFile> <GenerateProgramFile>false</GenerateProgramFile>
<!--Used to hide test project from dotnet test--> <!--Used to hide test project from dotnet test-->
</PropertyGroup> </PropertyGroup>

2
tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj

@ -8,7 +8,7 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
<RootNamespace>SixLabors.ImageSharp.Sandbox46</RootNamespace> <RootNamespace>SixLabors.ImageSharp.Sandbox46</RootNamespace>
<RuntimeIdentifier>win7-x64</RuntimeIdentifier> <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
<TargetFrameworks>netcoreapp2.1;net472</TargetFrameworks> <TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net472</TargetFrameworks>
<StartupObject>SixLabors.ImageSharp.Sandbox46.Program</StartupObject> <StartupObject>SixLabors.ImageSharp.Sandbox46.Program</StartupObject>
<!--Used to hide test project from dotnet test--> <!--Used to hide test project from dotnet test-->
<IsTestProject>false</IsTestProject> <IsTestProject>false</IsTestProject>

2
tests/ImageSharp.Tests/Image/ImageTests.WrapMemory.cs

@ -172,7 +172,7 @@ namespace SixLabors.ImageSharp.Tests
} }
private static bool ShouldSkipBitmapTest => private static bool ShouldSkipBitmapTest =>
!TestEnvironment.Is64BitProcess || TestHelpers.ImageSharpBuiltAgainst != "netcoreapp2.1"; !TestEnvironment.Is64BitProcess || (TestHelpers.ImageSharpBuiltAgainst != "netcoreapp3.1" && TestHelpers.ImageSharpBuiltAgainst != "netcoreapp2.1");
} }
} }
} }

2
tests/ImageSharp.Tests/ImageSharp.Tests.csproj

@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net462;net472</TargetFrameworks> <TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net472</TargetFrameworks>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
<AssemblyName>SixLabors.ImageSharp.Tests</AssemblyName> <AssemblyName>SixLabors.ImageSharp.Tests</AssemblyName>

23
tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs

@ -33,29 +33,6 @@ namespace SixLabors.ImageSharp.Tests
Assert.True(Directory.Exists(path)); Assert.True(Directory.Exists(path));
} }
///// <summary>
///// We need this test to make sure that the netcoreapp2.1 test execution actually covers the netcoreapp2.1 build configuration of ImageSharp.
///// </summary>
//[Fact]
//public void ImageSharpAssemblyUnderTest_MatchesExpectedTargetFramework()
//{
// this.Output.WriteLine("NetCoreVersion: " + TestEnvironment.NetCoreVersion);
// this.Output.WriteLine("ImageSharpBuiltAgainst: " + TestHelpers.ImageSharpBuiltAgainst);
// if (string.IsNullOrEmpty(TestEnvironment.NetCoreVersion))
// {
// this.Output.WriteLine("Not running under .NET Core!");
// }
// else if (TestEnvironment.NetCoreVersion.StartsWith("2.1"))
// {
// Assert.Equal("netcoreapp2.1", TestHelpers.ImageSharpBuiltAgainst);
// }
// else
// {
// Assert.Equal("netstandard2.0", TestHelpers.ImageSharpBuiltAgainst);
// }
//}
[Fact] [Fact]
public void SolutionDirectoryFullPath() public void SolutionDirectoryFullPath()
{ {

Loading…
Cancel
Save