问题描述
我正在用Eclipse构建嵌入式C ++项目。我想建立一个持续集成系统,在该系统中,每次对github存储库进行提交时,构建服务器都会编译并运行单元测试。
我的问题是C ++项目使用eclipse进行开发,但我不知道如何使用.cproject / .project来自动进行构建
我想我可能要使用生成makefile功能,但我不想重新生成每次我对.project或.cproject文件进行更改时,都会创建一个新的makefile。
有人有任何建议吗?
经过研究,我认为最好的方法是使用所谓的 headless build 。
$ eclipse \
--launcher.suppressErrors \ \
-nosplash \
-应用程序org.eclipse.cdt.managedbuilder.core.headlessbuild \
-数据/路径/到/工作区\
-cleanBuild项目/ configuration
上述命令的结果是从给定的给定项目配置中进行干净的构建
I am building an embedded C++ project with eclipse. I want to set-up a continuous integration system where a build server would compile and run unit tests each time a commit is made to the github repo.
My problem is that the C++ project uses eclipse for development and I don't know how to automate a build with a .cproject/.project the same way you would do it with a makefile and a CI framework like TravisCI or Jenkins.
I thought I about maybe using the "generate makefile" feature but I don't want to have to regenerate a new makefile each time I make a change on a .project or .cproject file.
Anyone have any suggestions?
After some research, I think the best approach is to use what is called a headless build. It takes the .project and .cproject and compiles it.
$ eclipse \
--launcher.suppressErrors \
-nosplash \
-application org.eclipse.cdt.managedbuilder.core.headlessbuild \
-data /path/to/workspace \
-cleanBuild "project/configuration"
The result of the above command is a clean build of the given project configuration from the given workspace.
http://gnuarmeclipse.github.io/advanced/headless-builds/
这篇关于C ++ Eclipse项目自动构建服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!