@@ -217,10 +217,6 @@ FilePath[] AGENT_PDB_FILES = {
217217 "nunit-agent.pdb" , "nunit-agent-x86.pdb" , "nunit.engine.core.pdb" , "nunit.engine.api.pdb" } ;
218218FilePath [ ] AGENT_PDB_FILES_NETCORE = {
219219 "nunit-agent.pdb" , "nunit.engine.core.pdb" , "nunit.engine.api.pdb" } ;
220- FilePath [ ] CONSOLE_FILES = {
221- "nunit3-console.exe" , "nunit3-console.exe.config" } ;
222- FilePath [ ] CONSOLE_FILES_NETCORE = {
223- "nunit3-console.exe" , "nunit3-console.dll" } ;
224220
225221//////////////////////////////////////////////////////////////////////
226222// INDIVIDUAL PACKAGE DEFINITIONS
@@ -241,7 +237,7 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
241237 source : BuildSettings . NuGetDirectory + "runners/nunit.console-runner.nuspec" ,
242238 checks : new PackageCheck [ ] {
243239 HasFiles ( "LICENSE.txt" , "NOTICES.txt" ) ,
244- HasDirectory ( "tools" ) . WithFiles ( CONSOLE_FILES ) . AndFiles ( ENGINE_FILES ) . AndFile ( " nunit.console.nuget.addins") ,
240+ HasDirectory ( "tools" ) . WithFiles ( "nunit3-console.exe" , "nunit3-console.exe.config" , " nunit.console.nuget.addins") . AndFiles ( ENGINE_FILES ) ,
245241 HasDirectory ( "tools/agents/net462" ) . WithFiles ( AGENT_FILES ) . AndFile ( "nunit.console.nuget.agent.addins" ) ,
246242 HasDirectory ( "tools/agents/netcoreapp3.1" ) . WithFiles ( AGENT_FILES_NETCORE ) . AndFile ( "nunit.console.nuget.agent.addins" ) ,
247243 HasDirectory ( "tools/agents/net6.0" ) . WithFiles ( AGENT_FILES_NETCORE ) . AndFile ( "nunit.console.nuget.agent.addins" ) ,
@@ -266,25 +262,19 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
266262 source : BuildSettings . NuGetDirectory + "runners/nunit.console-runner-with-extensions.nuspec" ,
267263 checks : new PackageCheck [ ] { HasFile ( "LICENSE.txt" ) } ) ,
268264
269- NUnitConsoleRunnerNetCorePackage = new NuGetPackage (
265+ NUnitConsoleRunnerNetCorePackage = new DotNetToolPackage (
270266 id : "NUnit.ConsoleRunner.NetCore" ,
271267 source : BuildSettings . NuGetDirectory + "runners/nunit.console-runner.netcore.nuspec" ,
272- checks : new PackageCheck [ ] {
273- HasFiles ( "LICENSE.txt" , "NOTICES.txt" ) ,
274- HasDirectory ( "tools/net6.0" ) . WithFiles ( CONSOLE_FILES_NETCORE ) . AndFiles ( ENGINE_CORE_FILES ) . AndFile ( "nunit.console.nuget.addins" )
275- } ,
276- symbols : new PackageCheck [ ] {
277- HasDirectory ( "tools/net6.0" ) . WithFile ( "nunit3-console.pdb" ) . AndFiles ( ENGINE_PDB_FILES )
278- } ,
268+ checks : new PackageCheck [ ] { HasFiles ( "nunit.exe" ) } ,
279269 testRunner : new ConsoleRunnerSelfTester ( BuildSettings . NuGetTestDirectory
280- + $ "NUnit.ConsoleRunner.NetCore.{ BuildSettings . PackageVersion } /tools/net6.0/nunit3-console .exe") ,
270+ + $ "NUnit.ConsoleRunner.NetCore.{ BuildSettings . PackageVersion } /nunit .exe") ,
281271 tests : NetCoreRunnerTests ) ,
282272
283273 NUnitConsoleRunnerChocolateyPackage = new ChocolateyPackage (
284274 id : "nunit-console-runner" ,
285275 source : BuildSettings . ChocolateyDirectory + "nunit-console-runner.nuspec" ,
286276 checks : new PackageCheck [ ] {
287- HasDirectory ( "tools" ) . WithFiles ( "LICENSE.txt" , "NOTICES.txt" , "VERIFICATION.txt" ) . AndFiles ( CONSOLE_FILES ) . AndFiles ( ENGINE_FILES ) . AndFile ( " nunit.console.choco.addins") ,
277+ HasDirectory ( "tools" ) . WithFiles ( "LICENSE.txt" , "NOTICES.txt" , "VERIFICATION.txt" , "nunit3-console.exe" , "nunit3-console.exe.config" , " nunit.console.choco.addins") . AndFiles ( ENGINE_FILES ) ,
288278 HasDirectory ( "tools/agents/net462" ) . WithFiles ( AGENT_FILES ) . AndFile ( "nunit.console.choco.agent.addins" ) ,
289279 HasDirectory ( "tools/agents/netcoreapp3.1" ) . WithFiles ( AGENT_FILES_NETCORE ) . AndFile ( "nunit.console.choco.agent.addins" ) ,
290280 HasDirectory ( "tools/agents/net6.0" ) . WithFiles ( AGENT_FILES_NETCORE ) . AndFile ( "nunit.console.choco.agent.addins" ) ,
@@ -300,7 +290,7 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
300290 source : BuildSettings . ZipImageDirectory ,
301291 checks : new PackageCheck [ ] {
302292 HasFiles ( "LICENSE.txt" , "NOTICES.txt" , "CHANGES.txt" ) ,
303- HasDirectory ( "bin/net462" ) . WithFiles ( CONSOLE_FILES ) . AndFiles ( ENGINE_FILES ) . AndFile ( " nunit3-console.pdb") . AndFiles ( ENGINE_PDB_FILES ) ,
293+ HasDirectory ( "bin/net462" ) . WithFiles ( "nunit3-console.exe" , "nunit3-console.exe.config" , " nunit3-console.pdb") . AndFiles ( ENGINE_FILES ) . AndFiles ( ENGINE_PDB_FILES ) ,
304294 HasDirectory ( "bin/netstandard2.0" ) . WithFiles ( ENGINE_FILES ) . AndFiles ( ENGINE_PDB_FILES ) ,
305295 HasDirectory ( "bin/netcoreapp3.1" ) . WithFiles ( ENGINE_CORE_FILES ) . AndFiles ( ENGINE_CORE_PDB_FILES ) ,
306296 HasDirectory ( "bin/agents/net462" ) . WithFiles ( AGENT_FILES ) . AndFiles ( AGENT_PDB_FILES ) ,
@@ -392,6 +382,29 @@ public class ConsoleRunnerSelfTester : TestRunner, IPackageTestRunner
392382 }
393383}
394384
385+ //////////////////////////////////////////////////////////////////////
386+ // DOTNET TOOL PACKAGE
387+ //////////////////////////////////////////////////////////////////////
388+
389+ // TODO: Temporary custom package class to be moved into the recipe
390+
391+ public class DotNetToolPackage : NuGetPackage
392+ {
393+ public DotNetToolPackage ( string id , string source , string basePath = null ,
394+ IPackageTestRunner testRunner = null , TestRunnerSource testRunnerSource = null ,
395+ PackageCheck [ ] checks = null , PackageCheck [ ] symbols = null , IEnumerable < PackageTest > tests = null )
396+ : base ( id , source , basePath : basePath , testRunner : testRunner , testRunnerSource : testRunnerSource ,
397+ checks : checks , symbols : symbols , tests : tests ) { }
398+
399+ public override void InstallPackage ( )
400+ {
401+ var arguments = $ "tool install { PackageId } --version { BuildSettings . PackageVersion } " +
402+ $ "--add-source \" { BuildSettings . PackageDirectory } \" --tool-path \" { PackageTestDirectory } \" ";
403+ Console . WriteLine ( $ "Executing dotnet { arguments } ") ;
404+ _context . StartProcess ( "dotnet" , arguments ) ;
405+ }
406+ }
407+
395408//////////////////////////////////////////////////////////////////////
396409// ADDITIONAL TARGETS USED FOR RECOVERY AND DEBUGGING
397410//////////////////////////////////////////////////////////////////////
0 commit comments