Skip to content

Commit

Permalink
Merge pull request #864 from nunit/revert-854-issue-725
Browse files Browse the repository at this point in the history
Revert "Remove netstandard1.6 and netcoreapp1.1 builds"
  • Loading branch information
ChrisMaddock committed Jan 16, 2021
2 parents f929716 + bd3edf9 commit 2336e76
Show file tree
Hide file tree
Showing 85 changed files with 422 additions and 61 deletions.
38 changes: 38 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ jobs:

steps:

- task: UseDotNet@2
displayName: 'Install .NET Core 1.1.2'
inputs:
packageType: runtime
version: 1.1.2
installationPath: C:/Program Files/dotnet

- powershell: .\build.ps1 -Target Test -Configuration Release
displayName: Build and test

Expand All @@ -23,6 +30,14 @@ jobs:
mergeTestResults: true
testRunTitle: net35/Windows
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: Publish netcoreapp1.1 test results
inputs:
testResultsFormat: NUnit
testResultsFiles: test-results\netcoreapp1.1\*.xml
mergeTestResults: true
testRunTitle: netcoreapp1.1/Windows
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: Publish netcoreapp2.1 test results
inputs:
Expand Down Expand Up @@ -51,6 +66,7 @@ jobs:
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sharedframework-microsoft.netcore.app-1.1.2
sudo apt-get install dotnet-sdk-2.2
sudo apt-get install dotnet-runtime-5.0
./build.sh --target=Test --configuration=Release
Expand All @@ -65,6 +81,14 @@ jobs:
mergeTestResults: true
testRunTitle: net35/Linux
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: Publish netcoreapp1.1 test results
inputs:
testResultsFormat: NUnit
testResultsFiles: test-results/netcoreapp1.1/*.xml
mergeTestResults: true
testRunTitle: netcoreapp1.1/Linux
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: Publish netcoreapp2.1 test results
inputs:
Expand Down Expand Up @@ -96,6 +120,12 @@ jobs:
packageType: runtime
version: 2.1.x

- task: UseDotNet@2
displayName: 'Install .NET Core runtime 1.1'
inputs:
packageType: runtime
version: 1.1.x

- bash: |
dotnet tool install --global Cake.Tool
dotnet cake --target=Test --configuration=Release
Expand All @@ -110,6 +140,14 @@ jobs:
mergeTestResults: true
testRunTitle: net35/macOS
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: Publish netcoreapp1.1 test results
inputs:
testResultsFormat: NUnit
testResultsFiles: test-results/netcoreapp1.1/*.xml
mergeTestResults: true
testRunTitle: netcoreapp1.1/macOS
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: Publish netcoreapp2.1 test results
inputs:
Expand Down
45 changes: 27 additions & 18 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var PROJECT_DIR = Context.Environment.WorkingDirectory.FullPath + "/";
var PACKAGE_DIR = Argument("artifact-dir", PROJECT_DIR + "package") + "/";
var BIN_DIR = PROJECT_DIR + "bin/" + configuration + "/";
var NET35_BIN_DIR = BIN_DIR + "net35/";
var NETCOREAPP11_BIN_DIR = BIN_DIR + "netcoreapp1.1/";
var NETCOREAPP21_BIN_DIR = BIN_DIR + "netcoreapp2.1/";
var NETCOREAPP31_BIN_DIR = BIN_DIR + "netcoreapp3.1/";
var CHOCO_DIR = PROJECT_DIR + "choco/";
Expand Down Expand Up @@ -141,17 +142,6 @@ Task("Clean")
CleanDirectory(PACKAGE_DIR);
});

// Not currently used in CI but useful for cleaning your local obj
// directories, particularly after changing the target of a project.
Task("CleanAll")
.Description("Cleans obj directories in additon to standard clean")
.IsDependentOn("Clean")
.Does(() =>
{
foreach (var dir in GetDirectories(PROJECT_DIR + "src/**/obj/"))
DeleteDirectory(dir, new DeleteDirectorySettings() { Recursive = true });
});

//////////////////////////////////////////////////////////////////////
// INITIALIZE FOR BUILD
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -202,25 +192,25 @@ MSBuildSettings CreateMSBuildSettings(string target)
}

