Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 1 addition & 102 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Load the recipe
#load nuget:?package=NUnit.Cake.Recipe&version=1.6.0
#load nuget:?package=NUnit.Cake.Recipe&version=2.0.0-beta.3
// Comment out above line and uncomment below for local tests of recipe changes
//#load ../NUnit.Cake.Recipe/recipe/*.cake

Expand All @@ -15,26 +15,6 @@ BuildSettings.Initialize
);

var PackageTests = new PackageTest[] {
//new PackageTest(1, "NetCore11PackageTest")
//{
// Description = "Run mock-assembly.dll targeting .NET Core 1.1",
// Arguments = "tests/netcoreapp1.1/mock-assembly.dll",
// ExpectedResult = new ExpectedResult("Failed")
// {
// Total = 35, Passed = 21, Failed = 5, Warnings = 1, Inconclusive = 1, Skipped = 7,
// Assemblies = new ExpectedAssemblyResult[] { new ExpectedAssemblyResult("mock-assembly.dll") }
// }
//},
//new PackageTest(1, "NetCore21PackageTest")
//{
// Description = "Run mock-assembly.dll targeting .NET Core 2.1",
// Arguments = "tests/netcoreapp2.1/mock-assembly.dll",
// ExpectedResult = new ExpectedResult("Failed")
// {
// Total = 35, Passed = 21, Failed = 5, Warnings = 1, Inconclusive = 1, Skipped = 7,
// Assemblies = new ExpectedAssemblyResult[] { new ExpectedAssemblyResult("mock-assembly.dll") }
// }
//},
new PackageTest(1, "NetCore31PackageTest")
{
Description = "Run mock-assembly.dll targeting .NET Core 3.1",
Expand All @@ -45,16 +25,6 @@ var PackageTests = new PackageTest[] {
Assemblies = new ExpectedAssemblyResult[] { new ExpectedAssemblyResult("mock-assembly.dll") }
}
},
//new PackageTest(1, "Net50PackageTest")
//{
// Description = "Run mock-assembly.dll targeting .NET 5.0",
// Arguments = "testdata/net5.0/mock-assembly.dll",
// ExpectedResult = new ExpectedResult("Failed")
// {
// Total = 35, Passed = 21, Failed = 5, Warnings = 1, Inconclusive = 1, Skipped = 7,
// Assemblies = new ExpectedAssemblyResult[] { new ExpectedAssemblyResult("mock-assembly.dll") }
// }
//},
new PackageTest(1, "Net60PackageTest")
{
Description = "Run mock-assembly.dll targeting .NET 6.0",
Expand Down Expand Up @@ -138,80 +108,9 @@ BuildSettings.Packages.Add(new ChocolateyPackage(
"nunit.extensibility.api.dll", "nunit.extensibility.dll", "nunit.agent.core.dll",
"TestCentric.Metadata.dll", "Microsoft.Extensions.DependencyModel.dll")
},
// packageContent: new PackageContent()
// .WithRootFiles("../../nunit.png")
// .WithDirectories(
// new DirectoryContent("tools").WithFiles(
// "../../LICENSE.txt", "../../README.md", "../../VERIFICATION.txt",
// "net80-agent-launcher.dll", "net80-agent-launcher.pdb",
// "NUnit.Extensibility.Api.dll", "NUnit.Engine.Api.dll"),
// new DirectoryContent("tools/agent").WithFiles(
// "agent/net80-agent.dll", "agent/net80-agent.pdb", "agent/net80-agent.dll.config", "agent/NUnit.Agent.Core.dll",
// "agent/net80-agent.deps.json", $"agent/net80-agent.runtimeconfig.json",
// "agent/NUnit.InternalTrace.dll", "agent/NUnit.Metadata.dll",
// "agent/NUnit.Extensibility.dll", "agent/NUnit.Extensibility.Api.dll",
// "agent/NUnit.Engine.Api.dll", "agent/Microsoft.Extensions.DependencyModel.dll")),
testRunner: new AgentRunner(BuildSettings.ChocolateyTestDirectory + "nunit-extension-net80-pluggable-agent." + BuildSettings.PackageVersion + "/tools/agent/nunit-agent-net80.dll"),
tests: PackageTests));

Task("PublishToNuGet")
.Description("""
Publishes packages to NuGet for an alpha, beta, rc or final release. If not,
or if the --nopush option was used, a message is displayed.
""")
.Does(() =>
{
if (!BuildSettings.ShouldPublishToNuGet)
Information("Nothing to publish to NuGet from this run.");
else if (CommandLineOptions.NoPush)
Information("NoPush option suppressing publication to NuGet");
else
foreach (var package in BuildSettings.Packages)
{
var packageName = $"{package.PackageId}.{BuildSettings.PackageVersion}.nupkg";
var packagePath = BuildSettings.PackageDirectory + packageName;
try
{
if (package.PackageType == PackageType.NuGet)
NuGetPush(packagePath, new NuGetPushSettings() { ApiKey = BuildSettings.NuGetApiKey, Source = BuildSettings.NuGetPushUrl });
}
catch (Exception ex)
{
Error(ex.Message);
throw;
}
}
});

Task("PublishToChocolatey")
.Description("""
Publishes packages to Chocolatey for an alpha, beta, rc or final release.
If not, or if the --nopush option was used, a message is displayed.
""")
.Does(() =>
{
if (!BuildSettings.ShouldPublishToChocolatey)
Information("Nothing to publish to Chocolatey from this run.");
else if (CommandLineOptions.NoPush)
Information("NoPush option suppressing publication to Chocolatey");
else
foreach (var package in BuildSettings.Packages)
{
var packageName = $"{package.PackageId}.{BuildSettings.PackageVersion}.nupkg";
var packagePath = BuildSettings.PackageDirectory + packageName;
try
{
if (package.PackageType == PackageType.Chocolatey)
ChocolateyPush(packagePath, new ChocolateyPushSettings() { ApiKey = BuildSettings.ChocolateyApiKey, Source = BuildSettings.ChocolateyPushUrl });
}
catch (Exception ex)
{
Error(ex.Message);
throw;
}
}
});

//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 4 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>Minimum</AnalysisMode>
</PropertyGroup>
<!-- Common Package Versions -->
<NUnitEngineApiVersion>4.0.0-beta.2</NUnitEngineApiVersion>
<NUnitAgentCoreVersion>4.0.0-beta.2</NUnitAgentCoreVersion>
</PropertyGroup>

</Project>
4 changes: 2 additions & 2 deletions src/agent/nunit-agent-net80.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NUnit.Agent.Core" Version="4.0.0-beta.2" />
<PackageReference Include="NUnit.Engine.Api" Version="4.0.0-beta.2" />
<PackageReference Include="NUnit.Agent.Core" Version="$(NUnitAgentCoreVersion)" />
<PackageReference Include="NUnit.Engine.Api" Version="$(NUnitEngineApiVersion)" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/launcher/nunit-agent-launcher-net80.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit.Engine.Api" Version="4.0.0-beta.2" />
<PackageReference Include="NUnit.Extensibility.Api" Version="4.0.0-beta.2" />
<PackageReference Include="NUnit.Engine.Api" Version="$(NUnitEngineApiVersion)" />
<PackageReference Include="NUnit.Extensibility.Api" Version="$(NUnitEngineApiVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/nunit-agent-launcher-net80.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ItemGroup>
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnitLite" Version="4.1.0" />
<PackageReference Include="NUnit.Engine.Api" Version="4.0.0-beta.2" />
<PackageReference Include="NUnit.Engine.Api" Version="$(NUnitEngineApiVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading