Skip to content

Commit

Permalink
Merge pull request #1228 from nunit/issue-1225
Browse files Browse the repository at this point in the history
Include netcore 3.1 build in engine package once again
  • Loading branch information
CharliePoole authored Sep 25, 2022
2 parents d59982b + 19d0bed commit 9ad9140
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 14 deletions.
36 changes: 26 additions & 10 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,17 @@ public void BuildSolution()
.WithProperty("TargetFramework", "netstandard2.0")
.WithProperty("PublishDir", BIN_DIR + "netstandard2.0"));

DisplayBanner("Publishing ENGINE Project for NETSTANDARD2.0");
MSBuild(ENGINE_PROJECT, CreateMSBuildSettings("Publish")
.WithProperty("TargetFramework", "netstandard2.0")
.WithProperty("PublishDir", BIN_DIR + "netstandard2.0"));
DisplayBanner("Publishing ENGINE Project");
foreach (var framework in new[] { "netstandard2.0", "netcoreapp3.1" })
MSBuild(ENGINE_PROJECT, CreateMSBuildSettings("Publish")
.WithProperty("TargetFramework", framework)
.WithProperty("PublishDir", BIN_DIR + framework));

DisplayBanner("Publishing ENGINE TESTS Project for NETCOREAPP2.1");
MSBuild(ENGINE_TESTS_PROJECT, CreateMSBuildSettings("Publish")
.WithProperty("TargetFramework", "netcoreapp2.1")
.WithProperty("PublishDir", BIN_DIR + "netcoreapp2.1"));
DisplayBanner("Publishing ENGINE TESTS Project");
foreach (var framework in new[] { "netcoreapp2.1", "netcoreapp3.1" })
MSBuild(ENGINE_TESTS_PROJECT, CreateMSBuildSettings("Publish")
.WithProperty("TargetFramework", framework)
.WithProperty("PublishDir", BIN_DIR + framework));

DisplayBanner("Publishing MOCK ASSEMBLY Project for NET7.0");
MSBuild(MOCK_ASSEMBLY_PROJECT, CreateMSBuildSettings("Publish")
Expand All @@ -143,7 +145,7 @@ private void BuildEachProjectSeparately()
BuildProject(AGENT_PROJECT);
BuildProject(AGENT_X86_PROJECT);

BuildProject(ENGINE_TESTS_PROJECT, "net35", "netcoreapp2.1");
BuildProject(ENGINE_TESTS_PROJECT, "net35", "netcoreapp2.1", "netcoreapp3.1");
BuildProject(ENGINE_CORE_TESTS_PROJECT, "net35", "netcoreapp2.1", "netcoreapp3.1", "net5.0", "net6.0");
BuildProject(CONSOLE_TESTS_PROJECT, "net35", "net6.0");

Expand Down Expand Up @@ -310,6 +312,19 @@ Task("TestNetStandard20Engine")
RunDotnetNUnitLiteTests(NETCORE_ENGINE_TESTS, "netcoreapp2.1");
});

//////////////////////////////////////////////////////////////////////
// TEST NETCORE 3.1 ENGINE
//////////////////////////////////////////////////////////////////////

Task("TestNetCore31Engine")
.Description("Tests the .NET Core 3.1 Engine")
.IsDependentOn("Build")
.OnError(exception => { UnreportedErrors.Add(exception.Message); })
.Does(() =>
{
RunDotnetNUnitLiteTests(NETCORE_ENGINE_TESTS, "netcoreapp3.1");
});

//////////////////////////////////////////////////////////////////////
// TEST .NET 2.0 CONSOLE
//////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -744,7 +759,8 @@ Task("TestEngineCore")
Task("TestEngine")
.Description("Builds and tests the engine assembly")
.IsDependentOn("TestNet20Engine")
.IsDependentOn("TestNetStandard20Engine");
.IsDependentOn("TestNetStandard20Engine")
.IsDependentOn("TestNetCore31Engine");

