Custom scripts or actions that need to be executed after the configuration files are loaded, but before source code or build steps begin.
Run custom scripts or actions before the source code is loaded. Useful for preparing the environment or modifying source files before they are processed.
Run custom scripts or actions after the source code is loaded. This is a good place for post-processing, validation, or generating additional files.
Run custom scripts or actions after the CMake process for the authserver is complete. Useful for post-build steps or integration tasks specific to the authserver.
Run custom scripts or actions after the CMake process for the worldserver is complete. Useful for post-build steps or integration tasks specific to the worldserver.
Run custom scripts or actions before the game library is built. Useful for setup, patching, or preparing dependencies.
Run custom scripts or actions after the game library is built. Useful for cleanup, packaging, or further automation after the main build is done.
In includes.sh under the compiler folder, is where you have register your hook.
This and below can be in bash or in CMake syntax.
function my_hook_function() {
echo "Custom action!"
}
Always the function first, before registering th hook, otherwise there's nothing to register.
registerHooks "AFTER_SRC_LOAD" my_after_src_load_function
When registering the hooks, you've to choose what compiler hooks to use (AFTER_LOAD_CONF
, BEFORE_SRC_LOAD
, AFTER_SRC_LOAD
, AFTER_AUTHSERVER_CMAKE
, AFTER_WORLDSERVER_CMAKE
or BEFORE_GAME_LIBRARY
) than you tell what function to be associated to each compiler hook.
function after_src_load_hook() {
echo "Source code loaded!"
}
function after_game_library_hook() {
echo "Game library build complete!"
}
registerHooks "AFTER_SRC_LOAD" after_src_load_hook
registerHooks "AFTER_GAME_LIBRARY" after_game_library_hook
You don't, it's ran automatically in functions.sh under the compiler folder.
You will use the: AFTER_LOAD_CONF
, BEFORE_SRC_LOAD
, AFTER_SRC_LOAD
, AFTER_AUTHSERVER_CMAKE
, AFTER_WORLDSERVER_CMAKE
or BEFORE_GAME_LIBRARY
is currently unimplemented.
runHooks "AFTER_SRC_LOAD"
).function after_game_library_hook() {
echo "Game library build complete. Running post-build steps!"
tar -czf "$BINPATH/game_library.tar.gz" "$BINPATH/game_library.so"
}
registerHooks "AFTER_GAME_LIBRARY" after_game_library_hook
This will grab your build output directory (example: /home/user/build
) under the variable name: $BINPATH
, after the game library
is finished building the hook will zip/package library file into a .tar.gz
in your build folder.