Skip to content

Commit ad7e8bd

Browse files
authored
Extract RuntimeAnalyzers infra from redist (#47499)
1 parent 7b29d7e commit ad7e8bd

File tree

7 files changed

+58
-77
lines changed

7 files changed

+58
-77
lines changed

Diff for: sdk.sln

+7
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.NetCore.Sd
529529
EndProject
530530
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.NetCore.Toolset", "src\Layout\VS.Redist.Common.NetCore.Toolset\VS.Redist.Common.NetCore.Toolset.proj", "{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0}"
531531
EndProject
532+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers", "src\Layout\VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers\VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.proj", "{C5C4F9CA-25B8-2B20-826D-EA93F667C316}"
533+
EndProject
532534
Global
533535
GlobalSection(SolutionConfigurationPlatforms) = preSolution
534536
Debug|Any CPU = Debug|Any CPU
@@ -1011,6 +1013,10 @@ Global
10111013
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
10121014
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
10131015
{93A4A3DA-9D0F-FAEA-5AD7-A34650D326D0}.Release|Any CPU.Build.0 = Release|Any CPU
1016+
{C5C4F9CA-25B8-2B20-826D-EA93F667C316}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1017+
{C5C4F9CA-25B8-2B20-826D-EA93F667C316}.Debug|Any CPU.Build.0 = Debug|Any CPU
1018+
{C5C4F9CA-25B8-2B20-826D-EA93F667C316}.Release|Any CPU.ActiveCfg = Release|Any CPU
1019+
{C5C4F9CA-25B8-2B20-826D-EA93F667C316}.Release|Any CPU.Build.0 = Release|Any CPU
10141020
EndGlobalSection
10151021
GlobalSection(SolutionProperties) = preSolution
10161022
HideSolutionNode = FALSE
@@ -1184,6 +1190,7 @@ Global
11841190
{FA579C03-2EB4-4D47-88EE-BFF339E96FAF} = {22AB674F-ED91-4FBC-BFEE-8A1E82F9F05E}
11851191
{1F0B4B3C-DC88-4740-B04F-1707102E9930} = {580D1AE7-AA8F-4912-8B76-105594E00B3B}
11861192
{D9617F63-15F4-4CA2-8ECF-728A94B45D82} = {3FA6F1CB-295B-4414-B18F-93845917A8CD}
1193+
{C5C4F9CA-25B8-2B20-826D-EA93F667C316} = {71C279BD-E850-4A8D-9775-11CA26B8E5BA}
11871194
{8D6A9984-118D-4415-A8FA-AB1F26CF5C44} = {3FA6F1CB-295B-4414-B18F-93845917A8CD}
11881195
{418B10BD-CA42-49F3-8F4A-D8CC90C8A17D} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
11891196
{2FF79F82-60C1-349A-4726-7783D5A6D5DF} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}

Diff for: src/Installer/redist-installer/packaging/windows/VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.nuspec

-17
This file was deleted.

Diff for: src/Installer/redist-installer/targets/GenerateMSIs.targets

+1-28
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
GenerateSdkMsi;
99
GenerateSdkBundle;
1010
GenerateSdkPlaceholderMsi;
11-
GenerateTemplatesNupkgs;
12-
GenerateRuntimeAnalyzersNupkg
11+
GenerateTemplatesNupkgs
1312
</GenerateMsisDependsOn>
1413
<GenerateMsisDependsOn Condition="'$(GenerateSdkBundleOnly)' == 'true'">GenerateSdkBundle</GenerateMsisDependsOn>
1514

@@ -44,11 +43,6 @@
4443

4544
<FinalizerExe>$(ArtifactsBinDir)finalizer/$(Architecture)/$(Configuration)/bin/finalizer.exe</FinalizerExe>
4645

