[Fixes #3856] Allow mapping of the same file to multiple target paths
This commit is contained in:
parent
69eed12132
commit
c748c81a4a
3 changed files with 4 additions and 2 deletions
|
@ -20,7 +20,8 @@
|
|||
"files": {
|
||||
"includeFiles": "packfiles/pack1.txt",
|
||||
"mappings": {
|
||||
"newpath/": "packfiles/pack2.txt"
|
||||
"newpath/": "packfiles/pack2.txt",
|
||||
"anotherpath/": "packfiles/pack2.txt"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -150,7 +150,7 @@ namespace Microsoft.DotNet.ProjectModel.Files
|
|||
file.IsCustomTarget = true;
|
||||
|
||||
// Prefer named targets over default ones
|
||||
includeEntries.RemoveWhere(f => string.Equals(f.SourcePath, file.SourcePath));
|
||||
includeEntries.RemoveWhere(f => string.Equals(f.SourcePath, file.SourcePath) && f.IsCustomTarget == false);
|
||||
includeEntries.Add(file);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,6 +113,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
|
|||
var zip = ZipFile.Open(outputPackage, ZipArchiveMode.Read);
|
||||
zip.Entries.Should().Contain(e => e.FullName == "packfiles/pack1.txt");
|
||||
zip.Entries.Should().Contain(e => e.FullName == "newpath/pack2.txt");
|
||||
zip.Entries.Should().Contain(e => e.FullName == "anotherpath/pack2.txt");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
Loading…
Reference in a new issue