gbc tool syntax

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

Note:

If you are on Microsoft® Windows®, ensure you are using the legacy Command Prompt (cmd.exe) command-line utility to execute gbc instructions; do not use the Powershell command-line utility. If you are using a Genero Workplace Window, you are using the legacy Command Prompt (cmd.exe) command-line utility.

To run the gbc tool without commands:

gbc [ option [...] ]
Table 1. gbc options
-v, -V, --version Display the GBC version.
-h, --help Display help for the gbc command.
-d, --debug Output extra debugging.
The gbc tool supports three commands:

gbc build

The gbc build command builds the GBC.

gbc build [ option [...] ]
Table 2. gbc build options
-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 build.
-w, --watch Keep rebuild when sources change (default: false).
-D, --debug Output extra debugging (default: false).
-h, --help Display help for the gbc build command.

Examples

To build the customization project specified in the custom.json file:

$ gbc build 

To build the customization named "sample":

$ gbc build --customization sample 

To create a zip file of the "sample" customization (the compilation mode is taken from the custom.json file):

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

To set the compilation mode to "prod", and create a zip file of the "sample" customization:

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

To build the GBC project without any customization, and place the results in the gbc-project-dir/dist/web directory:

$ gbc build --no-customization 

gbc info

The gbc info command retrieves information about customizations.

gbc info [ command ] [ option [...] ]
Table 3. gbc info options
-h, --help Display help for the gbc info command.
Table 4. gbc info commands
buildnumber Returns the current build number in format 'BUILD=<buildnumber>' on the console.
help [ command ] Display help for the named command.

Example

To return the build number (not the version number) of the GBC project:

$ gbc info 

gbc clean

The gbc clean command cleans files in the project.

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

Examples

To remove all customization projects from the .cache/, archive/, and dist/ folders:

$ gbc clean

To remove all customization projects from the .cache/, archive/, dist/, and node_modules/ folders:

$ gbc clean all

To remove the "sample" project from the dist/ folder:

$ gbc clean dist --customization customization/sample 

To remove the dist/ folder and all its built projects:

$ gbc clean dist --all