简体   繁体   English

C ++ eclipse项目自动构建服务器

[英]C++ eclipse project automatic build server

I am building an embedded C++ project with eclipse. 我正在用eclipse构建一个嵌入式C ++项目。 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. 我想建立一个持续集成系统,每次向github仓库提交时,构建服务器都会编译并运行单元测试。

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. 我的问题是C ++项目使用eclipse进行开发,我不知道如何使用.cproject / .project自动化构建,就像使用makefile和像TravisCI或Jenkins这样的CI框架一样。

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. 我想我可能会使用“生成makefile”功能,但我不想每次在.project或.cproject文件上进行更改时都重新生成新的makefile。

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. 它需要.project和.cproject并编译它。

$ 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/ http://gnuarmeclipse.github.io/advanced/headless-builds/

You can rather use a custom Makefile project, than letting Eclipse building a Makefile for you. 您可以使用自定义Makefile项目,而不是让Eclipse为您构建Makefile。

You'll need to invest some time to develop a generic build system, that auto detects source files to be included to your build and handles all of their dependencies. 您需要投入一些时间来开发通用构建系统,该系统会自动检测要包含在构建中的源文件并处理所有依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM