NAnt:检查包含文件是否已包含
有人知道检查文件是否已包含的方法吗?
<include buildfile="${script.dir}\util.include.nant" />
.
.
.
.
<include buildfile="${script.dir}\util.include.nant" />
这将引发目标重复的异常。有办法解决吗?
提前致谢
Does anybody know a way to check if a file was already included?
<include buildfile="${script.dir}\util.include.nant" />
.
.
.
.
<include buildfile="${script.dir}\util.include.nant" />
This will throw an exception that a target was duplicated. Is there a way around?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
刚刚看到这个问题,它似乎相关,并决定更改其中一个重复项的大小写a.build 在我的另一个答案中:
Boom - 重复目标错误。看起来 nant 足够聪明,可以忽略重复的包含,但在比较它们时区分大小写。
Just saw this question which seems related and decided to change the case of one of the duplicate includes in a.build in my other answer to:
Boom - duplicate target error. Looks like nant is bright enough to ignore duplicate includes, but is case sensitive when comparing them.
这个最小的例子在 nant 0.86.3075.0 中对我来说工作正常:
在这个例子中,a.build 和 b.build 都包含 c.build 多次。 a.build 和 b.build 也相互包含,但不依赖于彼此的目标,因为这会产生循环依赖。
请注意在项目级别使用 echo - 这些似乎是在包含文件时出现的,这可能会帮助您调试问题。
a.build:
b.build:
c.build:
输出:
This minimal example works OK for me in nant 0.86.3075.0:
In this example, a.build and b.build both include c.build multiple times. a.build and b.build also include each other, but do not depend on each other's targets as this creates a circular dependency.
Note the use of echo at project level - these seem to come out as the files are included, which may help you debug your issue.
a.build:
b.build:
c.build:
output: