使用 svnant 更新 build.xml 文件所在的目录是否安全?

发布于 2024-10-04 18:57:40 字数 173 浏览 2 评论 0原文

我正在维护一个构建系统,该系统使用一个目录中的 svnant 来更新另一个目录中的大量项目。然后它会转移到已更新的项目之一,并进行实际的构建。

完成该主要项目中的所有操作是否安全?主项目是否可以使用 svnant 来更新自身,或者如果 svn 需要更新 ant 当前使用的 build.xml 文件,是否会出现问题?

I'm maintaining a build system that uses svnant from a one directory to update a large number of projects in another directory. It then moves to one of those projects that's been updated, and does the actual build.

Is it safe to do everything from that main project? Can the main project use svnant to update itself, or could there be a problem if svn needs to update the build.xml file that ant is currently using?

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

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

发布评论

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

评论(2

烈酒灼喉 2024-10-11 18:57:40

对于自我更新的主项目 build.xml - 您可能在一次性运行 subversion 更新和构建时遇到问题。问题的性质取决于对 build.xml 所做的具体更改。只需重新运行构建就可能修复它,因为启动时加载的 build.xml Ant 将会是最新的。

如果您确实必须可靠地更新 build.xml 并一次性执行构建,您可能会考虑将构建的 post-svnant 部分包装在 antcall 任务。当 Ant 运行 antcall 的目标时,它会重新读取 build.xml,因此自调用 Ant 以来对该文件所做的任何更改都会被考虑在内。 Antcall 从头开始​​处理,因此如果您进行了(可能昂贵的)初始化,则需要再次运行这些初始化。

For the self-updated main project build.xml - you might have a problem with running the subversion update and build in one go. The nature of the problem depends on exactly what change is made to the build.xml. Simply rerunning the build would probably fix it, as the build.xml Ant then loads at start up would be up-to-date.

If you really have to reliably update build.xml and carry out a build in one go, you might consider wrapping the post-svnant part of the build in an antcall task. When Ant runs the antcall'ed target, it re-reads the build.xml, so any change to that file since Ant was invoked is taken in to account. Antcall starts processing from scratch, so if you have (possibly expensive) initialisations these would need to be run again.

转身以后 2024-10-11 18:57:40

如果这不会占用太多磁盘空间(如果磁盘空间不是问题),您可以有两个工作目录:

  • 一个用于“svnant”您想要的任何内容,
  • 一个用于启动构建,除非任何启动之前都会有一个 rsynch,以便将任何修改从第一个工作目录导入到第二个工作目录。

换句话说,您将在启动任何构建之前修改。

If that doesn't take too much disk space (of if disk space is not an issue), you could have two working directories:

  • one where you 'svnant' anything you want
  • one where you launch the builds, except any launch would be preceded by a rsynch in order to import any modifications from the first working directory to the second one.

In other word, you would pull the modifications before launching any build.

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