Nuke.Cola
Loading...
Searching...
No Matches
Nuke.Cola.BuildPlugins.Plugins Class Reference

This class contains the main entry point for builds supporting plugins. More...

Static Public Member Functions

static int Execute< T > (MainExecute< T > defaultExecute)
 Use this instead of the regular Execute method in your main function if you want to support build plugins.
 

Static Private Member Functions

static ? string GetCSharpName (Type type)
 
static bool AttemptReuseCompiledPlugins ()
 
static int ExecuteExternal (AbsolutePath dllPath)
 

Static Private Attributes

const string OutputBuildClass = nameof(OutputBuildClass)
 
const string ExecuteWithPlugins = nameof(ExecuteWithPlugins)
 
const string ReuseCompiled = nameof(ReuseCompiled)
 

Detailed Description

This class contains the main entry point for builds supporting plugins.

Definition at line 24 of file Plugins.cs.

Member Function Documentation

◆ Execute< T >()

static int Nuke.Cola.BuildPlugins.Plugins.Execute< T > ( MainExecute< T > defaultExecute)
static

Use this instead of the regular Execute method in your main function if you want to support build plugins.

Parameters
defaultExecuteIf no build plugins are found, the provided delegate will be executed instead
Template Parameters
TThe type of the main build class
Returns
The error code or 0 on success

If plugins are found they're collected into an intermediate C# script which defines a build class inheriting from the provided main build class and implementing all the build interfaces defined by each plugin. This however also means build interfaces cannot have non-default-implemented members, so they behave more like composition in this case.

The main NUKE execute method is then called from within this intermediate class. These plugins can then interact with the main build targets if they can reference to the main build assembly, either directly or more elegantly through a Nuget package.

Use --ReuseCompiledPlugins argument or `REUSE_COMPILED

Type Constraints
T :NukeBuild 
T :new() 

Definition at line 59 of file Plugins.cs.

◆ ExecuteExternal()

static int Nuke.Cola.BuildPlugins.Plugins.ExecuteExternal ( AbsolutePath dllPath)
staticprivate

Definition at line 154 of file Plugins.cs.

Member Data Documentation

◆ ExecuteWithPlugins

const string Nuke.Cola.BuildPlugins.Plugins.ExecuteWithPlugins = nameof(ExecuteWithPlugins)
staticprivate

Definition at line 28 of file Plugins.cs.

◆ OutputBuildClass

const string Nuke.Cola.BuildPlugins.Plugins.OutputBuildClass = nameof(OutputBuildClass)
staticprivate

Definition at line 26 of file Plugins.cs.

◆ ReuseCompiled

const string Nuke.Cola.BuildPlugins.Plugins.ReuseCompiled = nameof(ReuseCompiled)
staticprivate

Definition at line 29 of file Plugins.cs.


The documentation for this class was generated from the following file: