Skip to content

Commit

Permalink
Use Microsoft.Extensions.DependencyModel to locate dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
CharliePoole committed Jan 7, 2023
1 parent 3b357db commit 3f854b2
Show file tree
Hide file tree
Showing 10 changed files with 205 additions and 96 deletions.
54 changes: 33 additions & 21 deletions cake/package-definitions.cake
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,18 @@ public void InitializePackageDefinitions(ICakeContext context)
HasDirectory("tools/agents/nunit-agent-netcore31")
.WithFiles(
"nunit-agent-netcore31.dll", "nunit.engine.core.dll",
"nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
"nunit.engine.api.dll", "testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("tools/agents/nunit-agent-net50")
.WithFiles(
"nunit-agent-net50.dll", "nunit.engine.core.dll",
"nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
"nunit.engine.api.dll", "testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("tools/agents/nunit-agent-net60")
.WithFiles(
"nunit-agent-net60.dll", "nunit.engine.core.dll",
"nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
"nunit.engine.api.dll", "testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("tools/agents/nunit-agent-net70")
.WithFiles("nunit-agent-net70.dll", "nunit.engine.core.dll",
"nunit.engine.api.dll", "testcentric.engine.metadata.dll")
"nunit.engine.api.dll", "testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll")
},
symbols: new PackageCheck[] {
HasDirectory("tools")
Expand Down Expand Up @@ -141,7 +141,7 @@ public void InitializePackageDefinitions(ICakeContext context)
HasDirectory("tools/net6.0/any")
.WithFiles(
"nunit4-netcore-console.exe", "nunit4-netcore-console.dll", "nunit4-netcore-console.dll.config", "nunit.console.nuget.addins",
"nunit.engine.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll")
"nunit.engine.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll")
},
symbols: new PackageCheck[] {
HasDirectory("tools/net6.0/any").
Expand Down Expand Up @@ -175,16 +175,20 @@ public void InitializePackageDefinitions(ICakeContext context)
"nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
HasDirectory("tools/agents/nunit-agent-netcore31")
.WithFiles(
"nunit-agent-netcore31.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
"nunit-agent-netcore31.dll", "nunit.engine.core.dll", "nunit.engine.api.dll",
"testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("tools/agents/nunit-agent-net50")
.WithFiles(
"nunit-agent-net50.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
"nunit-agent-net50.dll", "nunit.engine.core.dll", "nunit.engine.api.dll",
"testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("tools/agents/nunit-agent-net60")
.WithFiles(
"nunit-agent-net60.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
"nunit-agent-net60.dll", "nunit.engine.core.dll", "nunit.engine.api.dll",
"testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("tools/agents/nunit-agent-net70")
.WithFiles(
"nunit-agent-net70.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll")
"nunit-agent-net70.dll", "nunit.engine.core.dll", "nunit.engine.api.dll",
"testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll")
},
executable: "tools/nunit4-console.exe",
tests: StandardRunnerTests),
Expand Down Expand Up @@ -215,20 +219,24 @@ public void InitializePackageDefinitions(ICakeContext context)
"nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
HasDirectory("NUnit.org/nunit-console/agents/nunit-agent-netcore31")
.WithFiles(
"nunit-agent-netcore31.dll", "nunit.engine.core.dll",
"nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
"nunit-agent-netcore31.dll", "nunit-agent-netcore31.dll.config",
"nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll",
"Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("NUnit.org/nunit-console/agents/nunit-agent-net50")
.WithFiles(
"nunit-agent-net50.dll", "nunit.engine.core.dll",
"nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
"nunit-agent-net50.dll", "nunit-agent-net50.dll.config",
"nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll",
"Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("NUnit.org/nunit-console/agents/nunit-agent-net60")
.WithFiles(
"nunit-agent-net60.dll", "nunit.engine.core.dll",
"nunit.engine.api.dll", "testcentric.engine.metadata.dll"),
"nunit-agent-net60.dll", "nunit-agent-net60.dll.config",
"nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll",
"Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("NUnit.org/nunit-console/agents/nunit-agent-net70")
.WithFiles(
"nunit-agent-net70.dll", "nunit.engine.core.dll",
"nunit.engine.api.dll", "testcentric.engine.metadata.dll")
"nunit-agent-net70.dll", "nunit-agent-net70.dll.config",
"nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll",
"Microsoft.Extensions.DependencyModel.dll")
},
executable: "NUnit.org/nunit-console/nunit4-console.exe",
tests: StandardRunnerTests.Concat(new[] { NUnitProjectTest })),
Expand Down Expand Up @@ -260,19 +268,23 @@ public void InitializePackageDefinitions(ICakeContext context)
"nunit-agent-net462.pdb", "nunit-agent-net462-x86.pdb", "nunit.engine.core.pdb", "nunit.engine.api.pdb"),
HasDirectory("bin/agents/nunit-agent-netcore31")
.WithFiles(
"nunit-agent-netcore31.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll",
"nunit-agent-netcore31.dll", "nunit.engine.core.dll", "nunit.engine.api.dll",
"testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll",
"nunit-agent-netcore31.pdb", "nunit.engine.core.pdb", "nunit.engine.api.pdb"),
HasDirectory("bin/agents/nunit-agent-net50")
.WithFiles(
"nunit-agent-net50.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll",
"nunit-agent-net50.dll", "nunit.engine.core.dll", "nunit.engine.api.dll",
"testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll",
"nunit-agent-net50.pdb", "nunit.engine.core.pdb", "nunit.engine.api.pdb"),
HasDirectory("bin/agents/nunit-agent-net60")
.WithFiles(
"nunit-agent-net60.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll",
"nunit-agent-net60.dll", "nunit.engine.core.dll", "nunit.engine.api.dll",
"testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll",
"nunit-agent-net60.pdb", "nunit.engine.core.pdb", "nunit.engine.api.pdb"),
HasDirectory("bin/agents/nunit-agent-net70")
.WithFiles(
"nunit-agent-net70.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll",
"nunit-agent-net70.dll", "nunit.engine.core.dll", "nunit.engine.api.dll",
"testcentric.engine.metadata.dll", "Microsoft.Extensions.DependencyModel.dll",
"nunit-agent-net70.pdb", "nunit.engine.core.pdb", "nunit.engine.api.pdb")
},
executable: $"bin/nunit4-console.exe",
Expand Down
4 changes: 4 additions & 0 deletions choco/nunit-console-runner.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<file src = "$BASE$agents/nunit-agent-netcore31/nunit.engine.api.xml" target="tools/agents/nunit-agent-netcore31" />
<file src = "$BASE$agents/nunit-agent-netcore31/nunit.engine.core.dll" target="tools/agents/nunit-agent-netcore31" />
<file src = "$BASE$agents/nunit-agent-netcore31/testcentric.engine.metadata.dll" target="tools/agents/nunit-agent-netcore31" />
<file src = "$BASE$agents/nunit-agent-netcore31/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/nunit-agent-netcore31" />

