将 Eclipse 生成的 makefile 保留在版本控制中 - 会出现什么问题吗?

发布于 2024-08-19 00:38:36 字数 458 浏览 3 评论 0原文

我们在 Linux/Eclipse/C++ 下工作,使用 Eclipse 的“本机”C++ 项目 (.cproject)。该系统由几个 C++ 项目组成,所有项目都在 svn 版本控制下,使用集成的 subclipse 插件。

我们希望有一个脚本可以检查、编译和打包系统,而无需像现在一样从 Eclipse 手动驱动此过程。

我看到生成的 makefile 和支持文件(sources.mk、subdir.mk 等)分散在各处,它们不受版本控制(可能 subclipse 插件“聪明”足以排除它们)。我想我可以把它们放在 svn 下并在我们需要的脚本中使用。

然而,这感觉不稳定。有人试过吗?是否存在任何问题?有推荐的方法来实现我们的需求吗?

注意:我不相信采用另一个构建系统的想法会被很好地接受,除非它非常顺利。我们是一家由 4 名开发人员组成的小公司,全速前进,任何额外的开销或学习曲线都不会被赞赏:)

提前非常感谢!

we work under Linux/Eclipse/C++ using Eclipse's "native" C++ projects (.cproject). the system comprises from several C++ projects all kept under svn version control, using integrated subclipse plugin.

we want to have a script that would checkout, compile and package the system, without us needing to drive this process manually from eclipse, as we do now.

I see that there are generated makefile and support files (sources.mk, subdir.mk etc.), scattered around, which are not under version control (probably the subclipse plugin is "clever" enough to exclude them). I guess I can put them under svn and use in the script we need.

however, this feels shaky. have anybody tried it? Are there any issues to expect? Are there recommended ways to achieve what we need?

N.B. I don't believe that an idea of adopting another build system will be accepted nicely, unless it's SUPER-smooth. We are a small company of 4 developers running full-steam ahead, and any additional overhead or learning curve will not appreciated :)

thanks a lot in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

偏爱自由 2024-08-26 00:38:36

我不建议将外部工具生成的内容放入版本控制中。对于这种策略,我最喜欢的一句话是“版本是食谱,而不是蛋糕”。相反,您应该使用脚本之类的第三方工具来适当地操作 Eclipse,从源代码生成这些文件,然后编译它们。这可以避免这些自动生成的文件之一与您的根源不同步的风险。

我不确定你的“超级平滑”阈值是多少,但你可能想看看 Maven2,它有一个用于 Eclipse 项目的插件来执行此操作。

I would not recommend putting things that are generated in an external tool into version control. My favorite phrase for this tactic is "version the recipe, not the cake". Instead, you should use a third party tool like your script to manipulate Eclipse appropriately to generate these files from your sources, and then compile them. This avoids the risk of having one of these automatically generated files be out of sync with your root sources.

I'm not sure what your threshold for "super-smooth" is, but you might want to take a look at Maven2, which has a plugin for Eclipse projects to do just this.

卖梦商人 2024-08-26 00:38:36

我知道这是一个大问题(我也遇到过同样的问题;此外:在 svn 中维护构建工作空间真的很痛苦!)

我看到的问题:

  • 一旦有人添加或更改项目设置文件,您就会遇到问题但不会触发所有可能平台的新构建! (makefile 未更新)。
  • 没有总体的 make 文件,因此您无法轻松使用 Eclipse 计算出的项目构建顺序

BTW:我编写了一个 Eclipse 插件,它从给定的(文本)项目列表构建一个工作区,然后触发构建。这是可能的,但也不是一件容易的事。
不幸的是,我无法将插件发布到某个地方,因为我是为我的前雇主编写的......

I know that this is a big problem (I had exactly the same; in addition: maintaining a build-workspace in svn is a real pain!)

Problems I see:

  • You will get into problems as soon as somebody adds or changes project settings files but doesn't trigger a new build for all possible platforms! (makefiles aren't updated).
  • There is no overall make file so you can not easily use the build order of your projects that Eclipse had calculated

BTW: I wrote an Eclipse plugin that builds up a workspace from a given (textual) list of projects and then triggers the build. That's possible but also not an easy task.
Unfortunately I can't post the plugin somewhere because I wrote it for my former employer...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文