Hooks

HEMTT supports hooks at various points in the build process. The hooks are written using Rhai. Rhai has an extension for VSCode that provides syntax highlighting.

Some example Rhai scripts can be found on the Rhai Playground. Additional commands can be requested as a GitHub Discussion.

Hooks are stored in the .hemtt/hooks/{phase} folders. The {phase} is the name of the phase that the hook is run in. The hooks are run in alphabetical order.

Example

.hemtt
└── hooks
    ├── pre_build
    │   ├── 01_example.rhai
    │   └── 02_example.rhai
    └── post_build
        ├── 01_example.rhai
        └── 02_example.rhai

Phases

There are 4 phases of the build process that can be hooked into:

HookFile System
pre_buildVirtual
post_buildVirtual
pre_releaseReal
post_releaseReal

pre_build

The pre_build hook is run before any preprocessing, binarization, or packing PBOs. This is the place to modify files that will be packed into the PBOs.

post_build

The post_build hook is run after all preprocessing, binarization, and packing PBOs. It is run before any release tasks.

pre_release

The pre_release hook is run before any release tasks. It is only run during the hemtt release command.

post_release

The post_release hook is run after all release tasks, and archives have been created. It is only run during the hemtt release command.