47-
<RuntimeAnalyzersLayoutDirectory>$(ArtifactsBinDir)$(Configuration)\RuntimeAnalyzers</RuntimeAnalyzersLayoutDirectory>
48-
<SdkRuntimeAnalyzersNuspecFile>$(SdkPkgSourcesRootDirectory)/VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.nuspec</SdkRuntimeAnalyzersNuspecFile>
49-
<SdkRuntimeAnalyzersNupkgFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.$(FullNugetVersion).nupkg</SdkRuntimeAnalyzersNupkgFile>
50-
<SdkRuntimeAnalyzersSwrFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.swr</SdkRuntimeAnalyzersSwrFile>
51-
5246
<!-- Temp directory for light command layouts -->
5347
<LightCommandObjDir>$(ArtifactsObjDir)LightCommandPackages</LightCommandObjDir>
5448
<!-- Directory for the zipped up light command package -->
@@ -393,27 +387,6 @@
393387
</ItemGroup>
394388
</Target>
395389

396-
<Target Name="GenerateRuntimeAnalyzersNupkg"
397-
DependsOnTargets="GenerateLayout;MsiTargetsSetupInputOutputs"
398-
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' And '$(DotNetBuild)' != 'true'"
399-
Inputs="$(RuntimeAnalyzersLayoutDirectory)/**/*;
400-
$(SdkRuntimeAnalyzersNuspecFile);
401-
$(GenerateNupkgPowershellScript)"
402-
Outputs="$(SdkRuntimeAnalyzersNupkgFile);$(SdkRuntimeAnalyzersSwrFile)">
403-
<GenerateRuntimeAnalyzersSWR RuntimeAnalyzersLayoutDirectory="$(RuntimeAnalyzersLayoutDirectory)"
404-
OutputFile="$(SdkRuntimeAnalyzersSwrFile)" />
405-
406-
<!-- Include the swr file in the nuget package for VS authoring -->
407-
<Copy SourceFiles="$(SdkRuntimeAnalyzersSwrFile)" DestinationFolder="$(RuntimeAnalyzersLayoutDirectory)" />
408-
409-
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
410-
'$(ArtifactsDir)' ^
411-
'$(RuntimeAnalyzersLayoutDirectory.TrimEnd('\'))' ^
412-
'$(FullNugetVersion)' ^
413-
'$(SdkRuntimeAnalyzersNuspecFile)' ^
414-
'$(SdkRuntimeAnalyzersNupkgFile)'" />
415-
</Target>
416-
417390
<Target Name="GenerateMsis"
418391
AfterTargets="Build"
419392
DependsOnTargets="$(GenerateMsisDependsOn)" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net472</TargetFramework>
5+
<IsPackable Condition="'$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64' and '$(PgoInstrument)' != 'true'">true</IsPackable>
6+
<BeforePack>$(BeforePack);GenerateLayout</BeforePack>
7+
<PackageDescription>Analyzers and generators from the runtime and SDK for VS insertion</PackageDescription>
8+
<NoWarn>$(NoWarn);NU5100;NU5109;NU5123</NoWarn>
9+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
10+
<IsShippingPackage>false</IsShippingPackage>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="$(RepoRoot)src\Microsoft.Net.Sdk.AnalyzerRedirecting\Microsoft.Net.Sdk.AnalyzerRedirecting.csproj" />
15+
<ProjectReference Include="$(RepoRoot)src\Installer\redist-installer\redist-installer.proj" />
16+
</ItemGroup>
17+
18+
<!-- Shared infra to build and use the sdk-tasks -->
19+
<Import Project="$(RepoRoot)src\Tasks\sdk-tasks\sdk-tasks.InTree.targets" />
20+
21+
<Target Name="GenerateLayout" Condition="'$(IsPackable)' == 'true'" DependsOnTargets="ResolveProjectReferences">
22+
<PropertyGroup>
23+
<SdkRuntimeAnalyzersSwrFile>$(ArtifactsNonShippingPackagesDir)VS.Redist.Common.Net.Core.SDK.RuntimeAnalyzers.swr</SdkRuntimeAnalyzersSwrFile>
24+
<RuntimeAnalyzersSourceRoot>$(ArtifactsBinDir)redist-installer\$(Configuration)\dotnet\</RuntimeAnalyzersSourceRoot>
25+
</PropertyGroup>
26+
27+
<ItemGroup>
28+
<RuntimeAnalyzersContent Include="$(ArtifactsBinDir)Microsoft.Net.Sdk.AnalyzerRedirecting\$(Configuration)\net472\**\*.*" DeploymentSubpath="AnalyzerRedirecting" />
29+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)packs\Microsoft.NetCore.App.Ref\*\analyzers\**\*.*" DeploymentSubpath="NetCoreAnalyzers" />
30+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)packs\Microsoft.WindowsDesktop.App.Ref\*\analyzers\**\*.*" DeploymentSubpath="WindowsDesktopAnalyzers" />
31+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)packs\Microsoft.AspNetCore.App.Ref\*\analyzers\**\*.*" DeploymentSubpath="AspNetCoreAnalyzers" />
32+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)sdk\*\Sdks\Microsoft.NET.Sdk\analyzers\**\*.*" DeploymentSubpath="SDKAnalyzers" />
33+
<RuntimeAnalyzersContent Include="$(RuntimeAnalyzersSourceRoot)sdk\*\Sdks\Microsoft.NET.Sdk.Web\analyzers\**\*.*" DeploymentSubpath="WebSDKAnalyzers" />
34+
</ItemGroup>
35+
36+
<Copy SourceFiles="@(RuntimeAnalyzersContent)"
37+
DestinationFiles="@(RuntimeAnalyzersContent->'$(OutputPath)\%(DeploymentSubpath)\%(RecursiveDir)%(Filename)%(Extension)')"
38+
UseHardlinksIfPossible="true" />
39+
40+
<GenerateRuntimeAnalyzersSWR RuntimeAnalyzersLayoutDirectory="$(OutputPath)"
41+
OutputFile="$(SdkRuntimeAnalyzersSwrFile)" />
42+
43+
<ItemGroup>
44+
<!-- Include the swr file in the nuget package for VS authoring -->
45+
<Content Include="$(SdkRuntimeAnalyzersSwrFile)" PackagePath="/" />
46+
<Content Include="@(RuntimeAnalyzersContent)" PackagePath="/%(RuntimeAnalyzersContent.DeploymentSubpath)/%(RecursiveDir)%(Filename)%(Extension)" />
47+
</ItemGroup>
48+
</Target>
49+
50+
</Project>

