Show / Hide Table of Contents

    Event Handlers

    Adding event handlers to your module will be required in the majority of cases as they are the mechanism through which you can listen to different events happening on the Build Automatore core, and hence can inject your own behaviour to execute on these events.

    All event handlers can be found under the namespace QFSW.BA.EventHandlers and inherit from the IBuildEventHandler interface. To add an event handler to your module, simply implement the corresponding interface; you may implement as many event handlers as you need on a single module.

    Tip

    If you believe any event handlers are missing that you would like to utilise, please send a request to support.

    After Build Automator is finished loading all of the defined modules, it will scan each module for any event handlers and subscribe them to the appropriate event sources.

    Note

    Modules will have their event handlers initialized in ascending order of their EventCallbackOrder: this allows you to control the timing of your module's event handler if it is necessary to be executed before or after specific modules. If in doubt, leave this as default.

    Example

    The following is an example module that implements IBuildPlatformStart to log that a build has begun.

    public class LogOnBuildStartModule : HiddenModule, IBuildPlatformStart
    {
        public override string ID => "qfsw.docs.event-handler";
    
        public void OnBuildPlatformStart(Platform platform, BuildSettingsPackage settingsPkg)
        {
            Debug.Log($"Begun building {platform.PlatformName}");
        }
    }
    
    Build Automator 2 by QFSW
    Back to top