Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest recipe; fix format of zip file #1599

Merged
merged 1 commit into from
Jan 11, 2025
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
15 changes: 10 additions & 5 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.3.0
#load nuget:?package=NUnit.Cake.Recipe&version=1.3.1-alpha.1
// Comment out above line and uncomment below for local tests of recipe changes
//#load ../NUnit.Cake.Recipe/recipe/*.cake

Expand Down Expand Up @@ -121,10 +121,15 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
HasFiles("LICENSE.txt", "NOTICES.txt", "CHANGES.txt"),
HasDirectory("bin/net462").WithFiles("nunit3-console.exe", "nunit3-console.exe.config",
"nunit3-console.pdb").AndFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES),
HasDirectory("bin/net462/addins").WithFiles(
"nunit.core.dll", "nunit.core.interfaces.dll", "nunit.engine.api.dll",
"nunit.v2.driver.dll", "nunit-project-loader.dll", "nunit-v2-result-writer.dll",
"teamcity-event-listener.dll", "vs-project-loader.dll"),
HasDirectory("NUnit.Extension.NUnitProjectLoader.3.8.0"),
HasDirectory("NUnit.Extension.NUnitV2Driver.3.9.0"),
HasDirectory("NUnit.Extension.NUnitV2ResultWriter.3.8.0"),
HasDirectory("NUnit.Extension.TeamCityEventListener.1.0.7"),
HasDirectory("NUnit.Extension.VSProjectLoader.3.9.0"),
//HasDirectory("bin/net462/addins").WithFiles(
// "nunit.core.dll", "nunit.core.interfaces.dll", "nunit.engine.api.dll",
// "nunit.v2.driver.dll", "nunit-project-loader.dll", "nunit-v2-result-writer.dll",
// "teamcity-event-listener.dll", "vs-project-loader.dll"),
HasDirectory("bin/netcoreapp3.1").WithFiles(ENGINE_CORE_FILES).AndFiles(ENGINE_CORE_PDB_FILES),
HasDirectory("bin/agents/net462").WithFiles(AGENT_FILES).AndFiles(AGENT_PDB_FILES),
HasDirectory("bin/agents/net6.0").WithFiles(AGENT_FILES_NETCORE).AndFiles(AGENT_PDB_FILES_NETCORE),
Expand Down
11 changes: 10 additions & 1 deletion src/NUnitEngine/nunit.engine.core/Services/ExtensionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ private void ProcessAddinsFile(IFile addinsFile, bool fromWildCard)
string entryDir = entry.DirectoryName;
string entryFile = entry.FileName;

log.Debug($"Processing entry {entry.Text}");
if (entry.IsDirectory)
{
if (entry.IsFullyQualified)
Expand Down Expand Up @@ -412,9 +413,14 @@ private void ProcessAddinsFile(IFile addinsFile, bool fromWildCard)

private void ProcessCandidateAssembly(string filePath, bool fromWildCard)
{
log.Debug($"Processing candidate assembly {filePath}");

// Did we already process this file?
if (_assemblies.ByPath.ContainsKey(filePath))
{
log.Debug(" Skipping assembly already processed");
return;
}

try
{
Expand All @@ -423,10 +429,12 @@ private void ProcessCandidateAssembly(string filePath, bool fromWildCard)

// We never add assemblies unless the host can load them
if (!CanLoadTargetFramework(Assembly.GetEntryAssembly(), candidateAssembly))
{
log.Debug(" Unable to load this assembly");
return;
}

// Do we already have a copy of the same assembly at a different path?
//if (_assemblies.ByName.ContainsKey(assemblyName))
if (_assemblies.ByName.TryGetValue(assemblyName, out ExtensionAssembly existing))
{
if (candidateAssembly.IsBetterVersionOf(existing))
Expand All @@ -435,6 +443,7 @@ private void ProcessCandidateAssembly(string filePath, bool fromWildCard)
return;
}

log.Debug(" Adding this assembly");
_assemblies.Add(candidateAssembly);
}
catch (BadImageFormatException e)
Expand Down
6 changes: 1 addition & 5 deletions src/NUnitEngine/nunit.engine/nunit.engine.addins
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
addins/nunit.v2.driver.dll
addins/nunit-v2-result-writer.dll
addins/nunit-project-loader.dll
addins/vs-project-loader.dll
addins/teamcity-event-listener.dll
../../../bundled-extensions/NUnit.Extension.*/tools/**/
Loading