Skip to content
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

Switch to Roslyn component versioning #1251

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

sharwell
Copy link
Contributor

@sharwell sharwell commented Oct 7, 2021

  • Use Roslyn 3.8 assemblies for .NET SDK prior to 6.0 RC 2 (where component versioning was added)
  • Use matching Roslyn version for 6.0 RC 2 and newer
  • Allow users to disable the source generator by setting DisableRefitSourceGenerator to true (derived from MultiTargetRoslynComponent.targets)

Closes #1244

Comment on lines +21 to +31
<Target Name="_RefitAnalyzerMultiTargeting"
Condition="'$(SupportsRoslynComponentVersioning)' != 'true'"
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
DependsOnTargets="_RefitGatherAnalyzers">

<ItemGroup>
<!-- Remove our analyzers targeting roslyn4.x -->
<Analyzer Remove="@(_RefitAnalyzer)"
Condition="$([System.String]::Copy('%(_RefitAnalyzer.Identity)').IndexOf('roslyn4')) &gt;= 0"/>
</ItemGroup>
</Target>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📝 The addition here is special handling to support .NET SDK prior to 6.0 RC 2

Comment on lines +33 to +42
<Target Name="_RefitRemoveAnalyzers"
Condition="'$(DisableRefitSourceGenerator)' == 'true'"
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
DependsOnTargets="_RefitGatherAnalyzers">

<!-- Remove all our analyzers -->
<ItemGroup>
<Analyzer Remove="@(_RefitAnalyzer)" />
</ItemGroup>
</Target>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📝 The addition here is special handling to allow users to disable the Refit source generator using a build property

Copy link

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

This looks good to me

@sharwell sharwell marked this pull request as ready for review October 8, 2021 15:20
@sharwell
Copy link
Contributor Author

sharwell commented Oct 8, 2021

Note that .NET 6 SDK RC 2 is not yet available on the downloads page, so for the (very) near-term future this change might appear to just disable the incremental source generator features.

@clairernovotny
Copy link
Member

clairernovotny commented Oct 11, 2021

@sharwell I'm going to wait until RC2 is published before merging and publishing update to this. Do we still need the pre-RC 2 handling checks? Is that needed for .NET 5 / earlier SDK's to not break?

@sharwell
Copy link
Contributor Author

Is that needed for .NET 5 / earlier SDK's to not break?

Yes, otherwise earlier SDKs will be back in the place that led to #1222

@clairernovotny clairernovotny merged commit 7f80c50 into reactiveui:main Oct 11, 2021
@sharwell sharwell deleted the component-versioning branch October 11, 2021 18:35
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Roslyn 4.0 Source Code Generator Does Not Load
3 participants