将基于Eclipse / cdt的构建集成到持续集成中 [英] Integrating an eclipse/cdt-based build into continuous integration

查看:116
本文介绍了将基于Eclipse / cdt的构建集成到持续集成中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用CDT,mingw和cdt管理的构建功能(无外部makefile或构建环境)来重用当前在eclipse内部开发的主要C ++项目。该项目本身由许多子项目组成。

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.

我想将其集成到一个持续集成服务器(即jenkins)中,因此必须能够自动化

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

到目前为止,我设法签出了该项目(从jenkins轻松完成),并使用以下命令使用eclipse以无头模式进行了构建:

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

但是这还不够:


  • 构建是异步的:上一条命令返回(实际上是分叉的),而我希望它能保存上下文直到得到结果(就像在Linux上使用 make 或在Windows上使用 devenv 一样)
  • $ b
  • 我无法提取构建日志(理想情况是将其保存在文件中):集成wi精简我的连续信息,我需要能够解析我的构建日志以显示有趣的信息(考虑损坏的文件)

  • 理想情况下,我想从Eclipse获得直接状态(返回代码),指示通过或失败。

  • build is asynchronous : previous command returns (it forks actually) while I expect it to hold context until I have a result (like it would with make on linux or devenv on windows)
  • I was unable to extract the build logs (ideally have them in a file) : to integrate within my continuous information, I need to be able to parse my build logs to display interesting information (think about broken files)
  • Ideally, I'd like to get from Eclipse a direct status (return code) which indicates pass or fail.

任何想法如何出现这种情况?

Any idea how to have this behaviour ?

请注意:


  • 使用备用(外部)构建系统目前不可行(我必须保留cdt管理的构建,它有很多复杂的历史)

  • 尽管我的需求显然很简单,但我已经研究过堆栈溢出和google并没有设法找到方法

  • 我当前在Windows 7 / mingw 4.5.2 /用于C / C ++开发人员的Eclipse IDE中:Indigo发行版本ID:20110615-0604,但我认为问题是x平台

推荐答案

如果我以交互方式从cmd开始蚀,它会分叉,如果是从a开始蝙蝠脚本,事实并非如此。

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.

注意:


  • 您需要添加 -data 参数来定义工作台的位置(每次都会清理一次构建)

  • 和往常一样,怪罪于窗户并加引号。...

  • -launcher.suppressErrors :万一发生麻烦,防止日食显示弹出(实际上不显示,因此会阻止构建)

  • 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)

最终(工作!)命令:

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 

编辑


  • 已添加- launcher.suppressErrors

这篇关于将基于Eclipse / cdt的构建集成到持续集成中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