GBC build tool reference

Use the gbc tool to build and clean customizations. You must run this command while in a GBC project directory.

Syntax 1. Without commands.

gbc [ <option> [...] ]

To view the available options, see Table 1, gbc version, debug, and help options.

Syntax 2. With gbc commands (clean, info, build).

The gbc tool supports three commands: clean, info, and build.

gbc build [ <option> [...] ]

The gbc build command builds the GBC client. To view the available options, see Table 2, gbc build options.

gbc info [ <command> ] [ <option> [...] ] 

The gbc info command retrieves information about customizations. To view the available options and commands, see Syntax 3, With gbc info commands and Table 3, gbc info options and commands.

gbc clean [ <command> ] [ <option> [...] ] 

The gbc clean command cleans files in the project. To view the available options and commands, see Syntax 4, With gbc clean commands and Table 4, gbc clean options.

Syntax 3. With gbc info commands.

gbc info buildnumber [ -h | --help ]

The gbc info buildnumber command returns the current build number in format 'BUILD=<buildnumber>' on the console. The options display help for the command.

gbc info help { buildnumber }

The gbc info help command displays help for the named gbc info command.

Syntax 4. With gbc clean commands.

gbc clean tests [ -h | --help ]

The gbc clean tests command cleans test binary files in project. The options display help for the command.

gbc clean orig [ -h | --help ]

The gbc clean orig command cleans all *.orig files in the project. The options display help for the command.

gbc clean dependencies  [ -h | --help ]

The gbc clean dependencies command cleans 'node_modules/' folder in project. The options display help for the command.

gbc clean dist [ <option> [...] ]

The gbc clean dist command cleans a customization output or 'dist/web/' folder in project. To view the available options, see Table 5, gbc clean dist options.

gbc clean default [ -h | --help ]

The gbc clean default command cleans '.cache/', 'archive/' and 'dist/' folders in project. The options display help for the command.

gbc clean all [ -h | --help ]

The gbc clean all command cleans all dispendable folders in the project. The options display help for the command.

gbc clean help [ tests | orig | dependencies | dist | default | all ]

The gbc clean help command displays help for the named gbc clean command.

Options

Table 1. gbc version, debug, and help options.

gbc [ <option> [...] ]
Option Description
-v, --version Display the GBC version.
-h, --help Display help for the gbc command.
-d, --debug Output extra debugging.

Table 2. gbc build options.

gbc build [ <option> [...] ]
Option Description
-A, --all Build GBC without customization and each customization in customization folder in their default build output folders; --build-dist has no effect).
-C, --configuration <configuration> Build configuration file.
-c, --customization <customization-id> Build a specific customization. Supersedes the value set in file custom.json. Can take <customization-id> to explicitly build the given GBC customization in dist/<customization-id>, unless --build-dist is defined.
-nc, --no-customization Build ignoring specified customization (in config file); explicitly build GBC without customization in dist/web (unless --build-dist is defined).
-s, --customization-suffix <customizationSuffix> Set customization suffix.
-H, --html-cache Uses dated url suffix for resources (default: false).
-z, --create-zip Creates a runtime zip in the archive/ folder).
-m, --compile-mode <compileMode> Set compile mode: dev -- every file is provided separately; cdev (default) -- files are packed; prod-- files are packed and minified.
-d, --build-dist <buildDist> Set a build destination, a custom target build dirirectory relative to dist/ folder.
-t, --themes List themes to compile.
-w, --watch Keep rebuild when sources change (default: false).
-D, --debug Output extra debugging (default: false).
-h, --help Display help for command.

Table 3. gbc info options and commands.

gbc info [ <command> ] [ <option> ]
Option Description
-h, --help Display help for the gbc info command.
Command Description
buildnumber Returns the current build number in format 'BUILD=<buildnumber>' on the console.
help Display help for the specified gbc info command.

Table 4. gbc clean options.

gbc clean [ <command> ] [ <option> ]
Option Description
-D, --dry-run List only files that would be cleaned.
-h, --help Display help for command.
Command Description
tests Clean test binary files in project.
orig Clean '*.orig' files in project.
dependencies Clean 'node_modules/' folder in project.
dist [ <option> [...] ] Clean a customization output or 'dist/web/' folder in project. To view the available options, see Table 5, gbc clean dist options.
default Clean '.cache/', 'archive/' and 'dist/' folders in project.
all Clean all dispendable files in project.
help [ <command> ] Display help for the named command

NOTE: When run without any option or command specified, gbc clean erases the .cache/, dist/, and archive/ folders, as indicated by the command 'default'.

Table 5. gbc clean dist options.

gbc clean dist [ <option> [...] ]
Option Description
-c, --customization <customization> Clean a specific customization.
-a, --all Clean 'dist/' complete folder.
-h, --help Display help for command.

Examples

Examples - gbc build

$ gbc build

This example compiles the customization project specified in the custom.json file.

$ gbc build --all

Either example builds all customizations in the GBC project.

$ gbc build --customization sample

Either example compiles the customization named "sample".

$ gbc build --create-zip

Either example creates a zip file of the customization specified by the custom.json file.

$ gbc build --customization sample --create-zip

Either example compiles and creates a zip file of the "sample" customization. In this example, the compilation mode is taken from the custom.json file.

$ gbc build --customization sample --compile-mode prod --create-zip

Either example sets the compilation mode to "prod", and compiles and creates a zip file of the "sample" customization.

$ gbc build --no-customization

Either example compiles the GBC project without any customization, and places the results in the gbc-project-dir/dist/web directory.

Examples - gbc info

$ gbc info

This example returns the build number (not the version number, but the build number) of the GBC project.

Examples - gbc clean

$ gbc clean dist --customization customization/sample 

Either example removes the "sample" project from the dist/ folder.

$ gbc clean dist --all

Either example removes the dist/ folder and all compiled projects contained therein.

$ gbc clean

This example removes all customization projects from the .cache/, dist/, and archive/ folders.

$ gbc clean all

This example removes all customization projects from the .cache/, dist/, archive/, and node_modules/ folders.