Skip to content

Commit

Permalink
add roslyn 4.11 as target (#1555)
Browse files Browse the repository at this point in the history
  • Loading branch information
latonz authored Oct 24, 2024
1 parent e9abaf4 commit e229bf2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .csharpierrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ preprocessorSymbolSets:
- "DEBUG_SOURCE_GENERATOR"
- "SYSTEM_PRIVATE_CORELIB"
- "NETSTANDARD2_0"
- "ROSLYN4_4_OR_GREATER"
- "ROSLYN4_7_OR_GREATER"
- "NET6_0_OR_GREATER"
- "NET7_0_OR_GREATER"
- "NET8_0_OR_GREATER"
- "NET9_0_OR_GREATER"
- "ROSLYN4_4_OR_GREATER"
- "ROSLYN4_7_OR_GREATER"
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.7.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.7.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion build/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -Eeuo pipefail
# pack a nupkg for each roslyn version that is supported by Mapperly
# and merge them together into one nupkg

roslyn_versions=('4.0' '4.4' '4.5' '4.7')
roslyn_versions=('4.0' '4.4' '4.5' '4.7' '4.11')

RELEASE_VERSION=${RELEASE_VERSION:-"0.0.1-dev.$(date +%s)"}
RELEASE_NOTES=${RELEASE_NOTES:-''}
Expand Down
7 changes: 7 additions & 0 deletions src/Riok.Mapperly/Riok.Mapperly.Roslyn4.11.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions src/Riok.Mapperly/Riok.Mapperly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
<PackageTags>Mapper SourceGenerator</PackageTags>
<PackageIcon>logo.png</PackageIcon>

<!-- default roslyn version and constants -->
<ROSLYN_VERSION Condition="'$(ROSLYN_VERSION)' == ''">4.7</ROSLYN_VERSION>
<DefineConstants Condition="$(ROSLYN_VERSION) >= 4.4">$(DefineConstants);ROSLYN4_4_OR_GREATER</DefineConstants>
<DefineConstants Condition="$(ROSLYN_VERSION) >= 4.7">$(DefineConstants);ROSLYN4_7_OR_GREATER</DefineConstants>
<!-- default roslyn version and constants, compare 4 numeric part versions -->
<ROSLYN_VERSION Condition="'$(ROSLYN_VERSION)' == ''">4.11</ROSLYN_VERSION>
<DefineConstants Condition="'$(ROSLYN_VERSION).0.0' >= '4.4.0.0'">$(DefineConstants);ROSLYN4_4_OR_GREATER</DefineConstants>
<DefineConstants Condition="'$(ROSLYN_VERSION).0.0' >= '4.7.0.0'">$(DefineConstants);ROSLYN4_7_OR_GREATER</DefineConstants>
</PropertyGroup>

<Target Name="Husky" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(HUSKY)' != 0 AND '$(CI)' == ''">
Expand Down
2 changes: 1 addition & 1 deletion test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageReference Include="Verify.SourceGenerators" Version="2.3.0" />
</ItemGroup>

Expand Down

1 comment on commit e229bf2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'SourceGeneratorBenchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 3.

Benchmark suite Current: e229bf2 Previous: e9abaf4 Ratio
Riok.Mapperly.Benchmarks.SourceGeneratorBenchmarks.Compile 2114275.35859375 ns (± 195325.98145994742) 120741.05671574519 ns (± 1678.1529391966976) 17.51
Riok.Mapperly.Benchmarks.SourceGeneratorBenchmarks.LargeCompile 45984993.872727275 ns (± 175774.8150199352) 1277208.939174107 ns (± 7926.104374412328) 36.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.