Closed daveaglick closed 2 years ago
Might need to back off the compilation idea :(. There's an ordering problem. If theme paths can be defined via settings and/or the bootstrapper, then by the time we've figured out the theme paths it's too late to load new assemblies and manipulate the bootstrapper from them.
I think the best we can do, at least for now, is allow a variety of appsettings.json
etc. files in the theme root. Those will still need to be loaded late, but we can manually merge them with the actual settings. And with computed values now, they can do almost anything a compiled project could do (could even look at letting settings files add pipelines, etc.)
Ended up hacking around the ordering limitations described above. Essentially, I moved the file system to be independent of the engine and then split the theme initialization into stages. Themes can now have project files that get compiled and included during execution.
Been thinking about how to let theme change settings or even include their own modules or extensions and finally have a scheme I'm happy with.
appsettings.json
orstatiq.json
files in the theme folder will be processed..csproj
files in the theme folder will be compiled (probably via Buildalyzer) and their output included in the generation. That means a theme can define settings in code or just use the.csproj
file to include other NuGet packages (which will also get referenced via transitive dependency loading)..AddThemeFolder("foo")
) but we also need to compile and reference project output, configure input folders, etc. as a result.