Peter G. Lane wrote:

I was just curious about the reasons behind having scripts on top of the ant build file. I personally would much rather have this done away with in favor of pure ant, but I don't know if there's something I don't know...you know?

the main reason was simplicity for out-of-box usage - no need to figure out ant version and classpaths (and in particular have no problems in running JUnit tests from inside ANT, see:


http://ant.apache.org/faq.html#delegating-classloader
http://ant.apache.org/manual/OptionalTasks/junit.html


and in general there is no 100% reliable way to execute junit tests from ant unless CLASSPATH is set before ant ...


but i agree that setting automatically classpath to build.xml is good idea and can help when you want just to use ant to build source tree (we should have some way to check for required ant version though ...)

something as simple as that should make it work:

<path id="project.classpath">
<pathelement location="."/>
<fileset dir=".">
<include name="lib/*.jar"/>
</fileset>
<pathelement location="${build.tests}"/>
<pathelement location="${build.samples}"/>
<pathelement location="${build.dest}"/>
<!-- this build file will utilize the classpath set in the users environment. -->
<pathelement path="${java.class.path}"/>
</path>


if it is fine with everybody i will make this modification.

thanks,

alek

--
"Mr. Pauli, we in the audience are all agreed that your theory is crazy. What divides us is whether it is crazy enough to be true." Niels H. D. Bohr





Reply via email to