<file src = "$BASE$agents/nunit-agent-net50/nunit-agent-net50.dll" target="tools/agents/nunit-agent-net50" />
<file src = "$BASE$agents/nunit-agent-net50/nunit-agent-net50.dll.config" target="tools/agents/nunit-agent-net50" />
Expand All @@ -78,6 +79,7 @@
<file src = "$BASE$agents/nunit-agent-net50/nunit.engine.api.xml" target="tools/agents/nunit-agent-net50" />
<file src = "$BASE$agents/nunit-agent-net50/nunit.engine.core.dll" target="tools/agents/nunit-agent-net50" />
<file src = "$BASE$agents/nunit-agent-net50/testcentric.engine.metadata.dll" target="tools/agents/nunit-agent-net50" />
<file src = "$BASE$agents/nunit-agent-net50/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/nunit-agent-net50" />

<file src = "$BASE$agents/nunit-agent-net60/nunit-agent-net60.dll" target="tools/agents/nunit-agent-net60" />
<file src = "$BASE$agents/nunit-agent-net60/nunit-agent-net60.dll.config" target="tools/agents/nunit-agent-net60" />
Expand All @@ -87,6 +89,7 @@
<file src = "$BASE$agents/nunit-agent-net60/nunit.engine.api.xml" target="tools/agents/nunit-agent-net60" />
<file src = "$BASE$agents/nunit-agent-net60/nunit.engine.core.dll" target="tools/agents/nunit-agent-net60" />
<file src = "$BASE$agents/nunit-agent-net60/testcentric.engine.metadata.dll" target="tools/agents/nunit-agent-net60" />
<file src = "$BASE$agents/nunit-agent-net60/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/nunit-agent-net60" />

