You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PackTool.targets
+21-15Lines changed: 21 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -41,27 +41,30 @@ NOTE: This file is imported from the following contexts, so be aware when writin
41
41
<!-- tools are specially-formatted packages, so we tell nuget Pack to not even try to include build output -->
42
42
<IncludeBuildOutput>false</IncludeBuildOutput>
43
43
44
+
<_IsRidSpecific>false</_IsRidSpecific>
45
+
<_IsRidSpecificCondition="'$(RuntimeIdentifier)' != '' and '$(RuntimeIdentifier)' != 'any'">true</_IsRidSpecific>
46
+
44
47
<!-- the publish* properties _can_ be set, but only for the 'inner' RID-specific builds. We need to make sure that for the outer, agnostic build they are unset -->
45
48
<!-- RID information is also stripped during Restore, so we need to make sure user
46
49
decisions are preserved when Restoring, so that publishing-related packages are implicitly included. -->
47
-
<PublishSelfContainedCondition="'$(RuntimeIdentifier)' == '' and '$(MSBuildIsRestoring)' != 'true'">false</PublishSelfContained>
50
+
<PublishSelfContainedCondition="!$(_IsRidSpecific) and '$(MSBuildIsRestoring)' != 'true'">false</PublishSelfContained>
48
51
<!-- Have to set SelfContained similarly because PackTool targets are imported _after_ RuntimeIdentifierInference targets, where the Publish* properties are
49
52
forwarded to the 'base' properties. -->
50
-
<SelfContainedCondition="'$(RuntimeIdentifier)' == '' and '$(MSBuildIsRestoring)' != 'true'">false</SelfContained>
51
-
<PublishTrimmedCondition="'$(RuntimeIdentifier)' == '' and '$(MSBuildIsRestoring)' != 'true'">false</PublishTrimmed>
52
-
<PublishReadyToRunCondition="'$(RuntimeIdentifier)' == '' and '$(MSBuildIsRestoring)' != 'true'">false</PublishReadyToRun>
53
-
<PublishSingleFileCondition="'$(RuntimeIdentifier)' == '' and '$(MSBuildIsRestoring)' != 'true'">false</PublishSingleFile>
53
+
<SelfContainedCondition="!$(_IsRidSpecific) and '$(MSBuildIsRestoring)' != 'true'">false</SelfContained>
54
+
<PublishTrimmedCondition="!$(_IsRidSpecific) and '$(MSBuildIsRestoring)' != 'true'">false</PublishTrimmed>
55
+
<PublishReadyToRunCondition="!$(_IsRidSpecific) and '$(MSBuildIsRestoring)' != 'true'">false</PublishReadyToRun>
56
+
<PublishSingleFileCondition="!$(_IsRidSpecific) and '$(MSBuildIsRestoring)' != 'true'">false</PublishSingleFile>
54
57
55
58
<!-- We need to know if the inner builds are _intended_ to be AOT even if we then explicitly disable AOT for the outer builds.
56
59
Knowing this lets us correctly decide to create the RID-specific inner tools or not when packaging the outer tool. -->
@@ -385,14 +388,17 @@ NOTE: This file is imported from the following contexts, so be aware when writin
385
388
386
389
<!-- Orchestrator for making the N RID-specific tool packages if this Tool supports that mode.
387
390
We can't call this for AOT'd tools because we can't AOT cross-architecture and cross-platform in .NET today. -->
388
-
<TargetName="_CreateRIDSpecificToolPackages"Condition="'$(RuntimeIdentifier)' == '' and $(_HasRIDSpecificTools) and !$(_InnerToolsPublishAot) and !$(_ToolPackageShouldIncludeImplementation)">
packages.Length.Should().Be(expectedRids.Length+1+1,"There should be one package for the tool-wrapper, one for the top-level manifest, and one for each RID");
anyRidPackage.Should().NotBeNull($"Package {packageIdentifier}.any.{toolSettings.ToolPackageVersion}.nupkg should be present in the tool packages directory")
253
+
.And.Satisfy<string>(EnsurePackageIsFdd);
254
+
255
+
// top-level package should declare all of the rids
0 commit comments