@@ -217,10 +217,6 @@ FilePath[] AGENT_PDB_FILES = {
217
217
"nunit-agent.pdb" , "nunit-agent-x86.pdb" , "nunit.engine.core.pdb" , "nunit.engine.api.pdb" } ;
218
218
FilePath [ ] AGENT_PDB_FILES_NETCORE = {
219
219
"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" } ;
224
220
225
221
//////////////////////////////////////////////////////////////////////
226
222
// INDIVIDUAL PACKAGE DEFINITIONS
@@ -241,7 +237,7 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
241
237
source : BuildSettings . NuGetDirectory + "runners/nunit.console-runner.nuspec" ,
242
238
checks : new PackageCheck [ ] {
243
239
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 ) ,
245
241
HasDirectory ( "tools/agents/net462" ) . WithFiles ( AGENT_FILES ) . AndFile ( "nunit.console.nuget.agent.addins" ) ,
246
242
HasDirectory ( "tools/agents/netcoreapp3.1" ) . WithFiles ( AGENT_FILES_NETCORE ) . AndFile ( "nunit.console.nuget.agent.addins" ) ,
247
243
HasDirectory ( "tools/agents/net6.0" ) . WithFiles ( AGENT_FILES_NETCORE ) . AndFile ( "nunit.console.nuget.agent.addins" ) ,
@@ -266,25 +262,19 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
266
262
source : BuildSettings . NuGetDirectory + "runners/nunit.console-runner-with-extensions.nuspec" ,
267
263
checks : new PackageCheck [ ] { HasFile ( "LICENSE.txt" ) } ) ,
268
264
269
- NUnitConsoleRunnerNetCorePackage = new NuGetPackage (
265
+ NUnitConsoleRunnerNetCorePackage = new DotNetToolPackage (
270
266
id : "NUnit.ConsoleRunner.NetCore" ,
271
267
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" ) } ,
279
269
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") ,
281
271
tests : NetCoreRunnerTests ) ,
282
272
283
273
NUnitConsoleRunnerChocolateyPackage = new ChocolateyPackage (
284
274
id : "nunit-console-runner" ,
285
275
source : BuildSettings . ChocolateyDirectory + "nunit-console-runner.nuspec" ,
286
276
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 ) ,
288
278
HasDirectory ( "tools/agents/net462" ) . WithFiles ( AGENT_FILES ) . AndFile ( "nunit.console.choco.agent.addins" ) ,
289
279
HasDirectory ( "tools/agents/netcoreapp3.1" ) . WithFiles ( AGENT_FILES_NETCORE ) . AndFile ( "nunit.console.choco.agent.addins" ) ,
290
280
HasDirectory ( "tools/agents/net6.0" ) . WithFiles ( AGENT_FILES_NETCORE ) . AndFile ( "nunit.console.choco.agent.addins" ) ,
@@ -300,7 +290,7 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
300
290
source : BuildSettings . ZipImageDirectory ,
301
291
checks : new PackageCheck [ ] {
302
292
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 ) ,
304
294
HasDirectory ( "bin/netstandard2.0" ) . WithFiles ( ENGINE_FILES ) . AndFiles ( ENGINE_PDB_FILES ) ,
305
295
HasDirectory ( "bin/netcoreapp3.1" ) . WithFiles ( ENGINE_CORE_FILES ) . AndFiles ( ENGINE_CORE_PDB_FILES ) ,
306
296
HasDirectory ( "bin/agents/net462" ) . WithFiles ( AGENT_FILES ) . AndFiles ( AGENT_PDB_FILES ) ,
@@ -392,6 +382,29 @@ public class ConsoleRunnerSelfTester : TestRunner, IPackageTestRunner
392
382
}
393
383
}
394
384
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
+
395
408
//////////////////////////////////////////////////////////////////////
396
409
// ADDITIONAL TARGETS USED FOR RECOVERY AND DEBUGGING
397
410
//////////////////////////////////////////////////////////////////////
0 commit comments