Delphi项目尤其是ITE中的相对路径 [英] Relative paths in Delphi projects and ITE in particular

查看:94
本文介绍了Delphi项目尤其是ITE中的相对路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SVN存储库中有一堆带有一些公共库的项目。该存储库有一些生产版本的分支。

I've a bunch of projects with some common libraries in a SVN repository. The repository has some branches for in-production versions.

由于这个原因(在一台计算机上签出多个版本,并最大程度地减少了交换时间),我尝试使用存储库中的相对路径尽可能地配置所有项目。 (.... libraries-.dpr和库搜索路径中常见的表单)。

For this reason (checking out several versions on one computer, and minimizing swap time), I tried to configure all projects as much as possible with relative paths within the repository. (....\libraries\common for forms in .dpr and library searchpaths).

这不是100%理想的(如果归档,有时会感到困惑->打开并浏览到另一个目录,但是可以通过在rootdir(带有.dpr的目录)中打开文件来轻松解决。

This is not 100% ideal (it occasionally gets confused if you file->open and browse to a different dir, but that is easily solved by opening a file in the rootdir (the dir with the .dpr)).

但是现在我开始使用ITE我看到由资源向导构建的层次结构包含绝对路径。 (驱动器/完整/路径/到/结帐)。

But now I started to use the ITE I see that the hierarchy built by the resource wizard contains absolute paths. (drive/full/path/to/checkout).

某人有一个好的解决方案吗?特别是ITE位。搜索路径中是否有表示工作目录的宏?

Does sb have a good solution to deal with this? Specially the ITE bit. Are there macro's in search paths that denote the working dir?

P.s。我使用了视觉源安全,所以我知道了通常的技巧。我更喜欢在更改项目树时不采取任何措施的解决方案。 (将项目修改为使用相对路径是一次性的,并且可以签入,因此不会那么痛苦)

P.s. I've used visual sourcesafe so I'm aware of the usual subst tricks. I prefer a solution without any action on changing project trees. (the modifying of projects to use relative paths is one-off, and checked in, so not that painful)

Ps2项目内的情况(不是ITE,但很正常项目)可以通过在打开新项目之前始终关闭项目来消除。

P.s.2 the situation within projects (not ITE, but normal projects) can be defused by always closing projects before opening new ones.

推荐答案

我找到了部分解决方案。在第一个对话框中,您可以编辑根目录(通过打勾标记,可以启用 edit rootdir)。如果将rootdir设置为所有具有形式的目录的父目录,则IDE仍处于相对模式。

I found a partial solution. In the first dialogue you can edit the rootdirectory (by playing with the tickmark so that "edit rootdir" gets enabled). If you set the rootdir to a directory that is the parent of all dirs with forms, the IDE remains in "relative" mode.

这仍然不是完美的(现在)最终出现在rootdir而不是app dir中),但是至少这对分支有效。 (也许过一会儿就说一下.dproj甚至可以解决这个问题

This is still not perfect (it now ends up in the rootdir instead of the app dir), but at least this works with branches. (and maybe a bit postediting the .dproj will solve even this

更新:由于绝对路径仍然存在于每个.dfn中,因此这行不通。这只是IDE将看起来不错,因为该项目显示了IDE中的相对路径(.dfn中的路径已使用看来是rootdir的路径进行了纠正)

Update: this won't work, since the absolute path is still in every .dfn. It is just that the IDE will look nice, since the project shows the paths relative in the IDE (the paths in the .dfn are corrected with the rootdir path it seems)

这篇关于Delphi项目尤其是ITE中的相对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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