Task("Build")
.Description("Builds the engine and console")
.Description("Builds the engine and console")
.IsDependentOn("UpdateAssemblyInfo")
.Does(() =>
{
MSBuild(SOLUTION_FILE, CreateMSBuildSettings("Build").WithRestore());
Information("Publishing .NET Core & Standard projects so that dependencies are present...");
foreach(var framework in new [] { "netstandard2.0", "netcoreapp3.1" })
MSBuild(ENGINE_CSPROJ, CreateMSBuildSettings("Publish")
.WithProperty("TargetFramework", framework)
.WithProperty("PublishDir", BIN_DIR + framework));
foreach(var framework in new [] { "netstandard1.6", "netstandard2.0", "netcoreapp3.1" })
MSBuild(ENGINE_CSPROJ, CreateMSBuildSettings("Publish")
.WithProperty("TargetFramework", framework)
.WithProperty("PublishDir", BIN_DIR + framework));
foreach (var framework in new [] { "netstandard2.0" })
foreach(var framework in new [] { "netstandard1.6", "netstandard2.0" })
MSBuild(ENGINE_API_CSPROJ, CreateMSBuildSettings("Publish")
.WithProperty("TargetFramework", framework)
.WithProperty("PublishDir", BIN_DIR + framework));
foreach(var framework in new [] { "netcoreapp2.1", "netcoreapp3.1" })
foreach(var framework in new [] { "netcoreapp1.1", "netcoreapp2.1", "netcoreapp3.1" })
MSBuild(ENGINE_TESTS_CSPROJ, CreateMSBuildSettings("Publish")
.WithProperty("TargetFramework", framework)
.WithProperty("PublishDir", BIN_DIR + framework));
Expand Down Expand Up @@ -310,6 +300,24 @@ Task("TestNetCore31Console")
}
});

//////////////////////////////////////////////////////////////////////
// TEST NETSTANDARD 1.6 ENGINE
//////////////////////////////////////////////////////////////////////

Task("TestNetStandard16Engine")
.Description("Tests the .NET Standard Engine")
.IsDependentOn("Build")
.WithCriteria(!BuildSystem.IsRunningOnAzurePipelines) //Unable to find Azure build supporting both .NET Core 1.1 and .NET Core 3.1
.OnError(exception => { ErrorDetail.Add(exception.Message); })
.Does(() =>
{
RunDotnetCoreNUnitLiteTests(
NETCOREAPP11_BIN_DIR + ENGINE_TESTS,
NETCOREAPP11_BIN_DIR,
"netcoreapp1.1",
ref ErrorDetail);
});

//////////////////////////////////////////////////////////////////////
// TEST NETSTANDARD 2.0 ENGINE
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -818,6 +826,7 @@ Task("TestConsole")
Task("TestEngine")
.Description("Builds and tests the engine")
.IsDependentOn("TestNet20Engine")
.IsDependentOn("TestNetStandard16Engine")
.IsDependentOn("TestNetStandard20Engine")
.IsDependentOn("TestNetCore31Engine");

