1
votes

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

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

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.

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

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

1

1 Answers

1
votes

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>

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