try/eng/AfterSolutionBuild.targets

28 строки
1.2 KiB
XML

<Project>
<!--
This file is a terrible hack.
The `dotnet-*.nupkg` packages are never rebuilt to have a stable version because that's handled manually. The fix
is to not allow it to be picked up by the repack targets by temporarily renaming it before the
`PackageReleasePackages` target and restoring it's name after.
-->
<ItemGroup>
<StableVersionPackages Include="$(ArtifactsShippingPackagesDir)\Microsoft.dotnet-*.nupkg" />
</ItemGroup>
<!-- Appends the extension `.renamed` to the dotnet-* packages to force the glob `*.nupkg` to not pick it up. -->
<Target Name="RenameDotNetTryOutputPackage" BeforeTargets="PackageReleasePackages" Condition="@(StableVersionPackages->Count()) &gt; 0">
<Move SourceFiles="%(StableVersionPackages.FullPath)" DestinationFiles="%(StableVersionPackages.FullPath).renamed" />
</Target>
<!-- Removes the `.renamed` extension from the dotnet-* packages. -->
<Target Name="RestoreDotNetTryOutputPackage" AfterTargets="PackageReleasePackages" Condition="@(StableVersionPackages->Count()) &gt; 0">
<Move SourceFiles="%(StableVersionPackages.FullPath).renamed" DestinationFiles="%(StableVersionPackages.FullPath)" />
</Target>
</Project>