It is possible to integrate the execution of GBS commands in development tooling like
editors, IDEs and buildmanagers.
The command that makes this possible is gbsstart_here.
It is a simplified version of the gbsstart command.
Typical commands are
The purpose of the gbsstart_here command is to be able to
execute a GBS command outside of a GBS context.
For this 2 things are needed:
The GBS context (The CWD)
The GBS command (with its parameters)
Most Development Environments and/or Editors allow you to specify multiple, named commands that will execute a
command-file in which currencies can be set via special codes and/or entries:
Current directory
Current selected file or even: list of selected files
Directory where to execute the command
Because GBS is now invoked from outside a GBS context the gbsstart_here
command must be invoked from the generic GBS startup directory GBS_BASE_PATH.
Linux
~/.gbs/gbsstart_here.sh
Windows
%APPDATA%\.gbs\gbsstart_here.bat
The gbsstart Command
When gbsstart_here cannot be used (because you do not have a CWD),
the more complex gbsstart command can be used.
The purpose of the gbsstart command is to be able to
execute a GBS command outside of a GBS context.
For this 2 things are needed:
The GBS context (i.e.: GBS_SYSTEM_PATH and possibly SubSystem, Component and/or Build)
The GBS command (with its parameters)
The positional parameters of gbsstart
allow you to specify the GBS context (System-spec, SubSys, Component and Build).
Specify '.' to take current (default)
Specify '-' to take none
The first parameter also allows for the special '!' and '!!' GBS_SYSTEM_PATH settings, giving the
following possibilities:
abs_or_rel_path
Means: Take abs_or_rel_path as GBS_SYSTEM_PATH (standard behaviour)
!
Means: GBS_SYSTEM_PATH is in Current Working Directory. (search the tree)
!abs_or_rel_path
Means: GBS_SYSTEM_PATH is inabs_or_rel_path. (search the tree)
!!
Means: GBS_SYSTEM_PATH is Current Working Directory. (No need to search)
The --exec parameter specifies the command that is to be executed.
No spaces are allowed here so you must use the special space notation
($_, %_ or %20).
Because GBS is now invoked from outside a GBS context the gbsstart
command must be invoked from the generic GBS startup directory GBS_BASE_PATH.
Linux
~/.gbs/gbsstart.sh
Windows
%APPDATA%\.gbs\gbsstart.bat
Crimson Editor
Location:
Tools → Conf.User Tools...
Command definitions:
Tools
On Windows GBS_BASE_PATH points to %APPDATA%\.gbs Be sure to mark:Capture output and Save before execute
Tools → Manage External Tools
The 'External Tools Manager' is started
For a new command click on the 'New' icon, in the lower left corner, just above the 'Help'
Press F6 to callup and execute the commands.
Press Ctrl+F6 to immediately execute the last selected command.
You can also place the commands in the Macro list with Plugins → Advanced Options...
Notes:
None
MS Visual Studio
As a Visual Studio project will be in a non-compliant GBS SubSystem, we cannot use the
gbsbuild, gbsaudit and
gbsmake
commands.
If you are using Visual Studio only as an editor in a Full GBS SubSystem, you can use these commands.
Location:
Tools
Command definitions:
Tools → External Tools...
On Windows GBS_BASE_PATH points to %APPDATA%\.gbs Be sure to mark:Use Output window