Automated builds from the command line
Starting with Red Suite 3, you can run an automated build from the command line with Red Suite using the following instructions. Note that Red Suite 3 or greater is required - it will not work with Red Suite 2.
- Open a command prompt window
Execute the <product>Path.cmd batch file in the root of your installation directory. This sets up the paths so the compiler etc can be found by the tools.
Use the <product>c application with the following options (note the additional 'c' on the end of the excutable name, which indicates this is the command line version of the tool). Note 1: options are case sensitive. Note 2: replace <product> with your product name.
<product>c -nosplash
-application org.eclipse.cdt.managedbuilder.core.headlessbuild
-import {[uri:/]/path/to/project}
-build {project_name[/build_config] | all}
-cleanBuild {project_name[/build_config] | all}
-data /path/to/workspace- The '-application' switch instructs Red Suite to run the headless builder rather than starting the workbench. The other switches can be used individually or together. This means you can checkout a project using a script of your own, '-import' it into a workspace, and '-build' it using the headless builder.
- -import {[uri:/]/path/to/project}
- import a project from another location into the workspace before building. Path can be local file system, or a URI
- can be specified multiple times, to import multiple projects
- -build {project_name[/build_config] | all}
- -cleanBuild {project_name[/build_config] | all}
- build or 'clean' the project
- select which build configuration to use by by specifying /build_config immediately after the project_name (i.e. no spaces)
- Use the '-data' switch to specify the workspace to use, which can be an empty temporary directory
- The output from the build process will appear on the console, and can be redirected.
Example
To clean and build all the projects in the workspace c:\workspace\product, run the following command
RedSuite3c -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -cleanBuild all -build all -data c:\workspace\product
Note: This will build every build configuration (e.g. Debug and Release).
To clean and build the Release configuration of my_project (using Red Suite 4 or greater):
redsuitec -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -cleanBuild my_project/Release -build my_project/Release -data c:\workspace\product
Additional options in v4 or greater
- - Import projects : -import {[uri:/]/path/to/project}
- - Import all projects in the tree : -importAll {[uri:/]/path/to/projectTreeURI}
- - Build projects / the workspace : -build {project_name_reg_ex/config_name_reg_ex | all}
- - Clean build projects / the workspace : -cleanBuild {project_name_reg_ex/config_name_reg_ex | all}
