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

The GetAnalyzerSettings task is removing existing source generators for test projects when sonar.dotnet.excludeTestProjects is set to true #1469

Open
csaba-sagi-sonarsource opened this issue Feb 20, 2023 · 2 comments
Milestone

Comments

@csaba-sagi-sonarsource
Copy link
Contributor

The issue was originally reported by the community: https://community.sonarsource.com/t/sonarqube-scanner-seems-to-interfere-with-net-source-generators-refit/82712

Reproduction steps

  1. Create a test project that uses classes that are generated by a source generator
  2. Make sure sonar.dotnet.excludeTestProjects is set to true
  3. call begin step
  4. call dotnet build -> this will fail because the source generator was removed by the GetAnalyzerSettings, so the generated type is not generated and is unknown in the test project.

Version used:

dotnet-sonarscanner 5.11.0

@csaba-sagi-sonarsource csaba-sagi-sonarsource added this to the 5.13.0 milestone Feb 20, 2023
@github-actions github-actions bot added this to To do in S4NET Kanban Feb 20, 2023
@csaba-sagi-sonarsource csaba-sagi-sonarsource changed the title The GetAnalyzerSettings task is removing existing source generators for test projects when sonar.dotnet.excludeTestProjects is set to true The GetAnalyzerSettings task is removing existing source generators for test projects when sonar.dotnet.excludeTestProjects is set to true Feb 20, 2023
@csaba-sagi-sonarsource
Copy link
Contributor Author

Should have a very similar solution like #1211

@gregory-paidis-sonarsource gregory-paidis-sonarsource modified the milestones: 5.13.0, 5.14.0 Apr 4, 2023
@github-actions github-actions bot added this to To do in S4NET Kanban Apr 4, 2023
@costin-zaharia-sonarsource costin-zaharia-sonarsource modified the milestones: 5.14.0, 6.1.0 Sep 25, 2023
@PavelFischerCoupa
Copy link

PavelFischerCoupa commented Jan 5, 2024

We run into the similar issue: If we use sonar, generator output is not present in the compiled dll. Any plans to fix it, or is there any workarounds? But in our case it is independent of setting. We use version 5.15 for dotnet-sonarscanner and server Version 8.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants