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

Analyzers acquisition experience #10014

Conversation

YuliiaKovalova
Copy link
Member

Context

This PR implements acquisition flow for custom analyzers.

The process can be described the next way:
A Custom Analyzer library contains a file Company.AnalyzerTemplate.props.
image

If this analyzer is referenced from any solution, MSBuild invokes intrinsic function RegisterAnalyzer during the evaluation. It emits BuildCheckAcquisitionEventArgs if the parsed path to custom analyzer is valid.
This event is handled by BuildCheckConnectorLogger: it passes the info to IBuildCheckManager.ProcessAnalyzerAcquisition.
image

Tests

Manual and unit tests.
I plan to cover e2e scenarios once MSBuild.Build package with BuildCheck infrastructure is available for public reference (it is needed for custom templates).

based on: #9977

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

It looks great!

I'd love to see an end to end test of this as well :-) Doesn't have to be part of this PR (but would be nice)

src/Build/Evaluation/IntrinsicFunctions.cs Show resolved Hide resolved
src/Build/Resources/Strings.resx Outdated Show resolved Hide resolved
@YuliiaKovalova
Copy link
Member Author

It looks great!

I'd love to see an end to end test of this as well :-) Doesn't have to be part of this PR (but would be nice)

e2e tests will be added in a separate PR

@YuliiaKovalova YuliiaKovalova merged commit bd0b1e4 into dotnet:main Apr 25, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants