Repository navigation
Commit 66d606a
authored
[3.0] Overhaul SilkTouch configuration and DI (#2624)
* Initial commit for feature/silktouch-config-overhaul
* Add Autofac and adapt the existing IServiceCollection code to use it
* Remove EvaluatedConstant since this is old code and we can evaluate using Roslyn now
* Begin removing keyed resolution and JSON config reading code
* Remove IJobDependency/JobDependencies
* Begin reworking SilkTouchGenerator
* Combine IModContextProvider and IModContext because Provider's main job is to handle keyed resolution
* Update mods to not use IOptionsSnapshot nor IJobDependency
* Trim ServiceCollectionExtensions to isolate the code I need to keep
* Work on new composition root
* Get new setup roughly implemented and fix all compile errors
* Remove old generator Resolve call
* Removes jobs from SilkTouchConfiguration and fix private field naming
* Remove unhelpful doc
* Add ModRegistrationExtensions
* Add RegisterMod helper
* Add RegisterClangScraper
* Use collection expressions for CLI option definitions
* Fix Program class not being static
* Implement generator job parallelism setting
* Work on registration API
* Translate Vulkan job JSON into C#
* Replace RegisterMod helper with AsHierarchyAndInterfaces
* Add separate SilkTouchModRegistrationContext for registering mods
* Move function transformer registrations to TransformFunctions registration method
* Also register FunctionTransformer alongside TransformFunctions
* Use WithParameter to specifically inject the config param into each mod instead of registering it separately
Mods shouldn't peek into other mod configs and this lets us register multiple of the same mod more easily.
* Update CSharpier tool
* Format SilkTouchRegistrationExtensions
* Add extra spacing since CSharpier formatting is hard to read with fluent chains
* Remove "DON'T USE CONSTRUCTOR-STYLE RECORDS" warning comments, no longer relevant
* Change AddVTables Configuration to accept VTable types instead of IConfigurationSection
* Add IModContextProvider back, but rename to IModContextFactory
* Fix incorrect generator config
* Migrate MS DI registration to use Autofac
* Add SilkTouchHost class
* Move Vulkan job definition to Program from SilkTouchHost
* Add todos and edit docs
* Rename parameter
* Add new Silk.NET.SilkTouch.Jobs project
* Migrate generator.json jobs to SilkTouch.Jobs
* Split jobs into multiple files for readability and to save my scroll wheel
* Fix compile errors in SilkTouch test project
* Fix incorrect default AddVTables config
* Remove usages ThreadLocals and JobKey when used for keyed resolution/job isolation
* Remove more job key usages
* Cleanup a few more job key usages
* Change SilkTouchJob to be internal
* Add registration methods for the different function transformers and update job definitions
Microsoft also gets the default transformers added to match how the old DI setup always had them registered.
* Generate all bindings except Microsoft on Windows
* Add start of DocumentFactory
* Work on DocumentFactory
* Work on DocumentFactory API
* Ensure using directives are well ordered
* Implement DocumentFactory syntax walker and rewriter
* Add using statement sorting to DocumentFactory
* Register DocumentFactory by default
* Handle headers during document initialization
* Remove a few usages of ModCSharpSyntaxRewriter
* Fix incorrect using directive sort order
Forgot that these weren't bare namespaces.
* Initialize the DocumentFactory with the default license header
* Remove Mod class (not IMod)
* Replace common namespace identification with a DefaultNamespace config option
* Assume base.VisitCompilationUnit does not return null
* Have DocumentFactory add a default namespace to documents without them
* Remove header injection handling from MSBuildModContext
* Update IModContext.WorkingDirectory doc comment
* Work on removing ModCSharpSyntaxRewriter
* Update remaining usages of ModCSharpSyntaxRewriter
* Update mods to use DocumentFactory when adding documents
* Fix duplicated doc header
* Move SDL3 header txt up one level to match the other bindings
* Change DefaultLicenseHeader to specify the API-specific header file for each job
* Edit doc comment
* Update and fix unit tests
* Regenerate all bindings except Microsoft on Windows
* Have AddVTables add using System.Runtime.CompilerServices to all vtables generated
* Rework how using statements are gathered (WIP)
* Rework how ClangScraper outputs documents
* Cleanup
* Unify the scrape and read from cache paths of ClangScraper
This was driving me crazy
* Fix source documents being dropped
* Fix using statement formatting
* Isolate using statements added by AddVTables
* Regenerate all bindings except Microsoft on Windows
* Move solution loading back to MSBuildModContextFactory
* Fix solution cache race condition causing the solution to be loaded multiple times
* Edit docs for SilkTouchHost
* Update the using-the-generator docs
* Update generator-mods docs
* Fix incorrect branch used for docs links
* Move GetLongestCommonPrefix and GetLongestCommonPath to ClangScraper
* Remove WithMods1 parent 76913ed commit 66d606a
916 files changed
Lines changed: 4036 additions & 3455 deletions
File tree
- .config
- .silktouch
- docs/for-contributors/Generator
- eng/silktouch/sdl
- sources
- OpenAL/OpenAL/al
- OpenCL/OpenCL/OpenCL
- OpenGL/OpenGL/gl
- OpenXR/OpenXR/OpenXR
- SDL/SDL/SDL3
- SilkTouch
- Jobs
- SilkTouch
- Clang
- Mods
- Common
- Metadata
- Transformation
- Vulkan/Vulkan/Vulkan
- tests/SilkTouch/SilkTouch
- FunctionTransformation
- Khronos
- Naming
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
99 | 99 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
189 | | - | |
| 191 | + | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
| |||
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 378 | + | |
| 379 | + | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 382 | + | |
| 383 | + | |
386 | 384 | | |
387 | 385 | | |
388 | 386 | | |
| |||
465 | 463 | | |
466 | 464 | | |
467 | 465 | | |
468 | | - | |
469 | | - | |
| 466 | + | |
| 467 | + | |
470 | 468 | | |
471 | 469 | | |
472 | 470 | | |
| |||
0 commit comments