Skip to content

Commit 2e7615d

Browse files
authored
Better structure VMR join points for resolvers (#44428)
1 parent f0ec485 commit 2e7615d

File tree

12 files changed

+96
-248
lines changed

12 files changed

+96
-248
lines changed

source-build.slnf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"src\\Microsoft.Win32.Msi\\Microsoft.Win32.Msi.csproj",
3333
"src\\RazorSdk\\Tasks\\Microsoft.NET.Sdk.Razor.Tasks.csproj",
3434
"src\\RazorSdk\\Tool\\Microsoft.NET.Sdk.Razor.Tool.csproj",
35-
"src\\Resolvers\\Microsoft.DotNet.MSBuildSdkResolver\\Microsoft.DotNet.MSBuildSdkResolver.csproj",
3635
"src\\Resolvers\\Microsoft.DotNet.NativeWrapper\\Microsoft.DotNet.NativeWrapper.csproj",
3736
"src\\Resolvers\\Microsoft.DotNet.SdkResolver\\Microsoft.DotNet.SdkResolver.csproj",
3837
"src\\Resolvers\\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver\\Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.csproj",

src/Installer/redist-installer/projects/VSMSBuildExtensions/VSMSBuildExtensions.csproj

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
<Project Sdk="Microsoft.Build.NoTargets">
22

33
<PropertyGroup>
4-
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
4+
<TargetFramework>net472</TargetFramework>
55
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
6-
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
7-
<!-- For product build, this project only builds in the second build pass as it depends on assets other
6+
<!-- For product build, this project only builds in the second build pass as it depends on assets from other
87
verticals that are built in the first build pass. -->
98
<ExcludeFromDotNetBuild Condition="'$(DotNetBuildPass)' != '2'">true</ExcludeFromDotNetBuild>
10-
<!-- For product build, this only builds in the second build pass as it depends on assets
11-
from other verticals that are built in the first build pass. -->
129
<IsPackable Condition="'$(OS)' == 'Windows_NT' and
1310
'$(Architecture)' == 'x64' and
14-
'$(PgoInstrument)' != 'true' and
15-
'$(PackInstaller)' != 'false' and
16-
('$(DotNetBuild)' != 'true' or '$(DotNetBuildPass)' == '2')">true</IsPackable>
17-
<BeforePack>$(BeforePack);GenerateMSBuildExtensionsLayout</BeforePack>
18-
<PackageDescription>MSBuild extensions bundled with .NET Core SDK for internal Visual Studio build consumption</PackageDescription>
11+
'$(PgoInstrument)' != 'true'">true</IsPackable>
12+
<BeforePack>$(BeforePack);GenerateLayout</BeforePack>
1913
<PackageId>VS.Redist.Common.Net.Core.SDK.MSBuildExtensions</PackageId>
14+
<PackageDescription>MSBuild extensions bundled with .NET Core SDK for internal Visual Studio build consumption</PackageDescription>
2015
<NoWarn>$(NoWarn);NU5100;NU5109;NU5123</NoWarn>
2116
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
2217
<IsShippingPackage>false</IsShippingPackage>
@@ -26,22 +21,13 @@
2621
<PackageDownload Include="NETStandard.Library.NETFramework" Version="[$(NETStandardLibraryNETFrameworkVersion)]" />
2722

2823
<ProjectReference Include="$(RepoRoot)src\Tasks\Microsoft.NET.Build.Extensions.Tasks\Microsoft.NET.Build.Extensions.Tasks.csproj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" />
29-
</ItemGroup>
30-
31-
<!-- SdkResolver -->
32-
<ItemGroup>
33-
<PackageDownload Include="Microsoft.Deployment.DotNet.Releases" Version="[$(MicrosoftDeploymentDotNetReleasesToolsetPackageVersion)]" />
34-
<PackageDownload Include="Microsoft.NETCore.App.Runtime.win-x86" Version="[$(MicrosoftNETCoreAppRuntimePackageVersion)]" />
35-
<PackageDownload Include="Microsoft.NETCore.App.Runtime.win-x64" Version="[$(MicrosoftNETCoreAppRuntimePackageVersion)]" />
36-
<PackageDownload Include="Microsoft.NETCore.App.Runtime.win-arm64" Version="[$(MicrosoftNETCoreAppRuntimePackageVersion)]" />
37-
3824
<ProjectReference Include="$(RepoRoot)src\Resolvers\Microsoft.DotNet.MSBuildSdkResolver\Microsoft.DotNet.MSBuildSdkResolver.csproj" ReferenceOutputAssembly="false" />
3925
</ItemGroup>
4026

4127
<!-- Shared infra to build and use the BuildCoreSdkTasks -->
4228
<Import Project="..\..\targets\BuildCoreSdkTasks.targets" />
4329

44-
<Target Name="GenerateMSBuildExtensionsLayout" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="BuildCoreSdkTasks;ResolveProjectReferences">
30+
<Target Name="GenerateLayout" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="BuildCoreSdkTasks;ResolveProjectReferences">
4531
<PropertyGroup>
4632
<MSBuildExtensionsOutputPath>$(ArtifactsBinDir)$(Configuration)\Sdks\Microsoft.NET.Build.Extensions</MSBuildExtensionsOutputPath>
4733
<SdkMSBuildExtensionsSwrFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr</SdkMSBuildExtensionsSwrFile>
@@ -65,10 +51,10 @@
6551
DeploymentSubpath="msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/" />
6652

6753
<!-- SdkResolver -->
68-
<VSMSBuildExtensionsContent Include="$(NuGetPackageRoot)microsoft.deployment.dotNet.releases\$(MicrosoftDeploymentDotNetReleasesToolsetPackageVersion)\lib\netstandard2.0\**\*.*" DeploymentSubpath="MSBuildSdkResolver/" />
69-
<VSMSBuildExtensionsContent Include="$(NuGetPackageRoot)microsoft.netcore.app.runtime.win-x86\$(MicrosoftNETCoreAppRuntimePackageVersion)\runtimes\win-x86\native\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/x86/" />
70-
<VSMSBuildExtensionsContent Include="$(NuGetPackageRoot)microsoft.netcore.app.runtime.win-x64\$(MicrosoftNETCoreAppRuntimePackageVersion)\runtimes\win-x64\native\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/x64/" />
71-
<VSMSBuildExtensionsContent Include="$(NuGetPackageRoot)microsoft.netcore.app.runtime.win-arm64\$(MicrosoftNETCoreAppRuntimePackageVersion)\runtimes\win-arm64\native\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/arm64/" />
54+
<VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\x86\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/x86/" />
55+
<VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\x64\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/x64/" />
56+
<VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\arm64\hostfxr.dll" DeploymentSubpath="MSBuildSdkResolver/arm64/" />
57+
<VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\**\Microsoft.Deployment.DotNet.Releases*.dll" DeploymentSubpath="MSBuildSdkResolver/" />
7258
<VSMSBuildExtensionsContent Include="$(ArtifactsBinDir)Microsoft.DotNet.MSBuildSdkResolver\$(Configuration)\net472\**\Microsoft.DotNet.MSBuildSdkResolver*.dll" DeploymentSubpath="MSBuildSdkResolver/" />
7359

7460
<VSMSBuildExtensionsContent Update="@(VSMSBuildExtensionsContent)">
@@ -80,7 +66,6 @@
8066

8167
<GenerateMSBuildExtensionsSWR MSBuildExtensionsLayoutDirectory="$(OutputPath)"
8268
OutputFile="$(SdkMSBuildExtensionsSwrFile)" />
83-
8469
<ItemGroup>
8570
<!-- Include the swr file in the nuget package for VS authoring -->
8671
<Content Include="$(SdkMSBuildExtensionsSwrFile)" PackagePath="/" />

src/Installer/redist-installer/projects/VSTemplateLocator/VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.nuspec

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 23 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,43 @@
11
<Project Sdk="Microsoft.Build.NoTargets">
22

33
<PropertyGroup>
4-
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
4+
<TargetFramework>net472</TargetFramework>
55
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
6-
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
7-
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
8-
<!-- For product build, this project only builds in the second build pass as it depends on assets other
6+
<!-- For product build, this project only builds in the second build pass as it depends on assets from other
97
verticals that are built in the first build pass. -->
108
<ExcludeFromDotNetBuild Condition="'$(DotNetBuildPass)' != '2'">true</ExcludeFromDotNetBuild>
9+
<IsPackable Condition="'$(OS)' == 'Windows_NT' and
10+
'$(Architecture)' == 'x64' and
11+
'$(PgoInstrument)' != 'true'">true</IsPackable>
12+
<BeforePack>$(BeforePack);GenerateLayout</BeforePack>
13+
<PackageId>VS.Redist.Common.Net.Core.SDK.VSTemplateLocator</PackageId>
14+
<PackageDescription>MSBuild extensions bundled with .NET Core SDK for internal Visual Studio build consumption</PackageDescription>
15+
<NoWarn>$(NoWarn);NU5100;NU5109;NU5123</NoWarn>
16+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
17+
<IsShippingPackage>false</IsShippingPackage>
1118
</PropertyGroup>
1219

1320
<ItemGroup>
14-
<PackageReference Include="Microsoft.NETCore.App.Runtime.win-x86" ExcludeAssets="all" GeneratePathProperty="true" />
15-
<PackageReference Include="Microsoft.NETCore.App.Runtime.win-x64" ExcludeAssets="all" GeneratePathProperty="true" />
16-
<PackageReference Include="Microsoft.NETCore.App.Runtime.win-arm64" ExcludeAssets="all" GeneratePathProperty="true" />
1721
<PackageReference Include="Microsoft.Deployment.DotNet.Releases" ExcludeAssets="all" GeneratePathProperty="true" />
18-
</ItemGroup>
19-
20-
<ItemGroup>
2122
<ProjectReference Include="$(RepoRoot)src\Microsoft.DotNet.TemplateLocator\Microsoft.DotNet.TemplateLocator.csproj" ReferenceOutputAssembly="false" />
2223
</ItemGroup>
2324

24-
<Target Name="GenerateLayout">
25-
<!-- Set these here early enough for inputs & outputs in the GenerateVSTemplateLocatorNupkg target. -->
26-
<PropertyGroup>
27-
<VSTemplateLocatorNuspecFile>$(MSBuildThisFileDirectory)VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.nuspec</VSTemplateLocatorNuspecFile>
28-
<VSTemplateLocatorNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.$(FullNugetVersion).nupkg</VSTemplateLocatorNupkgFile>
29-
<GenerateNupkgPowershellScript>$(MSBuildThisFileDirectory)../../packaging/windows/generatenupkg.ps1</GenerateNupkgPowershellScript>
30-
</PropertyGroup>
31-
32-
<RemoveDir Directories="$(OutputPath)" />
33-
<MakeDir Directories="$(OutputPath)" />
34-
25+
<Target Name="GenerateLayout" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="ResolveProjectReferences">
3526
<ItemGroup>
36-
<_VSTemplateLocatorSrc Include="$(PkgMicrosoft_NETCore_App_Runtime_win-x86)\runtimes\win-x86\native\hostfxr.dll" Arch="x86\" />
37-
<_VSTemplateLocatorSrc Include="$(PkgMicrosoft_NETCore_App_Runtime_win-x64)\runtimes\win-x64\native\hostfxr.dll" Arch="x64\" />
38-
<_VSTemplateLocatorSrc Include="$(PkgMicrosoft_NETCore_App_Runtime_win-arm64)\runtimes\win-arm64\native\hostfxr.dll" Arch="arm64\" />
39-
<_VSTemplateLocatorSrc Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\Microsoft.DotNet.NativeWrapper.dll" Arch="" />
40-
<_VSTemplateLocatorSrc Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\Microsoft.DotNet.SdkResolver.dll" Arch="" />
41-
<_VSTemplateLocatorSrc Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\**\Microsoft.DotNet.TemplateLocator*.dll" Arch="" />
42-
<_VSTemplateLocatorSrc Include="$(PkgMicrosoft_Deployment_DotNet_Releases)\lib\net452\**\*.dll" Arch="" />
43-
<_VSTemplateLocatorDst Include="@(_VSTemplateLocatorSrc->'$(OutputPath)VSTemplateLocator\%(Arch)%(RecursiveDir)%(Filename)%(Extension)')" />
44-
</ItemGroup>
27+
<VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\x86\hostfxr.dll" Arch="x86/" />
28+
<VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\x64\hostfxr.dll" Arch="x64/" />
29+
<VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\arm64\hostfxr.dll" Arch="arm64/" />
4530

46-
<Copy SourceFiles="@(_VSTemplateLocatorSrc)" DestinationFiles="@(_VSTemplateLocatorDst)" />
31+
<VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\Microsoft.DotNet.NativeWrapper.dll" Arch="" />
32+
<VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\Microsoft.DotNet.SdkResolver.dll" Arch="" />
33+
<VSTemplateLocatorContent Include="$(ArtifactsBinDir)Microsoft.DotNet.TemplateLocator\$(Configuration)\net472\**\Microsoft.DotNet.TemplateLocator*.dll" Arch="" />
4734

48-
<Message Importance="High" Text="$(MSBuildProjectName) -&gt; $(OutputPath)" />
49-
</Target>
35+
<VSTemplateLocatorContent Include="$(PkgMicrosoft_Deployment_DotNet_Releases)\lib\net452\**\*.dll" Arch="" />
36+
</ItemGroup>
5037

51-
<!-- For product build, this only builds in the second build pass as it depends on assets
52-
from other verticals that are built in the first build pass. -->
53-
<Target Name="GenerateVSTemplateLocatorNupkg"
54-
DependsOnTargets="GenerateLayout"
55-
Condition="'$(OS)' == 'Windows_NT' and
56-
'$(Architecture)' == 'x64' and
57-
'$(PgoInstrument)' != 'true' and
58-
('$(DotNetBuild)' != 'true' or '$(DotNetBuildPass)' == '2') and
59-
'$(_SuppressAllTargets)' != 'true'"
60-
Inputs="$(OutputPath)/**/*;
61-
$(VSTemplateLocatorNuspecFile);
62-
$(GenerateNupkgPowershellScript)"
63-
Outputs="$(VSTemplateLocatorNupkgFile)"
64-
AfterTargets="Build">
65-
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
66-
'$(ArtifactsDir)' ^
67-
'$(OutputPath.TrimEnd('\'))' ^
68-
'$(FullNugetVersion)' ^
69-
'$(VSTemplateLocatorNuspecFile)' ^
70-
'$(VSTemplateLocatorNupkgFile)'" />
38+
<ItemGroup>
39+
<Content Include="@(VSTemplateLocatorContent)" PackagePath="/VSTemplateLocator/%(Arch)%(RecursiveDir)%(Filename)%(Extension)" />
40+
</ItemGroup>
7141
</Target>
7242

7343
</Project>

src/Installer/redist-installer/targets/SetBuildDefaults.targets

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,6 @@
1515
<UsePortableLinuxSharedFramework Condition=" '$(UsePortableLinuxSharedFramework)' == '' AND '$(IsLinux)' == 'True' AND '$(Rid)' != 'rhel.6-x64' AND !$(Rid.StartsWith('linux-musl')) ">true</UsePortableLinuxSharedFramework>
1616
<HighEntropyVA>true</HighEntropyVA>
1717

18-
<!-- Only use asset target fallback that we set (not implicit one to net461). -->
19-
<!--<DisableImplicitAssetTargetFallback>true</DisableImplicitAssetTargetFallback>-->
20-
21-
<!-- NU1701: Disable asset target fallback warning globally since it does not work transitively on NoWarn of individual packages -->
22-
<!-- Since we disabled the implicit fallback to net461, this will only kick in when we have an explicit fallback and we don't need to be warned about it doing what we asked it to do. -->
23-
<!-- NU5104: Disable 'A stable release of a package should not have a prerelease dependency' warning globally -->
24-
<!-- The "pack" command under 'buildCrossTargeting' for 'Microsoft.DotNet.MSBuildSdkResolver' throws a "NU5104" warning/error while using a "2.1.300" stage0 SDK. For: Linux-x64, Linux-arm, and Linux-arm64 -->
25-
<!--<NoWarn>NU1701;NU5104</NoWarn>-->
26-
27-
<!--<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
28-
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
29-
30-
<IncludeWpfAndWinForms Condition=" '$(IncludeWpfAndWinForms)' == '' AND '$(OS)' == 'Windows_NT' ">true</IncludeWpfAndWinForms>
31-
<IncludeWpfAndWinForms Condition=" '$(IncludeWpfAndWinForms)' == '' ">false</IncludeWpfAndWinForms>-->
32-
3318
<PathListSeparator>:</PathListSeparator>
3419
<PathListSeparator Condition=" '$(OS)' == 'Windows_NT' ">%3b</PathListSeparator>
3520
</PropertyGroup>

src/Microsoft.DotNet.TemplateLocator/Microsoft.DotNet.TemplateLocator.csproj

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,17 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>$(ResolverTargetFramework);net472</TargetFrameworks>
5-
<TargetFrameworks Condition=" '$([MSBuild]::IsOSPlatform(`Windows`))' == 'false' ">$(ResolverTargetFramework)</TargetFrameworks>
6-
<PlatformTarget>AnyCPU</PlatformTarget>
7-
<RuntimeIdentifiers Condition="$([MSBuild]::IsOSPlatform(`Windows`))">win-x86;win-x64</RuntimeIdentifiers>
8-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
5+
<!-- For product build, the .NET Framework TFM only builds in the second build pass as it depends on assets from other
6+
verticals that are built in the first build pass. -->
7+
<TargetFrameworks Condition="'$(DotNetBuild)' == 'true' and '$(DotNetBuildPass)' != '2'">$(ResolverTargetFramework)</TargetFrameworks>
98
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
10-
<IsPackable>true</IsPackable>
119
<!-- Create FileDefinitions items for ResolveHostfxrCopyLocalContent target -->
1210
<EmitLegacyAssetsFileItems>true</EmitLegacyAssetsFileItems>
13-
<PackageId>microsoft.dotnet.templateLocator</PackageId>
14-
<Nullable>Enable</Nullable>
15-
11+
<Nullable>enable</Nullable>
1612
<!-- https://github.com/dotnet/sdk/issues/14801 -->
17-
<AssemblyVersion Condition="'$(TargetFramework)'=='net472'">5.0.100.0</AssemblyVersion>
18-
19-
<!--https://github.com/NuGet/Home/issues/3891#issuecomment-377319939-->
20-
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
13+
<AssemblyVersion Condition="'$(TargetFramework)' == 'net472'">5.0.100.0</AssemblyVersion>
2114
</PropertyGroup>
2215

23-
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences">
24-
<ItemGroup>
25-
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
26-
</ItemGroup>
27-
</Target>
28-
2916
<Target Name="LinkVSEmbeddableAssemblies" DependsOnTargets="ResolveReferences" AfterTargets="ResolveReferences">
3017
<ItemGroup>
3118
<ReferencePath Condition="'%(ReferencePath.FileName)' == 'Microsoft.VisualStudio.Setup.Configuration.Interop'">
@@ -61,4 +48,5 @@
6148
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
6249
<PackageReference Include="System.Text.Json" VersionOverride="$(SystemTextJsonToolsetPackageVersion)" />
6350
</ItemGroup>
51+
6452
</Project>

0 commit comments

Comments
 (0)