Skip to content

Commit

Permalink
Clear all existing entries, including possible duplicates.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Mar 28, 2024
1 parent fb0809e commit c9f5314
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/IKVM.Core.MSBuild.Tasks/GenerateDepsFileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void WriteDepsFile(DependencyContext context)
new DependencyContextWriter().Write(context, wrt);
}

/// <inheritdoc />
public override bool Execute()
{
WriteDepsFile(BuildDependencyContext(ReadDepsFile()));
Expand Down Expand Up @@ -197,10 +198,9 @@ RuntimeAssetGroup BuildRuntimeLibraryRuntimeAssemblyGroupWithAdditional(Dependen
// normalize Windows paths
path = path.Replace('\\', '/');

// find existing runtime file and remove
// find existing file and clear duplicates
var file = runtimeFiles.FirstOrDefault(i => (i.Path ?? "") == path);
if (file != null)
runtimeFiles.Remove(file);
runtimeFiles.RemoveAll(i => (i.Path ?? "") == path);

var assemblyVersion = addl.GetMetadata(METADATA_LIBRARY_ASSET_ASSEMBLYVERSION) ?? file?.AssemblyVersion;
if (string.IsNullOrEmpty(assemblyVersion))
Expand Down Expand Up @@ -251,10 +251,9 @@ RuntimeAssetGroup BuildRuntimeLibraryNativeAssetGroupWithAdditional(DependencyCo
// normalize Windows paths
path = path.Replace('\\', '/');

// find existing runtime file and remove
// find existing file and clear duplicates
var file = runtimeFiles.FirstOrDefault(i => (i.Path ?? "") == path);
if (file != null)
runtimeFiles.Remove(file);
runtimeFiles.RemoveAll(i => (i.Path ?? "") == path);

var assemblyVersion = addl.GetMetadata(METADATA_LIBRARY_ASSET_ASSEMBLYVERSION) ?? file?.AssemblyVersion;
if (string.IsNullOrEmpty(assemblyVersion))
Expand Down

0 comments on commit c9f5314

Please sign in to comment.