Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,17 @@
<None Include="$(RepoRoot)src\Tasks\Microsoft.NET.Build.Tasks\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets" Pack="true" Link="build/Microsoft.NET.ApiCompat.ValidatePackage.targets" PackagePath="build/%(Filename)%(Extension)" />
</ItemGroup>

<Target Name="_AddBuildOutputToPackageCore" DependsOnTargets="Publish">
<!-- Publish the task's .NET assets and include them in the package under the tools directory.

This runs during NuGet's pack walk (_WalkEachTargetPerFramework), which means that TargetFramework
is a global property. So we have to use an MSBuild task to build the Publish target with
TargetFramework removed, so that we don't have two different project builds, one with
TargetFramework set and one without. If we just tried to depend on the Publish target directly,
we would get two builds and they could encounter race conditions and file in use errors.
-->
<Target Name="_AddBuildOutputToPackageCore">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish" RemoveProperties="TargetFramework" />
<ItemGroup>
<!-- Publish .NET assets and include them in the package under tools directory. -->
<TfmSpecificPackageFile Include="$(PublishDir)**" PackagePath="tools/%(RecursiveDir)%(FileName)%(Extension)" />
</ItemGroup>
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@
<None Include="**\*.props;**\*.targets" Pack="true" PackagePath="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<Target Name="_AddBuildOutputToPackageCore" DependsOnTargets="Publish">
<!-- Publish the task's .NET assets and include them in the package under the tools directory.

This runs during NuGet's pack walk (_WalkEachTargetPerFramework), which means that TargetFramework
is a global property. So we have to use an MSBuild task to build the Publish target with
TargetFramework removed, so that we don't have two different project builds, one with
TargetFramework set and one without. If we just tried to depend on the Publish target directly,
we would get two builds and they could encounter race conditions and file in use errors.
-->
<Target Name="_AddBuildOutputToPackageCore">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish" RemoveProperties="TargetFramework" />
<ItemGroup>
<!-- Publish .NET assets and include them in the package under tools directory. -->
<TfmSpecificPackageFile Include="$(PublishDir)**" PackagePath="tools/%(RecursiveDir)%(FileName)%(Extension)" />
</ItemGroup>
</Target>
Expand Down
Loading