Skip to content

Command line usage

Greg Bowler edited this page Oct 19, 2023 · 4 revisions

The expected method of usage is through the command line. When this library is installed via composer, the project build command can be executed with vendor/bin/build. In WebEngine applications, you can use gt build.

The build command looks in the current working directory for a build.json configuration file, where the individual build tasks are listed. If you want to use a different configuration file, use the -c or --config argument. For example: build --config settings/php/build.json.

Environment-specific build files will be loaded automatically.

Watching for changes

Running the build command will perform a one-off build, iterating over each matching build task and executing accordingly. You can set the build command to "watch" for changes to the filesystem, and automatically execute another build whenever there's a change to the source files. This is done using the -w or --watch argument.

This is where the build tasks' file pattern comes in, which are covered in the next section.

Default config

Your project or framework can define a default build config that will be overridden by the content of your primary config file. For example, a framework can supply a build.default.json which defines a lot of standard web development build tasks, and your application's build.json can override individual tasks or introduce its own.

For more information, read the default config page.


In the next section, learn about build tasks.