A file named API_VERSION
may exist at the grimoire level and/or the section level. In this file one variable may be defined: BUILD_API
.
This variable may be given the values '1' or '2'. To denote which build API the grimoire or section uses.
In addition BUILD_API
may also be defined in a spell's DETAILS file.
API_VERSION
file must have the executable bit set (so a test -x
passes).
The files are sourced in the following order:
$GRIMOIRE/API_VERSION
$SECTION/API_VERSION
$SPELL/DETAILS
Thus the section level will override the grimoire level and the spell level will override the section and grimoire levels.
If the BUILD_API
variable is not defined the behavior defaults to it being defined as '2'.
A quick rundown of what '1' and '2' mean:
Build API 1:
PRE_BUILD → BUILD → POST_BUILD → POST_INSTALL → TRIGGERS
Build API 2:
PRE_BUILD → BUILD → PRE_INSTALL → INSTALL → INSTALL_EXTRAS → POST_INSTALL → TRANSFER → FINAL → TRIGGERS
Note: do not write spells in build API 1, use build API 2 instead!