-
-
Notifications
You must be signed in to change notification settings - Fork 8
Architecture
Jeff Campbell edited this page Jun 10, 2021
·
1 revision
The process for generating code in Genesis is pretty straightforward. Starting a code generation run will walk through the following stages:
- The target Visual Studio solution is loaded and each project included in the solution is parsed for all of it's types via Roslyn.
- All .Net Core plugin assemblies are loaded from the plugin path.
- All plugin types are discovered via reflection.
- All configs are loaded (base64 and file).
- For each config:
- Execute all code generation plugins that are enabled in the current config. This flow is based on the Plugin Flow below.
- All plugin types are discovered via reflection and:
- If they implement
ICacheable
are assigned aMemoryCache
instance that is shared between all otherICacheable
plugins. - If they implement
IConfigurable
they are assigned theIGenesisSettings
instance for this run. This contains all configuration settings for this run.
- If they implement
- All
IPreProcessor
plugins execute. - All
IDataProvider
plugins are executed and return an array of zero or moreCodeGeneratorData
instances. - All
ICodeGenerator
plugins are passed the superset ofCodeGeneratorData
derives instances and return a set of zero or moreCodeGenFile
instances representing a code-generated file. - All
IPostProcessor
plugins are passed the superset of allCodeGenFile
instances and execute their logic.