Move analyzers into separate solution

This commit is contained in:
Dustin Campbell 2023-09-18 21:13:31 -07:00
Родитель 0a170e1dcf
Коммит 757afa11a0
35 изменённых файлов: 70 добавлений и 33 удалений

Просмотреть файл

@ -172,13 +172,6 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Utilities.Shared.Test", "src\Shared\Microsoft.AspNetCore.Razor.Utilities.Shared.Test\Microsoft.AspNetCore.Razor.Utilities.Shared.Test.csproj", "{7275F376-1B63-49D3-8078-0F7CA15CC637}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Utilities.Shared", "src\Shared\Microsoft.AspNetCore.Razor.Utilities.Shared\Microsoft.AspNetCore.Razor.Utilities.Shared.csproj", "{BAFE178B-7AD4-41AE-A75D-9B920B9EA050}"
ProjectSection(ProjectDependencies) = postProject
{7E1535D1-1896-406D-A58C-E734FBA482FE} = {7E1535D1-1896-406D-A58C-E734FBA482FE}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Razor.Diagnostics.Analyzers", "src\Shared\Razor.Diagnostics.Analyzers\Razor.Diagnostics.Analyzers.csproj", "{7E1535D1-1896-406D-A58C-E734FBA482FE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Razor.Diagnostics.Analyzers.Test", "src\Shared\Razor.Diagnostics.Analyzers.Test\Razor.Diagnostics.Analyzers.Test.csproj", "{66744CCD-2F35-494F-9A1C-8FC3CE1EF729}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -724,22 +717,6 @@ Global
{BAFE178B-7AD4-41AE-A75D-9B920B9EA050}.Release|Any CPU.Build.0 = Release|Any CPU
{BAFE178B-7AD4-41AE-A75D-9B920B9EA050}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
{BAFE178B-7AD4-41AE-A75D-9B920B9EA050}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
{7E1535D1-1896-406D-A58C-E734FBA482FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E1535D1-1896-406D-A58C-E734FBA482FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E1535D1-1896-406D-A58C-E734FBA482FE}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
{7E1535D1-1896-406D-A58C-E734FBA482FE}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
{7E1535D1-1896-406D-A58C-E734FBA482FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E1535D1-1896-406D-A58C-E734FBA482FE}.Release|Any CPU.Build.0 = Release|Any CPU
{7E1535D1-1896-406D-A58C-E734FBA482FE}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
{7E1535D1-1896-406D-A58C-E734FBA482FE}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
{66744CCD-2F35-494F-9A1C-8FC3CE1EF729}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66744CCD-2F35-494F-9A1C-8FC3CE1EF729}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66744CCD-2F35-494F-9A1C-8FC3CE1EF729}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
{66744CCD-2F35-494F-9A1C-8FC3CE1EF729}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
{66744CCD-2F35-494F-9A1C-8FC3CE1EF729}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66744CCD-2F35-494F-9A1C-8FC3CE1EF729}.Release|Any CPU.Build.0 = Release|Any CPU
{66744CCD-2F35-494F-9A1C-8FC3CE1EF729}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
{66744CCD-2F35-494F-9A1C-8FC3CE1EF729}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -819,8 +796,6 @@ Global
{4126E0A6-1CA9-44B1-AD22-66EDB9FEE7AD} = {92463391-81BE-462B-AC3C-78C6C760741F}
{7275F376-1B63-49D3-8078-0F7CA15CC637} = {3AE210D1-C435-4693-BF79-2EF13ED554B9}
{BAFE178B-7AD4-41AE-A75D-9B920B9EA050} = {3AE210D1-C435-4693-BF79-2EF13ED554B9}
{7E1535D1-1896-406D-A58C-E734FBA482FE} = {3AE210D1-C435-4693-BF79-2EF13ED554B9}
{66744CCD-2F35-494F-9A1C-8FC3CE1EF729} = {3AE210D1-C435-4693-BF79-2EF13ED554B9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0035341D-175A-4D05-95E6-F1C2785A1E26}

Просмотреть файл

@ -2,10 +2,15 @@
<Target Name="_PublishLanguageServerRids" AfterTargets="Pack" Condition="'$(DotNetBuildFromSource)' != 'true'">
<PropertyGroup>
<AnalyzersSolutionPath>$(MSBuildThisFileDirectory)..\src\Analyzers\Analyzers.sln</AnalyzersSolutionPath>
<LanguageServerProject>$(MSBuildThisFileDirectory)..\src\Razor\src\rzls\rzls.csproj</LanguageServerProject>
<RazorSolutionPath>$(MSBuildThisFileDirectory)..\Razor.sln</RazorSolutionPath>
</PropertyGroup>
<MSBuild Projects="$(AnalyzersSolutionPath)"
Targets="Restore" />
<MSBuild Projects="$(AnalyzersSolutionPath)"
Targets="Build" />
<MSBuild Projects="$(RazorSolutionPath)"
Targets="Restore" />
<MSBuild Projects="$(LanguageServerProject)"

Просмотреть файл

@ -6,6 +6,8 @@
</PropertyGroup>
<ItemGroup>
<ProjectToBuild Include="$(RepoRoot)src\Analyzers\Analyzers.sln" BuildInParallel="false" />
<ProjectToBuild Condition="'$(OS)'=='WINDOWS_NT' and '$(SdkTaskProjects)'==''" Include="$(MSBuildThisFileDirectory)..\Razor.sln" />
<!-- Exclude VSIX projects on non-Windows -->

