-
Notifications
You must be signed in to change notification settings - Fork 8
Build Process
Ceres has a relatively simple build process.
-
Arguments are parsed and the run mode is determined. A typical Ceres command will look like
ceres <command> [ceres args] -- <buildscript args>. Notice the double dash--. Arguments before it are arguments to Ceres itself, while everything else will be passed on as-is to the build script. -
Ceres initializes a Lua runtime with WC3-specific extensions and APIs. It then loads a Lua library with extra utilities and a default "build workflow". It then looks for a
build.luafile in the working directory and executes that. Then, it executesceres.defaultHandler(), which parses script arguments and kicks off the default build process, unlessceres.suppressDefaultHandler()has been called inbuild.lua. -
The default build workflow will try to determine the input map (
--map <mapname>), and an output type (--output <type>). The input map is what Ceres will use as a "base" for producing a new map, and can be in either MPQ or directory format. The output type can be one ofmpq,dir, orscript. -
Ceres compiles the map code, starting from
src/main.lua, including any modules required by it into the final map script, processing any macros it encounters. If the input map has awar3map.luascript, and the--no-map-scriptoption has not been passed, then the map's original script will also be included in the output. -
Depending on the output type, it will either write the map as a directory or an MPQ archive, or simply output the compiled script into
ceres.layout.targetDirectory .. "war3map.lua".