Bruce
Bruce

Reputation: 7132

Integrating an eclipse/cdt-based build into continuous integration

I have to reuse a major C++ project which is currently developed inside eclipse, using CDT, mingw and cdt managed build feature (no external makefiles or build environment). The project itself is composed of many sub-projects.

I want to integrate that build into a continuous integration server (jenkins namely) and have thus to be able to automate the headless build.

So far, I managed to checkout the project (easy from jenkins) and have it build in a headless mode using eclipse, using the following command:

C:\prog\EclipseCdt\eclipse -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import %WORKSPACE%\project1 -import %WORKSPACE%\project2 -import %WORKSPACE%\project3 -build all

It's however not enough:

Any idea how to have this behaviour ?

Note that:

Upvotes: 9

Views: 4541

Answers (1)

Bruce
Bruce

Reputation: 7132

it looks like if I start eclipse from a cmd interactively,it forks, if started from a bat script, it doesn't. so putting the previous line in jenkins was enough to do the trick.

Notes:

  • you need to add -data parameter to define location of your workbench (I clean build each time)
  • as usual, blame windows and put quotes....
  • --launcher.suppressErrors : in case something goes awoc, prevents eclipse from displaying a pop up (which is actually not displayed, thus blocks build)

Final (working !) command:

C:\prog\EclipseCdt\eclipse --launcher.suppressErrors -nosplash -data "%WORKSPACE%" -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import "%WORKSPACE%\project1" -import "%WORKSPACE%\project2" -import "%WORKSPACE%\project3" -build all 

EDIT

  • added --launcher.suppressErrors

Upvotes: 7

Related Questions