Skip to content

Commit 7d25694

Browse files
committed
Green up tests around GeneratePackageOnBuild
1 parent b68b27d commit 7d25694

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PackTool.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ Copyright (c) .NET Foundation. All rights reserved.
4949

5050
<!-- inner builds and non-RID-specific outer builds need publish content-->
5151
<_PackToolPublishDependency Condition=" '$(_ToolPackageShouldIncludeImplementation)' != '' and '$(GeneratePackageOnBuild)' != 'true' and $(IsPublishable) == 'true' ">Publish</_PackToolPublishDependency>
52+
<!-- BUT builds that GeneratePackageOnBuild can't directly rely on Publish since Publish would trigger Build, causing an infinite loop. -->
53+
<!-- To get around this, we try a bit of a workaround: since we can't set NoBuild=true and call Publish that way, we instead trigger all of the
54+
dependencies of the no-build Publish Target, _PublishNoBuildAlternative -->
55+
<_PackToolPublishDependency Condition=" '$(_ToolPackageShouldIncludeImplementation)' != '' and '$(GeneratePackageOnBuild)' == 'true' and $(IsPublishable) == 'true' ">$(_PublishNoBuildAlternativeDependsOn)</_PackToolPublishDependency>
5256

5357
<!-- Trigger RID-specific inner builds if RID-specific mode is enabled-->
5458
<GenerateNuspecDependsOn Condition=" '$(_HasRIDSpecificTools)' == 'true' and '$(PublishAot)' != 'true' ">$(GenerateNuspecDependsOn);_CreateRIDSpecificToolPackages</GenerateNuspecDependsOn>

0 commit comments

Comments
 (0)