<file src = "$BASE$agents/nunit-agent-net70/nunit-agent-net70.dll" target="tools/agents/nunit-agent-net70" />
<file src = "$BASE$agents/nunit-agent-net70/nunit-agent-net70.dll.config" target="tools/agents/nunit-agent-net70" />
Expand All @@ -96,5 +99,6 @@
<file src = "$BASE$agents/nunit-agent-net70/nunit.engine.api.xml" target="tools/agents/nunit-agent-net70" />
<file src = "$BASE$agents/nunit-agent-net70/nunit.engine.core.dll" target="tools/agents/nunit-agent-net70" />
<file src = "$BASE$agents/nunit-agent-net70/testcentric.engine.metadata.dll" target="tools/agents/nunit-agent-net70" />
<file src = "$BASE$agents/nunit-agent-net70/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/nunit-agent-net70" />
</files>
</package>
37 changes: 32 additions & 5 deletions msi/nunit/engine-files.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@
</ComponentGroup>
<ComponentGroup Id="NETCORE31_AGENT" Directory="NETCORE31_AGENT_DIR">
<Component Id="NUNIT_AGENT_NETCORE31" Location="local" Guid="21E39B4C-07E4-4C38-8F91-7030516127E2">
<File Id="nunit_agent_netcore31.exe"
<File Id="nunit_agent_netcore31.dll"
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-netcore31/nunit-agent-netcore31.dll" />
<File Id="nunit_agent_netcore31.dll.config"
Source="$(var.InstallImage)agents/nunit-agent-netcore31/nunit-agent-netcore31.dll.config" />
<File Id="nunit_agent_netcore31.deps.json"
Source="$(var.InstallImage)agents/nunit-agent-netcore31/nunit-agent-netcore31.deps.json" />
<File Id="nunit_agent_netcore31.runtimeconfig.json"
Expand All @@ -138,12 +140,19 @@
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-netcore31/testcentric.engine.metadata.dll" />
</Component>
<Component Id="NUNIT_AGENT_NETCORE31_DEPENDENCY_MODEL" Location="local" Guid="6A33A615-BCD2-411C-B3A8-95BF5829C8CA">
<File Id="Microsoft.Extensions.DependencyModel.netcore31.dll"
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-netcore31/Microsoft.Extensions.DependencyModel.dll" />
</Component>
</ComponentGroup>
<ComponentGroup Id="NET50_AGENT" Directory="NET50_AGENT_DIR">
<Component Id="NUNIT_AGENT_NET50" Location="local" Guid="6B5C423E-5EDB-4DD4-8B7F-626C8F4EAF06">
<File Id="nunit_agent_net50.exe"
<File Id="nunit_agent_net50.dll"
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-net50/nunit-agent-net50.dll" />
<File Id="nunit_agent_net50.dll.config"
Source="$(var.InstallImage)agents/nunit-agent-net50/nunit-agent-net50.dll.config" />
<File Id="nunit_agent_net50.deps.json"
Source="$(var.InstallImage)agents/nunit-agent-net50/nunit-agent-net50.deps.json" />
<File Id="nunit_agent_net50.runtimeconfig.json"
Expand All @@ -166,12 +175,18 @@
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-net50/testcentric.engine.metadata.dll" />
</Component>
</ComponentGroup>
<Component Id="NUNIT_AGENT_NET50_DEPENDENCY_MODEL" Location="local" Guid="EF4F5A8A-AC06-4228-97C0-DBD8B7E1C50B">
<File Id="Microsoft.Extensions.DependencyModel.net50.dll"
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-net50/Microsoft.Extensions.DependencyModel.dll" />
</Component> </ComponentGroup>
<ComponentGroup Id="NET60_AGENT" Directory="NET60_AGENT_DIR">
<Component Id="NUNIT_AGENT_NET60" Location="local" Guid="8AFA7F03-96EA-4F80-8B79-7AFB59B67786">
<File Id="nunit_agent_net60.exe"
<File Id="nunit_agent_net60.dll"
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-net60/nunit-agent-net60.dll" />
<File Id="nunit_agent_net60.dll.config"
Source="$(var.InstallImage)agents/nunit-agent-net60/nunit-agent-net60.dll.config" />
<File Id="nunit_agent_net60.deps.json"
Source="$(var.InstallImage)agents/nunit-agent-net60/nunit-agent-net60.deps.json" />
<File Id="nunit_agent_net60.runtimeconfig.json"
Expand All @@ -194,12 +209,19 @@
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-net60/testcentric.engine.metadata.dll" />
</Component>
<Component Id="NUNIT_AGENT_NET60_DEPENDENCY_MODEL" Location="local" Guid="EFD82EAE-A38E-45E0-944B-A776F7353100">
<File Id="Microsoft.Extensions.DependencyModel.net60.dll"
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-net60/Microsoft.Extensions.DependencyModel.dll" />
</Component>
</ComponentGroup>
<ComponentGroup Id="NET70_AGENT" Directory="NET70_AGENT_DIR">
<Component Id="NUNIT_AGENT_NET70" Location="local" Guid="B5209C53-26BD-4F5E-B14D-3E43164CDC79">
<File Id="nunit_agent_net70.exe"
<File Id="nunit_agent_net70.dll"
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-net70/nunit-agent-net70.dll" />
<File Id="nunit_agent_net70.dll.config"
Source="$(var.InstallImage)agents/nunit-agent-net70/nunit-agent-net70.dll.config" />
<File Id="nunit_agent_net70.deps.json"
Source="$(var.InstallImage)agents/nunit-agent-net70/nunit-agent-net70.deps.json" />
<File Id="nunit_agent_net70.runtimeconfig.json"
Expand All @@ -222,6 +244,11 @@
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-net70/testcentric.engine.metadata.dll" />
</Component>
<Component Id="NUNIT_AGENT_NET70_DEPENDENCY_MODEL" Location="local" Guid="B5469699-3822-45DA-889F-BAF312945A24">
<File Id="Microsoft.Extensions.DependencyModel.net70.dll"
ProcessorArchitecture="msil"
Source="$(var.InstallImage)agents/nunit-agent-net70/Microsoft.Extensions.DependencyModel.dll" />
</Component>
</ComponentGroup>
</Fragment>
</Include>
1 change: 1 addition & 0 deletions nuget/runners/nunit.console-runner.netcore.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<file src="nunit.engine.api.pdb" target="tools/net6.0/any" />
<file src="nunit.engine.api.xml" target="tools/net6.0/any" />
<file src="testcentric.engine.metadata.dll" target="tools/net6.0/any" />
<file src="Microsoft.Extensions.DependencyModel.dll" target="tools/net6.0/any" />
<file src="../../../../../../nuget/runners/nunit.console.nuget.addins" target="tools/net6.0/any"/>
<file src="../../../../../../nuget/runners/DotnetToolSettings.xml" target="tools/net6.0/any"/>
<file src="../../../../../../nunit_256.png" target="images"/>
Expand Down
Loading

0 comments on commit 3f854b2

Please sign in to comment.