-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Roslyn 3.11, 4.4, 4.6, and 4.8 #73
Changes from all commits
6b5805b
4e2aac1
c692548
45c661a
9c8ddea
9e0ae97
1dd779c
766509e
95cdb11
f70871f
668ab52
14e344b
ac55b8f
ed54141
31586e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,16 @@ | |
<PropertyGroup> | ||
<Copyright>Copyright © 2013-2024 Akka.NET Project</Copyright> | ||
<NoWarn>$(NoWarn);CS1591;NU1701;CA1707;</NoWarn> | ||
<VersionPrefix>0.2.1</VersionPrefix> | ||
<VersionPrefix>0.2.2</VersionPrefix> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<Authors>Akka.NET Team</Authors> | ||
<PackageProjectUrl>https://github.com/akkadotnet/akka.analyzers</PackageProjectUrl> | ||
<PackageReleaseNotes>* [Resolved `AK2001`: `if` statements not cleanly managed by Code Fix](https://github.com/akkadotnet/akka.analyzers/pull/46)</PackageReleaseNotes> | ||
<PackageReleaseNotes>* [AK2001: Harden rule, only run on Akka.NET v1.5.15 and later](https://github.com/akkadotnet/akka.analyzers/pull/51) | ||
* [AK1001: Make sure that analyzer also considers `Context.Sender`](https://github.com/akkadotnet/akka.analyzers/pull/54) | ||
* [AK1001: Make sure that analyzer also consider lambda expressions with no code blocks](https://github.com/akkadotnet/akka.analyzers/pull/56) | ||
* [AK1002: Add new rule to prevent `GracefulStop()` from being called in `ReceiveAsync()` and `ReceiveAnyAsync()`](https://github.com/akkadotnet/akka.analyzers/pull/58) | ||
* [AK1002: Improve rule to ignore user code with the same name](https://github.com/akkadotnet/akka.analyzers/pull/60) | ||
* [AK1003: Add rule to flag non-performant `ReceiveAsync()` and `ReceiveAnyAsync()` invocation](https://github.com/akkadotnet/akka.analyzers/pull/61)</PackageReleaseNotes> | ||
<PackageTags>akka.net, akka.analyzers, akakdotnet, roslyn, analyzers</PackageTags> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | ||
|
@@ -21,6 +26,7 @@ | |
<LangVersion>latest</LangVersion> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<RoslynVersion>4.8.0</RoslynVersion> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The key driver of this Roslyn-versioning system is this custom property - this is used to specify the version of the Roslyn tooling that gets included inside each distributable. |
||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Include="$(MSBuildThisFileDirectory)\logo.png" Pack="true" Visible="false" PackagePath="\" /> | ||
|
@@ -29,7 +35,7 @@ | |
<!-- ======================================== --> | ||
<!-- Production-specific properties and items --> | ||
<Choose> | ||
<When Condition=" !$(MSBuildProjectName.Contains('.tests')) "> | ||
<When Condition=" !$(MSBuildProjectName.Contains('.Tests')) "> | ||
<PropertyGroup> | ||
<AnalysisLevel>latest-All</AnalysisLevel> | ||
<EnableNETAnalyzers>true</EnableNETAnalyzers> | ||
|
@@ -38,4 +44,35 @@ | |
</PropertyGroup> | ||
</When> | ||
</Choose> | ||
|
||
<Choose> | ||
<When Condition="$(MSBuildProjectName.Contains('.Tests'))"> | ||
<ItemGroup> | ||
<!-- Download packages referenced by ReferenceAssembliesHelper --> | ||
<PackageDownload Include="Akka.Cluster.Sharding" Version="[1.5.15]"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved this to here so all of the individual |
||
</ItemGroup> | ||
</When> | ||
</Choose> | ||
|
||
<PropertyGroup Condition="$(MSBuildProjectName.StartsWith('Akka.Analyzers.Roslyn'))"> | ||
<AssemblyName>Akka.Analyzers</AssemblyName> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="$(MSBuildProjectName.StartsWith('Akka.Analyzers.Fixes.Roslyn'))"> | ||
<AssemblyName>Akka.Analyzers.Fixes</AssemblyName> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="$(MSBuildProjectName.Contains('Roslyn311'))"> | ||
<DefineConstants>$(DefineConstants);ROSLYN_3_11;ROSLYN_3_11_OR_GREATER</DefineConstants> | ||
<RoslynVersion>3.11.0</RoslynVersion> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Defines the versions of Roslyn we use based on the naming convention of the projects |
||
</PropertyGroup> | ||
<PropertyGroup Condition="$(MSBuildProjectName.Contains('Roslyn44'))"> | ||
<DefineConstants>$(DefineConstants);ROSLYN_4_4;ROSLYN_3_11_OR_GREATER;ROSLYN_4_4_OR_GREATER</DefineConstants> | ||
<RoslynVersion>4.4.0</RoslynVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="$(MSBuildProjectName.Contains('Roslyn46'))"> | ||
<DefineConstants>$(DefineConstants);ROSLYN_4_6;ROSLYN_3_11_OR_GREATER;ROSLYN_4_4_OR_GREATER;ROSLYN_4_6_OR_GREATER</DefineConstants> | ||
<RoslynVersion>4.6.0</RoslynVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(RoslynVersion)' == '4.8.0' "> | ||
<DefineConstants>$(DefineConstants);ROSLYN_4_8;ROSLYN_3_11_OR_GREATER;ROSLYN_4_4_OR_GREATER;ROSLYN_4_6_OR_GREATER;ROSLYN_4_8_OR_GREATER</DefineConstants> | ||
</PropertyGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,8 @@ | |
<PackageVersion Include="FluentAssertions" Version="6.12.0"/> | ||
<PackageVersion Include="coverlet.collector" Version="6.0.1"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added SourceLink as a global package reference for all projects in the solution. |
||
</ItemGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<RootNamespace>Akka.Analyzers.Fixes</RootNamespace> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Akka.Analyzers.Roslyn311\Akka.Analyzers.Roslyn311.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\Akka.Analyzers.Fixes\**\*.cs" Exclude="..\Akka.Analyzers.Fixes\obj\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<RootNamespace>Akka.Analyzers.Fixes</RootNamespace> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Akka.Analyzers.Roslyn44\Akka.Analyzers.Roslyn44.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\Akka.Analyzers.Fixes\**\*.cs" Exclude="..\Akka.Analyzers.Fixes\obj\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<RootNamespace>Akka.Analyzers.Fixes</RootNamespace> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Akka.Analyzers.Roslyn46\Akka.Analyzers.Roslyn46.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\Akka.Analyzers.Fixes\**\*.cs" Exclude="..\Akka.Analyzers.Fixes\obj\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
<licenseUrl>https://licenses.nuget.org/Apache-2.0</licenseUrl> | ||
<icon>logo.png</icon> | ||
<description>$Description$</description> | ||
<copyright>Copyright © 2013-2023 Akka.NET Project</copyright> | ||
<copyright>Copyright © 2013-2024 Akka.NET Project</copyright> | ||
<repository type="git" url="https://github.com/akkadotnet/akka.analyzers"/> | ||
<tags>akka.net, akka.analyzers, akakdotnet, roslyn, analyzers</tags> | ||
<readme>README.md</readme> | ||
|
@@ -22,6 +22,14 @@ | |
|
||
<file target="analyzers\dotnet\cs\" src="..\Akka.Analyzers\bin\$Configuration$\netstandard2.0\Akka.Analyzers.dll" /> | ||
<file target="analyzers\dotnet\cs\" src="..\Akka.Analyzers.Fixes\bin\$Configuration$\netstandard2.0\Akka.Analyzers.Fixes.dll" /> | ||
<!-- <file target="tools\" src="..\xunit.analyzers.fixes\tools\*.ps1" />--> | ||
|
||
<file target="analyzers\dotnet\roslyn3.11\cs\" src="..\Akka.Analyzers.Fixes.Roslyn311\bin\$Configuration$\netstandard2.0\Akka.Analyzers.dll" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what makes the solution workable for end-users - this moves compiler-platform specific versions of the Roslyn analyzers + fixes into the directories expected by the .NET Compiler platform. So if the user is running version 4.3 of Roslyn, the system should fall back to using the 4.2 version specified in this directory. |
||
<file target="analyzers\dotnet\roslyn3.11\cs\" src="..\Akka.Analyzers.Fixes.Roslyn311\bin\$Configuration$\netstandard2.0\Akka.Analyzers.Fixes.dll" /> | ||
|
||
<file target="analyzers\dotnet\roslyn4.4\cs\" src="..\Akka.Analyzers.Fixes.Roslyn44\bin\$Configuration$\netstandard2.0\Akka.Analyzers.dll" /> | ||
<file target="analyzers\dotnet\roslyn4.4\cs\" src="..\Akka.Analyzers.Fixes.Roslyn44\bin\$Configuration$\netstandard2.0\Akka.Analyzers.Fixes.dll" /> | ||
|
||
<file target="analyzers\dotnet\roslyn4.6\cs\" src="..\Akka.Analyzers.Fixes.Roslyn46\bin\$Configuration$\netstandard2.0\Akka.Analyzers.dll" /> | ||
<file target="analyzers\dotnet\roslyn4.6\cs\" src="..\Akka.Analyzers.Fixes.Roslyn46\bin\$Configuration$\netstandard2.0\Akka.Analyzers.Fixes.dll" /> | ||
</files> | ||
</package> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<RootNamespace>Akka.Analyzers</RootNamespace> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis" VersionOverride="[$(RoslynVersion)]"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\Akka.Analyzers\**\*.cs" Exclude="..\Akka.Analyzers\obj\**\*.cs" /> | ||
</ItemGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<RootNamespace>Akka.Analyzers</RootNamespace> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis" VersionOverride="[$(RoslynVersion)]"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\Akka.Analyzers\**\*.cs" Exclude="..\Akka.Analyzers\obj\**\*.cs" /> | ||
</ItemGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<RootNamespace>Akka.Analyzers</RootNamespace> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis" VersionOverride="[$(RoslynVersion)]"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\Akka.Analyzers\**\*.cs" Exclude="..\Akka.Analyzers\obj\**\*.cs" /> | ||
</ItemGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net8.0;net472</TargetFrameworks> | ||
<IsPackable>false</IsPackable> | ||
<IsTestProject>true</IsTestProject> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk"/> | ||
<PackageReference Include="xunit"/> | ||
<PackageReference Include="xunit.runner.visualstudio"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="coverlet.collector"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="FluentAssertions"/> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing"/> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Akka.Analyzers.Fixes.Roslyn311\Akka.Analyzers.Fixes.Roslyn311.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="true" /> | ||
<ProjectReference Include="..\Akka.Analyzers.Roslyn311\Akka.Analyzers.Roslyn311.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="true" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\Akka.Analyzers.Tests\**\*.cs" Exclude="..\Akka.Analyzers.Tests\obj\**\*.cs" /> | ||
</ItemGroup> | ||
|
||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't run .NET Framework tests reliably on Linux; worked around that here.