Skip to content

Architecture

Jeff Campbell edited this page Jun 10, 2021 · 1 revision

Genesis Architecture

Genesis Architecture Flow

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.

Plugin Flow

Plugin Execution Flow

  • All plugin types are discovered via reflection and:
    • If they implement ICacheable are assigned a MemoryCache instance that is shared between all other ICacheable plugins.
    • If they implement IConfigurable they are assigned the IGenesisSettings instance for this run. This contains all configuration settings for this run.
  • All IPreProcessor plugins execute.
  • All IDataProvider plugins are executed and return an array of zero or more CodeGeneratorData instances.
  • All ICodeGenerator plugins are passed the superset of CodeGeneratorData derives instances and return a set of zero or more CodeGenFile instances representing a code-generated file.
  • All IPostProcessor plugins are passed the superset of all CodeGenFile instances and execute their logic.
Clone this wiki locally