Skip to content

Default Code Generator Plugins

Jesse Talavera-Greenberg edited this page May 5, 2019 · 19 revisions

The default installation of Entitas comes with these plugins, sorted by assembly.

All listed plugins are executed in dry-run unless otherwise stated.

DesperateDevs.CodeGeneration.Plugins

Pre-Processors

TargetFrameworkProfilePreProcessor

ValidateProjectPathPreProcessor

Post-Processors

AddFileHeaderPostProcessor

Adds a comment to each generated C# source file similar to this:

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by <name of ICodeGenerator plugin>.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

Not essential, but a useful reminder not to edit generated source code. This plugin only supports comment syntax for C# (and compatible languages like C++ or C); if you want to generate code in any other language (e.g. a link.xml file), you will need to either disable this plugin or replace it with a custom one whose output changes depending on the file extension.

CleanTargetDirectoryPostProcessor

ConsoleWriteLinePostProcessor

MergeFilesPostProcessor

Merges generated files with the same filename into one, like so:

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityApiGenerator.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class EngineInputEntity {
    // Omitted for brevity
}

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherApiGenerator.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public sealed partial class EngineInputMatcher {
    // Omitted for brevity
}

Do not disable this plugin without a suitable replacement, or else large swathes of generated code will not be properly generated.

NewLinePostProcessor

Replaces the line endings in all generated files with your operating system's native representation, regardless of what the code generator actually outputs.

UpdateCSProjPostProcessor

WriteToDiskPostProcessor

Writes all generated files to disk. Any changes to generated code made by IPostProcessors run after this one will not be saved.

Not executed in dry runs.

DesperateDevs.CodeGeneration.Unity.Plugins

Pre-Processors

WarnIfCompilationErrorsPreProcessor

Post-Processors

DebugLogPostProcessor

Doctors

DebugLogDoctor

WarnIfCompilationErrorsDoctor

Entitas.CodeGeneration.Plugins

Data Providers

ComponentDataProvider

ContextDataProvider

EntityIndexDataProvider

Code Generators

ComponentContextApiGenerator

ComponentEntityApiGenerator

ComponentEntityApiInterfaceGenerator

ComponentGenerator

ComponentLookupGenerator

ComponentMatcherApiGenerator

ContextAttributeGenerator

ContextGenerator

ContextMatcherGenerator

ContextsGenerator

EntityGenerator

EntityIndexGenerator

EventEntityApiGenerator

EventListenerComponentGenerator

EventListenertInterfaceGenerator

Note: This name of this plugin has a typo.

EventSystemGenerator

EventSystemsGenerator

Entitas.Roslyn.CodeGeneration.Plugins

Data Providers

CleanupDataProvider

ComponentDataProvider

EntityIndexDataProvider

Code Generators

CleanupSystemGenerator

CleanupSystemsGenerator

Entitas.VisualDebugging.CodeGeneration.Plugins

Code Generators

ContextObserverGenerator

FeatureClassGenerator

Clone this wiki locally