2.18 Using Eclipse from the command-line to clean and build your projects

You can run Eclipse from the command-line to clean and build your projects. This might be useful, for example, when you want to create scripts to automate build procedures.

Procedure

  1. Launch a DS-5 command-line console to load Eclipse, make, and other utilities on your PATH environment variable. To do this:
    • On Windows, select Start > All Programs > ARM DS-5 > DS-5 Command Prompt.
    • On Linux, run <DS-5 install_directory>/bin/suite_exec <shell> to open a shell.
  2. Run eclipsec.exe (on Windows) or eclipse (on Linux) with the following Eclipse arguments as required.

    Table 2-1 Eclipse arguments

    Argument Description
    -nosplash
    Disables the Eclipse splash screen.
    --launcher.suppressErrors Causes errors to be printed to the console instead of being reported in a graphical dialog.
    -application org.eclipse.cdt.managedbuilder.core.headlessbuild Mandatory argument telling Eclipse to run the headless builder.
    -data {workspaceDir} Specify the location of your workspace.
    -import {projectDir}
    Import the project from the specified directory into your workspace.
    Use this option multiple times to import multiple projects.
    -import {projectDir}
    Import the project from the specified directory into your workspace.
    Use this option multiple times to import multiple projects.
    -build {projectName[/configName] | all}
    Build the project with the specified name, or all projects in your workspace.
    By default, this argument builds all the configurations within each project. You can limit this action to a single configuration, such as Debug or Release, by specifying the configuration name immediately after your project name, separated with '/'.
    Use this option multiple times to build multiple projects.
    -cleanBuild {projectName[/configName] | all
    Clean and build the project with the specified name, or all projects in your workspace.
    By default, this argument cleans and builds all the configurations within each project. You can limit this action to a single configuration, such as Debug or Release, by specifying the configuration name immediately after your project name, separated with '/'.
    Use this option multiple times to clean and build multiple projects.

Example 2-1 Examples

To list and view the full set of available options, use the command:
eclipsec.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild
To clean and build all the projects in a workspace at the C:\workspace location, use the command:
eclipsec.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data C:\workspace -cleanBuild
To build the Release configuration of project MyProject in workspace C:\workspace, use the command:
eclipsec.exe -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data C:\workspace -build MyProject/Release
Non-Confidential - BetaPDF file icon PDF versionARM DUI0478U
Copyright © 2010-2015 ARM. All rights reserved.