Skip to content

Commit e781670

Browse files
authored
Restore internal tools correctly in VisualStudio.InsertionManifests.targets (#14969)
1 parent 3749798 commit e781670

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
1212
<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">.NETFramework,Version=v4.7.2</TargetFrameworkMoniker>
1313
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
14+
15+
<!-- Internal tool restore settings -->
16+
<!-- VisualStudio.InsertionManifests.targets: Keep condition in sync with import in AfterSigning.proj. -->
17+
<RestoreInternalTooling Condition="'$(UsingToolVSSDK)' == 'true' and '$(MSBuildRuntimeType)' != 'Core'">true</RestoreInternalTooling>
18+
<RestoreInternalToolingAfterTargets Condition="'$(RestoreInternalTooling)' == 'true'">Restore</RestoreInternalToolingAfterTargets>
1419
</PropertyGroup>
1520

1621
<!--
@@ -79,7 +84,8 @@
7984
</Target>
8085

8186
<!-- Set as DependsOnTargets when internal tools (e.g. IBC data, optprof) is required -->
82-
<Target Name="RestoreInternalTooling">
87+
<Target Name="RestoreInternalTooling"
88+
AfterTargets="$(RestoreInternalToolingAfterTargets)">
8389
<MSBuild Projects="$(RepoRoot)eng/common/internal/Tools.csproj"
8490
Targets="Restore"
8591
Properties="@(_RestoreToolsProps);_NETCORE_ENGINEERING_TELEMETRY=Restore"

src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.InsertionManifests.targets

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,26 @@
2727
<Error Condition="'$(VisualStudioDropName)' == '' and '$(OfficialBuild)' == 'true'"
2828
Text="Property VisualStudioDropName must be specified in official build that produces Visual Studio insertion components." />
2929

30+
<PropertyGroup>
31+
<_SwixRestoredPackagePath>$(NuGetPackageRoot)microsoft.visualstudioeng.microbuild.plugins.swixbuild\$(MicrosoftVisualStudioEngMicroBuildPluginsSwixBuildVersion)\</_SwixRestoredPackagePath>
32+
<_ManifestToolRestoredPackagePath>$(NuGetPackageRoot)microsoft.manifesttool.crossplatform\$(MicrosoftManifestToolCrossPlatformVersion)\Content\Microsoft.ManifestTool.dll</_ManifestToolRestoredPackagePath>
33+
</PropertyGroup>
34+
35+
<Error Text="Internal tool not found: 'microsoft.visualstudioeng.microbuild.plugins.swixbuild'. Run restore on '$(RepositoryEngineeringDir)common\internal\Tools.csproj'."
36+
Condition="!Exists('$(_SwixRestoredPackagePath)')" />
37+
38+
<Error Text="Internal tool not found: 'microsoft.manifesttool.crossplatform'. Run restore on '$(RepositoryEngineeringDir)common\internal\Tools.csproj'."
39+
Condition="!Exists('$(_ManifestToolRestoredPackagePath)')" />
40+
3041
<ItemGroup>
3142
<_Args Include="OfficialBuild=$(OfficialBuild)" />
3243
<_Args Include="ComponentName=$(_ComponentName)"/>
3344
<_Args Include="SetupOutputPath=$(VisualStudioSetupInsertionPath)"/>
3445
<_Args Include="ComponentIntermediateOutputPath=$(VisualStudioSetupIntermediateOutputPath)$(_ComponentName)\"/>
35-
<_Args Include="SwixBuildPath=$(NuGetPackageRoot)microsoft.visualstudioeng.microbuild.plugins.swixbuild\$(MicrosoftVisualStudioEngMicroBuildPluginsSwixBuildVersion)\"/>
46+
<_Args Include="SwixBuildPath=$(_SwixRestoredPackagePath)" />
3647
<_Args Include="VisualStudioDropName=$(VisualStudioDropName)" />
3748
<_Args Include="DotNetTool=$(DotNetTool)" />
38-
<_Args Include="ManifestTool=$(NuGetPackageRoot)microsoft.manifesttool.crossplatform\$(MicrosoftManifestToolCrossPlatformVersion)\Content\Microsoft.ManifestTool.dll"/>
49+
<_Args Include="ManifestTool=$(_ManifestToolRestoredPackagePath) "/>
3950
<_Args Include="GenerateSbom=$(GenerateSbom)" />
4051
</ItemGroup>
4152

0 commit comments

Comments
 (0)