diff --git a/src/IKVM.Core.MSBuild.Tasks/GenerateDepsFileExtensions.cs b/src/IKVM.Core.MSBuild.Tasks/GenerateDepsFileExtensions.cs index ddef25d..d181d3c 100644 --- a/src/IKVM.Core.MSBuild.Tasks/GenerateDepsFileExtensions.cs +++ b/src/IKVM.Core.MSBuild.Tasks/GenerateDepsFileExtensions.cs @@ -57,6 +57,7 @@ void WriteDepsFile(DependencyContext context) new DependencyContextWriter().Write(context, wrt); } + /// public override bool Execute() { WriteDepsFile(BuildDependencyContext(ReadDepsFile())); @@ -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)) @@ -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))