Task("Test")
.Description("Builds and tests the engine and console runner")
Expand Down
5 changes: 4 additions & 1 deletion cake/package-definitions.cake
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void InitializePackageDefinitions(ICakeContext context)
HasDirectory("bin/net35").WithFiles(CONSOLE_FILES).AndFiles(ENGINE_FILES).AndFile("nunit3-console.pdb").AndFiles(ENGINE_PDB_FILES),
HasDirectory("bin/netstandard2.0").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES),
HasDirectory("bin/netcoreapp2.1").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES),
HasDirectory("bin/netcoreapp3.1").WithFiles(ENGINE_CORE_FILES).AndFiles(ENGINE_CORE_PDB_FILES),
HasDirectory("bin/netcoreapp3.1").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES),
//HasDirectory("bin/net5.0").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES),
HasDirectory("bin/agents/net20").WithFiles(AGENT_FILES).AndFiles(AGENT_PDB_FILES),
HasDirectory("bin/agents/net40").WithFiles(AGENT_FILES).AndFiles(AGENT_PDB_FILES),
Expand All @@ -170,14 +170,17 @@ public void InitializePackageDefinitions(ICakeContext context)
HasFiles("LICENSE.txt", "NOTICES.txt"),
HasDirectory("lib/net20").WithFiles(ENGINE_FILES),
HasDirectory("lib/netstandard2.0").WithFiles(ENGINE_FILES),
HasDirectory("lib/netcoreapp3.1").WithFiles(ENGINE_FILES),
HasDirectory("contentFiles/any/lib/net20").WithFile("nunit.engine.nuget.addins"),
HasDirectory("contentFiles/any/lib/netstandard2.0").WithFile("nunit.engine.nuget.addins"),
HasDirectory("contentFiles/any/lib/netcoreapp3.1").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")
},
symbols: new PackageCheck[] {
HasDirectory("lib/net20").WithFiles(ENGINE_PDB_FILES),
HasDirectory("lib/netstandard2.0").WithFiles(ENGINE_PDB_FILES),
HasDirectory("lib/netcoreapp3.1").WithFiles(ENGINE_PDB_FILES),
HasDirectory("contentFiles/any/agents/net20").WithFiles(AGENT_PDB_FILES),
HasDirectory("contentFiles/any/agents/net40").WithFiles(AGENT_PDB_FILES)
}),
Expand Down
9 changes: 9 additions & 0 deletions nuget/engine/nunit.engine.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@
<file src="netstandard2.0/testcentric.engine.metadata.dll" target="lib/netstandard2.0" />
<file src="../../nuget/engine/nunit.engine.nuget.addins" target="contentFiles/any/lib/netstandard2.0"/>

<file src="netcoreapp3.1/nunit.engine.dll" target="lib/netcoreapp3.1" />
<file src="netcoreapp3.1/nunit.engine.pdb" target="lib/netcoreapp3.1" />
<file src="netcoreapp3.1/nunit.engine.core.dll" target="lib/netcoreapp3.1" />
<file src="netcoreapp3.1/nunit.engine.core.pdb" target="lib/netcoreapp3.1" />
<file src="netcoreapp3.1/testcentric.engine.metadata.dll" target="lib/netcoreapp3.1" />
<file src="netstandard2.0/nunit.engine.api.dll" target="lib/netcoreapp3.1" />
<file src="netstandard2.0/nunit.engine.api.pdb" target="lib/netcoreapp3.1" />
<file src="../../nuget/engine/nunit.engine.nuget.addins" target="contentFiles/any/lib/netcoreapp3.1"/>

<file src="../../nuget/engine/build/**/*" target="build" />
<file src="../../nunit_256.png" target="images" />
</files>
Expand Down
4 changes: 2 additions & 2 deletions src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>NUnit.Engine.Tests</RootNamespace>
<TargetFrameworks>net35;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net35;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
Expand All @@ -28,7 +28,7 @@
<Reference Include="System.Web" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.1'">
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.1' or '$(TargetFramework)'=='netcoreapp3.1'">
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/NUnitEngine/nunit.engine/nunit.engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>NUnit.Engine</RootNamespace>
<TargetFrameworks>net20;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net20;netstandard2.0;netcoreapp3.1</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
<DebugType>portable</DebugType>
Expand Down

0 comments on commit 9ad9140

Please sign in to comment.