Skip to content

Commit 630278d

Browse files
committed
Fix a really dumb defaulting error that was causing top-level tool packages to call Publish unecessarily
1 parent 21a361d commit 630278d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ NOTE: This file is imported from the following contexts, so be aware when writin
9292
<_ToolPackageShouldIncludeImplementation Condition="'$(_ToolPackageShouldIncludeImplementation)' == ''">false</_ToolPackageShouldIncludeImplementation>
9393

9494
<!-- inner builds and non-RID-specific outer builds need publish content-->
95-
<_PackToolPublishDependency Condition=" '$(_ToolPackageShouldIncludeImplementation)' != '' and '$(GeneratePackageOnBuild)' != 'true' and $(IsPublishable) == 'true' ">Publish</_PackToolPublishDependency>
95+
<_PackToolPublishDependency Condition=" $(_ToolPackageShouldIncludeImplementation) and '$(GeneratePackageOnBuild)' != 'true' and $(IsPublishable) == 'true' ">Publish</_PackToolPublishDependency>
9696
<!-- BUT builds that GeneratePackageOnBuild can't directly rely on Publish since Publish would trigger Build, causing an infinite loop. -->
9797
<!-- 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
9898
dependencies of the no-build Publish Target, _PublishNoBuildAlternative -->
99-
<_PackToolPublishDependency Condition=" '$(_ToolPackageShouldIncludeImplementation)' != '' and '$(GeneratePackageOnBuild)' == 'true' and $(IsPublishable) == 'true' ">$(_PublishNoBuildAlternativeDependsOn)</_PackToolPublishDependency>
99+
<_PackToolPublishDependency Condition=" $(_ToolPackageShouldIncludeImplementation) and '$(GeneratePackageOnBuild)' == 'true' and $(IsPublishable) == 'true' ">$(_PublishNoBuildAlternativeDependsOn)</_PackToolPublishDependency>
100+
<!-- No implementation required? Then don't call either target. -->
101+
<_PackToolPublishDependency Condition="!$(_ToolPackageShouldIncludeImplementation)"></_PackToolPublishDependency>
100102

101103
<!-- GenerateNuspec is called in two places: crossTargeting NuGet targets, and single-targeting NuGet targets.
102104
Tools need to ensure that

0 commit comments

Comments
 (0)