Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Build Process

mori edited this page Feb 6, 2020 · 2 revisions

Ceres has a relatively simple build process.

  1. 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.

  2. 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.lua file in the working directory and executes that. Then, it executes ceres.defaultHandler(), which parses script arguments and kicks off the default build process, unless ceres.suppressDefaultHandler() has been called in build.lua.

  3. 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 of mpq, dir, or script.

  4. 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 a war3map.lua script, and the --no-map-script option has not been passed, then the map's original script will also be included in the output.

  5. 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".

Clone this wiki locally