Skip to content

Conversation

@directhex
Copy link

When using this pattern in a pkgproj:

    <File Include="in\**" TargetPath="out\%(RecursiveDir)%(Filename)%(Extension)" />

This installs, say, in\a\b\c.txt to a directory in the nupkg of out\a\b\c.txt

HOWEVER

If a file has no extension (i.e. in\a\b\c) then %(Extension) EXPANDS TO \c SO IT INSTALLS TO out\a\b\c\c

This is an adverse reaction to an intentional behaviour in Microsoft.DotNet.Build.Tasks.Packaging, work around it by only ever using TargetPath to emit to a directory, not a file.

Also fix a few errors in Wasm SDK packaging spotted at the same time.

ref https://github.com/dotnet/arcade/blob/main/src/Microsoft.DotNet.Build.Tasks.Packaging/src/build/Packaging.targets#L458-L464

directhex added a commit to directhex/icu that referenced this pull request Mar 17, 2023
@directhex directhex enabled auto-merge (squash) March 17, 2023 15:54
akoeplinger pushed a commit to dotnet/icu that referenced this pull request Mar 17, 2023
Never use `%(RecursiveDir)%(Filename)%(Extension)` with Microsoft.DotNet.Build.Tasks.Packaging, as it may turn extensionless files into double-nested files (e.g. `a/b/c` -> `a/b/c/c` but `a/b/c.txt` will remain `a/b/c.txt`)
@directhex directhex merged commit bbeb9e6 into dotnet:dotnet/main Mar 17, 2023
steveisok pushed a commit to steveisok/icu that referenced this pull request May 25, 2023
Never use `%(RecursiveDir)%(Filename)%(Extension)` with Microsoft.DotNet.Build.Tasks.Packaging, as it may turn extensionless files into double-nested files (e.g. `a/b/c` -> `a/b/c/c` but `a/b/c.txt` will remain `a/b/c.txt`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants