-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Convert resource utility build step to C# source generator #16629
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
base: trunk
Are you sure you want to change the base?
[dotnet] Convert resource utility build step to C# source generator #16629
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||||
|
@nvborisenko Currently enabled for I tried it for If we can fix it for |
|
In general I will be happy to use native .NET SDK to develop Selenium without In this particular case let's see the diff when CI is green. |
|
That’s a good point about the generator output being invisible to other generators. I will keep that in mind for something like CDP. In this case, it seems harmless to use it for the resource utility files. I am still investigating why it doesn’t work with Bazel. My suspicion is that bazel might not support the |
|
Internally bazel delegates everything to |
|
I modelled my attempt on that example, you can see what I had a few commits ago. It failed with the stack trace in the build I linked, for some reason. |
|
As it is, I have the C# source generator enabled only for local dev and disabled for bazel; the CI is green. Maybe this PR is useful as is? |
nvborisenko
left a comment
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.
Sorry, personally I spent a lot of time just to make local dev possible in IDE (Windows, MacOS, Linux). I cannot break it. bazel is a priority for building! .net sdk is a mimic :( We don't want to support 2 branches.
If it doesn't work in bazel, then it doesn't work at all. It has to work. |
User description
Follow-up on 4c0eb7f#r171146028
🔗 Related Issues
💥 What does this PR do?
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Replaces build-time resource generation with C# source generator
Adds Microsoft.CodeAnalysis NuGet dependencies for code generation
Removes legacy
generated_resource_utilitiesBazel ruleIntegrates source generator into WebDriver compilation pipeline
Diagram Walkthrough
File Walkthrough
1 files
New incremental source generator for resource utilities7 files
Project file for source generator NuGet packageBazel build configuration for source generator libraryAnalyzer configuration for extended rules enforcementRemove generated_resource_utilities Bazel rule exportAdd source generator project to Visual Studio solutionReplace resource generation with source generator dependencyAdd source generator analyzer and AdditionalFiles references2 files
Add Microsoft.CodeAnalysis NuGet package dependenciesUpdate NuGet package definitions with CodeAnalysis packages