Expand Down
6 changes: 6 additions & 0 deletions nuget/engine/nunit.engine.api.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<copyright>Copyright (c) 2020 Charlie Poole, Rob Prouse</copyright>
<dependencies>
<group targetFramework="net20" />
<group targetFramework="netstandard1.6">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="System.Runtime.Loader" version="4.3.0" exclude="compile" />
<dependency id="System.Xml.XPath.XmlDocument" version="4.3.0" exclude="compile" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="System.Xml.XPath.XmlDocument" version="4.3.0" exclude="compile" />
</group>
Expand All @@ -28,6 +33,7 @@
<files>
<file src="LICENSE.txt" />
<file src="bin/net20/nunit.engine.api.dll" target="lib/net20" />
<file src="bin/netstandard1.6/nunit.engine.api.dll" target="lib/netstandard1.6" />
<file src="bin/netstandard2.0/nunit.engine.api.dll" target="lib/netstandard2.0" />
<file src="..\..\nunit_256.png" target="images" />
</files>
Expand Down
13 changes: 13 additions & 0 deletions nuget/engine/nunit.engine.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
<copyright>Copyright (c) 2020 Charlie Poole, Rob Prouse</copyright>
<dependencies>
<group targetFramework="net20" />
<group targetFramework="netstandard1.6">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="Microsoft.DotNet.InternalAbstractions" version="1.0.0" exclude="compile" />
<dependency id="System.ComponentModel.TypeConverter" version="4.3.0" exclude="compile" />
<dependency id="System.Reflection" version="4.3.0" exclude="compile" />
<dependency id="System.Diagnostics.Process" version="4.3.0" exclude="compile" />
<dependency id="System.Xml.XPath.XmlDocument" version="4.3.0" exclude="compile" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="NETStandard.Library" version="2.0.0" />
<dependency id="System.ComponentModel.TypeConverter" version="4.3.0" exclude="compile" />
Expand Down Expand Up @@ -64,6 +72,11 @@
<file src="../../nuget/engine/nunit.engine.nuget.addins" target="contentFiles/any/lib/net20"/>
<file src="../../nuget/engine/nunit.agent.addins" target="contentFiles/any/agents/net20"/>
<file src="../../nuget/engine/nunit.agent.addins" target="contentFiles/any/agents/net40"/>
<file src="bin/netstandard1.6/nunit.engine.dll" target="lib/netstandard1.6" />
<file src="bin/netstandard1.6/nunit.engine.core.dll" target="lib/netstandard1.6" />
<file src="bin/netstandard1.6/nunit.engine.api.dll" target="lib/netstandard1.6" />
<file src="bin/netstandard1.6/testcentric.engine.metadata.dll" target="lib/netstandard1.6" />
<file src="../../nuget/engine/nunit.engine.nuget.addins" target="contentFiles/any/lib/netstandard1.6"/>
<file src="bin/netstandard2.0/nunit.engine.dll" target="lib/netstandard2.0" />
<file src="bin/netstandard2.0/nunit.engine.core.dll" target="lib/netstandard2.0" />
<file src="bin/netstandard2.0/nunit.engine.api.dll" target="lib/netstandard2.0" />
Expand Down
7 changes: 6 additions & 1 deletion package-checks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ public void CheckAllPackages()
CheckNuGetPackage("NUnit.Engine",
HasFiles("LICENSE.txt", "NOTICES.txt", "CHANGES.txt"),
HasDirectory("lib/net20").WithFiles(ENGINE_FILES),
HasDirectory("lib/netstandard1.6").WithFiles(ENGINE_FILES),
HasDirectory("lib/netstandard2.0").WithFiles(ENGINE_FILES),
HasDirectory("contentFiles/any/lib/net20").WithFile("nunit.engine.nuget.addins"),
HasDirectory("contentFiles/any/lib/netstandard1.6").WithFile("nunit.engine.nuget.addins"),
HasDirectory("contentFiles/any/lib/netstandard2.0").WithFile("nunit.engine.nuget.addins"),
HasDirectory("contentFiles/any/agents/net20").WithFiles(AGENT_FILES).AndFile("nunit.agent.addins"),
HasDirectory("contentFiles/any/agents/net40").WithFiles(AGENT_FILES).AndFile("nunit.agent.addins")) &
CheckNuGetPackage(
"NUnit.Engine.Api",
HasFile("LICENSE.txt"),
HasDirectory("lib/net20").WithFile("nunit.engine.api.dll"),
HasDirectory("lib/netstandard1.6").WithFile("nunit.engine.api.dll"),
HasDirectory("lib/netstandard2.0").WithFile("nunit.engine.api.dll")) &
CheckNuGetPackage(
"NUnit.Runners",
Expand All @@ -53,8 +56,10 @@ public void CheckAllPackages()
HasFiles("LICENSE.txt", "license.rtf", "NOTICES.txt", "CHANGES.txt"),
HasDirectory("bin/net20").WithFiles("nunit3-console.exe", "nunit3-console.exe.config").AndFiles(ENGINE_FILES),
HasDirectory("bin/net35").WithFiles("nunit3-console.exe", "nunit3-console.exe.config").AndFiles(ENGINE_FILES),
HasDirectory("bin/netstandard1.6").WithFiles(ENGINE_FILES),
HasDirectory("bin/netstandard2.0").WithFiles(ENGINE_FILES),
HasDirectory("bin/netcoreapp2.1").WithFiles(ENGINE_FILES),
HasDirectory("bin/netcoreapp1.1").WithFiles(ENGINE_FILES),
HasDirectory("bin/netcoreapp1.1").WithFiles(ENGINE_FILES),
HasDirectory("bin/agents/net20").WithFiles(AGENT_FILES),
HasDirectory("bin/agents/net40").WithFiles(AGENT_FILES)) &
CheckMsiPackage("NUnit.Console",
Expand Down
4 changes: 4 additions & 0 deletions src/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
[assembly: AssemblyConfiguration(".NET 3.5 Debug")]
#elif NET20
[assembly: AssemblyConfiguration(".NET 2.0 Debug")]
#elif NETSTANDARD1_6 || NETCOREAPP1_1
[assembly: AssemblyConfiguration(".NET Standard 1.6 Debug")]
#elif NETSTANDARD2_0 || NETCOREAPP2_1
[assembly: AssemblyConfiguration(".NET Standard 2.0 Debug")]
#else
Expand All @@ -45,6 +47,8 @@
[assembly: AssemblyConfiguration(".NET 3.5")]
#elif NET20
[assembly: AssemblyConfiguration(".NET 2.0")]
#elif NETSTANDARD1_6 || NETCOREAPP1_1
[assembly: AssemblyConfiguration(".NET Standard 1.6")]
#elif NETSTANDARD2_0 || NETCOREAPP2_1
[assembly: AssemblyConfiguration(".NET Standard 2.0")]
#else
Expand Down
2 changes: 1 addition & 1 deletion src/NUnitEngine/EngineApiVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@

[assembly: AssemblyProduct("NUnit Engine API")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyInformationalVersion("3.12.0-beta1")]
[assembly: AssemblyInformationalVersion("3.12.0")]
[assembly: AssemblyFileVersion("3.12.0")]
2 changes: 2 additions & 0 deletions src/NUnitEngine/mock-assembly/MockAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public class MockAssembly

public const int Inconclusive = MockTestFixture.Inconclusive;

#if !NETCOREAPP1_1
public static readonly string AssemblyPath = AssemblyHelper.GetAssemblyPath(typeof(MockAssembly).Assembly);
#endif
}

[TestFixture(Description="Fake Test Fixture")]
Expand Down
7 changes: 5 additions & 2 deletions src/NUnitEngine/mock-assembly/mock-assembly.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>NUnit.Tests</RootNamespace>
<TargetFrameworks>net35;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net35;netcoreapp1.1;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp1.1'">
<PackageReference Include="NUnit" Version="3.12.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'!='netcoreapp1.1'">
<PackageReference Include="NUnit" Version="3.13.0-dev-06899" />
</ItemGroup>
<ItemGroup>
Expand Down
7 changes: 5 additions & 2 deletions src/NUnitEngine/notest-assembly/notest-assembly.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>notest_assembly</RootNamespace>
<TargetFrameworks>net35;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net35;netcoreapp1.1;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp1.1'">
<PackageReference Include="NUnit" Version="3.12.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'!='netcoreapp1.1'">
<PackageReference Include="NUnit" Version="3.13.0-dev-06899" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
// ***********************************************************************

using System;
#if !NETSTANDARD1_6
using System.Runtime.Serialization;
#endif

namespace NUnit.Engine
{
Expand All @@ -31,7 +33,9 @@ namespace NUnit.Engine
/// called with improper values or when a particular facility
/// is not available.
/// </summary>
#if !NETSTANDARD1_6
[Serializable]
#endif
public class NUnitEngineException : Exception
{
/// <summary>
Expand All @@ -48,9 +52,11 @@ public NUnitEngineException(string message, Exception innerException) : base(mes
{
}

#if !NETSTANDARD1_6
/// <summary>
/// Serialization constructor
/// </summary>
public NUnitEngineException(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ namespace NUnit.Engine
/// <summary>
/// The exception that is thrown if a valid test engine is not found
/// </summary>
#if !NETSTANDARD1_6
[Serializable]
#endif
public class NUnitEngineNotFoundException : Exception
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

using System;
using System.Collections.Generic;
#if !NETSTANDARD1_6
using System.Runtime.Serialization;
#endif

namespace NUnit.Engine
{
Expand All @@ -33,7 +35,9 @@ namespace NUnit.Engine
/// but one or more errors were encountered when attempting to unload
/// and shut down the test run cleanly.
/// </summary>
#if !NETSTANDARD1_6
[Serializable]
#endif
public class NUnitEngineUnloadException : NUnitEngineException //Inherits from NUnitEngineException for backwards compatibility of calling runners
{
private const string AggregatedExceptionsMsg =
Expand Down Expand Up @@ -62,10 +66,12 @@ public NUnitEngineUnloadException(ICollection<Exception> aggregatedExceptions) :
AggregatedExceptions = aggregatedExceptions;
}

#if !NETSTANDARD1_6
/// <summary>
/// Serialization constructor.
/// </summary>
public NUnitEngineUnloadException(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endif

/// <summary>
/// Gets the collection of exceptions .
Expand Down
Loading

0 comments on commit 2336e76

Please sign in to comment.