@@ -106,10 +106,12 @@ Copyright (c) .NET Foundation. All rights reserved.
106
106
<Target Name =" PackTool" DependsOnTargets =" SetPackToolProperties;GenerateToolsSettingsFileFromBuildProperty;PackToPublishDependencyIndirection;_PackToolValidation;PackToolImplementation" Condition =" '$(PackAsTool)' == 'true' " >
107
107
<ItemGroup >
108
108
<_GeneratedFiles Include =" $(_ToolsSettingsFilePath)" />
109
- <_PublishFilesRaw Condition =" '$(_ToolPackageShouldIncludeImplementation)' == 'true'" Include =" $(PublishDir)/**/*" />
110
- <_PublishFiles Condition =" '$(_ToolPackageShouldIncludeImplementation)' == 'true'" Include =" @(_PublishFilesRaw)" >
111
- <RelativePath >$([System.IO.Path]::GetRelativePath($(PublishDir), $([System.IO.Path]::GetDirectoryName(%(Identity)))))</RelativePath >
112
- </_PublishFiles >
109
+ <!-- Note here that we're _not_ computing relative directories inside the package anymore. In our packages, we essentially want to
110
+ recreate the publish layout, but under a TFM- or RID-specific root path. Because we're globbing from the PublishDir,
111
+ the MSBuild Items will have the RecursiveDir metadata - this is used by the PackLogic to combine with the PackagePath
112
+ we set below to ensure we have the correct layout in the end. If the PackLogic didn't try to use RecursiveDir, then
113
+ we could just explicitly set everything ourselves. -->
114
+ <_PublishFiles Condition =" '$(_ToolPackageShouldIncludeImplementation)' == 'true'" Include =" $(PublishDir)/**/*" />
113
115
</ItemGroup >
114
116
115
117
<PropertyGroup >
@@ -121,8 +123,11 @@ Copyright (c) .NET Foundation. All rights reserved.
121
123
<PackagePath >tools/$(_ToolPackShortTargetFrameworkName)/$(_ToolRidPath)/%(_GeneratedFiles.RecursiveDir)</PackagePath >
122
124
</TfmSpecificPackageFile >
123
125
126
+ <!-- This PackagePath is a little different - instead of mapping _exactly_ where we want the files to be dropped,
127
+ NuGet is looking at RecursiveDir/NuGetRecursiveDir metadata (which is set in the Pack targets as part of the
128
+ 'walk target per TFM' logic) _in addition_ to our package path. I don't see an easy way to remove RecursiveDir -->
124
129
<TfmSpecificPackageFile Include =" @(_PublishFiles)" >
125
- <PackagePath >tools/$(_ToolPackShortTargetFrameworkName)/$(_ToolRidPath)/%(_PublishFiles.RelativePath) </PackagePath >
130
+ <PackagePath >tools/$(_ToolPackShortTargetFrameworkName)/$(_ToolRidPath)/</PackagePath >
126
131
</TfmSpecificPackageFile >
127
132
</ItemGroup >
128
133
</Target >
0 commit comments