Просмотреть файл

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34117.57
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Razor.Diagnostics.Analyzers", "Razor.Diagnostics.Analyzers\Razor.Diagnostics.Analyzers.csproj", "{42438A8F-6284-443A-A518-9AAD5371A403}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Razor.Diagnostics.Analyzers.Test", "Razor.Diagnostics.Analyzers.Test\Razor.Diagnostics.Analyzers.Test.csproj", "{C886DAB3-E7ED-4ED2-9D14-342762B30CA1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{42438A8F-6284-443A-A518-9AAD5371A403}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42438A8F-6284-443A-A518-9AAD5371A403}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42438A8F-6284-443A-A518-9AAD5371A403}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42438A8F-6284-443A-A518-9AAD5371A403}.Release|Any CPU.Build.0 = Release|Any CPU
{C886DAB3-E7ED-4ED2-9D14-342762B30CA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C886DAB3-E7ED-4ED2-9D14-342762B30CA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C886DAB3-E7ED-4ED2-9D14-342762B30CA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C886DAB3-E7ED-4ED2-9D14-342762B30CA1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F62A910A-9F8F-44CD-B8D7-8D7A88FF902A}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,23 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
<PropertyGroup>
<PackageTags>aspnetcore;cshtml;razor</PackageTags>
<IsPackable>true</IsPackable>
<IsShipping>true</IsShipping>
<IncludeSymbols>true</IncludeSymbols>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<!-- In theory we want to have this property set, but our pipeline doesn't set the access tokens yet -->
<PublishWindowsPdb Condition="'$(DotNetSymbolServerTokenMsdl)'!='' and '$(DotNetSymbolServerTokenSymWeb)'!=''">true</PublishWindowsPdb>
<RollForward Condition="'$(IsTestProject)' == 'true'">LatestMajor</RollForward>
</PropertyGroup>
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="$(Tooling_MicrosoftCodeAnalysisAnalyzersPackageVersion)" NoWarn="NU1608" />
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="$(Tooling_MicrosoftCodeAnalysisBannedApiAnalyzersPackageVersion)" />
<PackageReference Include="Roslyn.Diagnostics.Analyzers" Version="$(Tooling_RoslynDiagnosticsAnalyzersPackageVersion)" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(DefaultNetCoreTargetFrameworks);$(DefaultNetFxTargetFramework)</TargetFrameworks>
<TargetFrameworks>$(DefaultNetCoreTargetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);$(DefaultNetFxTargetFramework)</TargetFrameworks>
<IsShippingPackage>false</IsShippingPackage>
</PropertyGroup>
<ItemGroup>
@ -12,7 +13,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Utilities.Shared\Microsoft.AspNetCore.Razor.Utilities.Shared.csproj" />
<ProjectReference Include="..\Razor.Diagnostics.Analyzers\Razor.Diagnostics.Analyzers.csproj" />
</ItemGroup>

Просмотреть файл

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT license. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Razor;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Testing.Verifiers;
@ -17,8 +16,8 @@ public static partial class CSharpAnalyzerVerifier<TAnalyzer>
{
SolutionTransforms.Add((solution, projectId) =>
{
var compilationOptions = solution.GetProject(projectId).AssumeNotNull().CompilationOptions;
compilationOptions = compilationOptions.AssumeNotNull().WithSpecificDiagnosticOptions(
var compilationOptions = solution.GetProject(projectId)!.CompilationOptions;
compilationOptions = compilationOptions!.WithSpecificDiagnosticOptions(
compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings));
solution = solution.WithProjectCompilationOptions(projectId, compilationOptions);

Просмотреть файл

@ -4,6 +4,8 @@
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>false</IsPackable>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
<IsShippingPackage>false</IsShippingPackage>
</PropertyGroup>
<ItemGroup>

Просмотреть файл

@ -41,6 +41,6 @@
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" PrivateAssets="All" />
<PackageReference Include="Roslyn.Diagnostics.Analyzers" PrivateAssets="All" />
<Analyzer Include="$(ArtifactsBinDir)\Razor.Diagnostics.Analyzers\$(Configuration)\netstandard2.0\Razor.Diagnostics.Analyzers.dll" />
<Analyzer Include="$(ArtifactsBinDir)Razor.Diagnostics.Analyzers\$(Configuration)\netstandard2.0\Razor.Diagnostics.Analyzers.dll" />
</ItemGroup>
</Project>

Просмотреть файл

@ -9,7 +9,7 @@
<PackageReference Include="Roslyn.Diagnostics.Analyzers" Version="$(Tooling_RoslynDiagnosticsAnalyzersPackageVersion)" />
<Analyzer Condition="'$(IsApiShim)' != 'true'"
Include="$(ArtifactsBinDir)\Razor.Diagnostics.Analyzers\$(Configuration)\netstandard2.0\Razor.Diagnostics.Analyzers.dll" />
Include="$(ArtifactsBinDir)Razor.Diagnostics.Analyzers\$(Configuration)\netstandard2.0\Razor.Diagnostics.Analyzers.dll" />
</ItemGroup>
</Project>

Просмотреть файл

@ -20,7 +20,7 @@
<PackageReference Include="Roslyn.Diagnostics.Analyzers" Version="$(Tooling_RoslynDiagnosticsAnalyzersPackageVersion)" />
<Analyzer Condition="'$(ProjectName)' != 'Razor.Diagnostics.Analyzers' AND '$(ProjectName)' != 'Razor.Diagnostics.Analyzers.Test'"
Include="$(ArtifactsBinDir)\Razor.Diagnostics.Analyzers\$(Configuration)\netstandard2.0\Razor.Diagnostics.Analyzers.dll" />
Include="$(ArtifactsBinDir)Razor.Diagnostics.Analyzers\$(Configuration)\netstandard2.0\Razor.Diagnostics.Analyzers.dll" />
</ItemGroup>
</Project>