在&QUOT执行ANT;验证"模式 [英] execute ANT in "Validation" mode

查看:126
本文介绍了在&QUOT执行ANT;验证"模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以执行Apache Ant的一个验证颂歌构建工具?

Is it possible to execute Apache Ant build tool in a validation ode?

例如处理build.xml文件并展开所有$ {}变量等,但没有实际构建目标Java项目?

e.g to process a build.xml file and expand all the ${} variables etc but not actually build the target java projects?

我只需要完整的XML构建文件的所有替换完成,这样我可以看到的来源和jar文件的确切位置等。

i just need the completed xml build file with all the substitutions completed so that i can see the exact locations of source and jar files etc.

让喜欢的条目VALUE =$ {} aaa.bbb.cc /Impl.jar/>

so that entries like "value="${aaa.bbb.cc}/Impl.jar"/>"

被扩展为VALUE =AnApplication / lib目录/ impl.jar文件/>

are expanded to "value="AnApplication/lib/Impl.jar"/>"

推荐答案

使用checktarget,做一些呼应的真正的东西来代替,F.E.结果

use a checktarget that does some echoing instead of the real stuff, f.e.

<target name="checkproperties" depends="init,etc.../>
 <echoproperties prefix="aaa"/>
 <echo>
  ${aaa.bbb.cc}/Impl.jar
  ${dist.dir}
  ${src.dir}
  ${build.dir}
  ${whatever}
  ...
 </echo>
</target>

,然后调用与蚂蚁-f yourbuildfile checkproperties结果你buildscript
打电话给你,而不是checktarget用它运行您的构建文件的真实目标结果
只要确保你的目标checkproperties具有相同的依赖关系图作为您的实际工作的目标,结果得到同样的propertyvalues​​你真正的目标将获得

and then call your buildscript with ant -f yourbuildfile checkproperties
to call your checktarget instead of running your buildfile with it's real target
just make sure your checkproperties target has the same dependency graph as your real working target,
to get the same propertyvalues your real target would get

这篇关于在&QUOT执行ANT;验证&QUOT;模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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