Repository navigation
Conversation
Contributor
|
All native library builds modified in this PR shall attempt to be built by CI. |
…ob is to handle keyed resolution
Exanite
force-pushed
the
feature/silktouch-config-overhaul
branch
from
October 10, 2026 19:41
bf44782 to
7dabae1
Compare
Member
Author
|
Force pushing to rebase on develop/3.0. |
Forgot that these weren't bare namespaces.
This was driving me crazy
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the PR
This PR reworks the generator to be configured through a C# API rather than a JSON file. The original reason for this was to allow more complex conditions to be easily expressed, such as for skipping mods/jobs on specific platforms.
In addition, this PR also reworks the dependency injection setup to be properly scope-based rather than using the keyed dependency resolution approach the generator was using before. This structurally avoids issues where state is accidentally shared between jobs.
The generator config is now found in a new
Silk.NET.SilkTouch.Jobsproject which is next to the SilkTouch project. Because Silk has a lot of bindings, I decided to split the config into multiple files. External consumers of SilkTouch should be able to use single file apps if more appropriate (should work, but I haven't tested yet).This PR also reworks how copyright headers, using statements, and namespaces are injected into generated documents. These were previously implicitly handled by
ModandModCSharpSyntaxRewriter, both of which were often accidentally used throughout the codebase. These are now replaced byDocumentFactory, which makes the process much more explicit. The idea is to callDocumentFactory.PopulateDocumentbefore adding new documents to the project.The behavior is otherwise mostly the same (using statements are gathered by scanning docs and injected into new documents). One behavior I decided not to replicate is implicitly deciding the header to inject into new docs.
DocumentFactoryalways uses theDefaultLicenseHeaderdefined in the job config rather than taking the longest header comment found.Related issues, Discord discussions, or proposals
Original discussion with Perksey: https://discord.com/channels/521092042781229087/587346162802229298/1530907649561067693
Discord thread: https://discord.com/channels/521092042781229087/1542235869560438824
Further Comments
Next PR
This PR will be followed up by a PR that focuses on OpenXR and multi-platform ClangSharp scraping.
Tasks (from my tracker)
TransformFunctions.Silk.NET.SDL.ConditionHandle.gen.csinstead ofConditionHandle.gen.cswhen running multiple jobs at the same time.These will be replaced by DocumentFactory:
Mod(the class, not the similarly named interface)ModCSharpSyntaxRewriterTasks
DocumentFactory.PopulateDocumentalso callsReportDocumentinternally.