Diff for: src/Layout/redist/redist.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<Import Project="targets\PublishDotnetWatch.targets" />
2424
<Import Project="targets\GenerateLayout.targets" />
2525
<Import Project="targets\OverlaySdkOnLKG.targets" Condition="'$(DotNetBuild)' != 'true'" />
26-
<Import Project="targets\RuntimeAnalyzers.targets" />
2726

2827
<ItemGroup>
2928
<PackageReference Include="NuGet.Build.Tasks" />

Diff for: src/Layout/redist/targets/GenerateLayout.targets

-7
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,6 @@
141141
DestinationFiles="@(MSBuildExtensionsContent->'$(OutputPath)\%(DeploymentSubpath)\%(RecursiveDir)%(Filename)%(Extension)')" />
142142
</Target>
143143

144-
<Target Name="PublishRuntimeAnalyzers"
145-
DependsOnTargets="GenerateRuntimeAnalyzers"
146-
AfterTargets="OverlaySdkOnLKG">
147-
<Copy SourceFiles="@(RuntimeAnalyzersContent)"
148-
DestinationFiles="@(RuntimeAnalyzersContent->'$(ArtifactsBinDir)$(Configuration)\RuntimeAnalyzers\%(DeploymentSubpath)\%(RecursiveDir)%(Filename)%(Extension)')" />
149-
</Target>
150-
151144
<Target Name="PublishNetSdks"
152145
BeforeTargets="Build">
153146
<ItemGroup>

Diff for: src/Layout/redist/targets/RuntimeAnalyzers.targets

-24
This file was deleted.

0 commit comments

Comments
 (0)