您是否将构建工具保持在版本控制中? [英] Do you keep your build tools in version control?

查看:19
本文介绍了您是否将构建工具保持在版本控制中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否保留在版本控制下构建项目所需的工具?

Do you keep tools that are necessary to build your project under version control?

如果您这样做了,您对包含哪些工具的指导方针是什么?我想没有人将 Visual Studio 置于版本控制中,但是您的单元测试运行器呢?Nant/Ant/Maven 可执行文件?

If you do, what are your guidelines for which tools to include? I guess noone puts Visual Studio in version control, but how about your unit-test-runner? The Nant/Ant/Maven executable?

外部依赖怎么样?你在版本控制中有 Boost 吗?JDK?NUnit/JUnit?你在这里画的极限在哪里?

How about external dependencies? Do you have Boost in version control? The JDK? NUnit/JUnit? Where do you draw the limit here?

(另见这个问题).

我想我的问题并不完全清楚:我不想知道您是将它们保留在版本控制中还是某些共享驱动器中.我真的很想知道您是否检查了将项目构建到版本控制中所需的工具与项目一起,这样当您检查项目时,您会自动获得这些工具.

I guess my question was not completely clear: I did not want to know whether you kept them in version control vs. or some shared drive. I really wanted to know whether you checked the tools necessary for building a project into version control together with the project, so that when you checked the project out, you would automatically get the tools.

作为对回答否"的人的一般跟进:您跟踪这些工具的过程是什么?你的脚本会下载它们吗?

As a general follow-up to those who answer no: what is your process for keeping track of those tools? Do your script download them?

推荐答案

对此有两种流派:

  1. 只需您的源代码放入存储库.
  2. 将构建软件所需的一切(不包括操作系统和语言运行时)放入存储库.
  1. Put just your source code into the repository.
  2. Put everything someone would need to build your software short of the operating system and language runtime into the repository.

我个人更倾向于#2,因为它让别人更容易上手并运行我的代码.无论如何,我会争辩说,如果您选择第一种方法,您至少应该使一个人可以获得第 2 点所需的东西和您的源代码一步,即使如果不一定通过版本控制.

I personally tend more towards #2 because it makes it easier for someone to get up and running with my code. At any rate, I would argue that if you opt for the first method, you should at least make it so that a person can get the things required by point 2 and your source code in one step, even if not necessarily by version control.

不幸的是,构建系统是一个灰色地带.我个人将它排除在外,除非我使用的是晦涩或非标准的东西.什么是晦涩的和非标准的由您工作的环境决定.例如,如果您的公司总是使用 MSBuild,但出于任何原因决定在这个项目中使用 Nant,那么我会包括它.

Unfortunately, the build system is kind of a grey area. I personally leave it out unless I'm using something obscure or non-standard. And what's obscure and non-standard is dictated by the environment you work in. For example, if your company always uses MSBuild but decided to use Nant for whatever reason on this one project, then I'd include it.

这篇关于您是否将构建工具保持在版本控制中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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