且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在&QUOT执行ANT;验证"模式

更新时间:2022-06-25 08:57:29

使用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