I think I can now express the problem I am having with the Gradle build of Gant -- which only affects the tests, everything else seems fine.
Some of the Gant unit tests are actually system tests: in particular,
the tests for the Gant Ant task. The XML code used by the Ant process
spawned from the JUnit tests uses the <gant . . . > task. This means
that the location of the compiled classes of Gant has to be known.
Given that there is no fixed place for this (Gradle, Eclipse, IntelliJ
IDEA all have different locations for the compialtion products), the
location cannot be encoded in the XML. This means the only avenue of
communication is either the classpath or manually using an environment
variable. Until recently, Gradle, Ant, Gant, Eclipse, IntelliJ IDEA,
all ran the unit tests with the classpath being the classpath. i.e.
System.getProperty ( "java.class.path" ) was the classpath used to
execute the unit tests. Recently Gradle has changed the way things
happen and this property no longer contains the information it used to.
Specifically the classpath used to be something like:
/home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk_Development/bin:/home/users/russel/Repositories/Bazaar/Masters/Gant/Trunk_Development/jarfiles/maven-ant-tasks-2.0.10.jar:/home/users/russel/.m2/repository/org/apache/ant/ant/1.8.0/ant-1.8.0.jar:/home/users/russel/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar:/home/users/russel/.m2/repository/org/codehaus/groovy/groovy-all/1.8.0-beta-1-SNAPSHOT/groovy-all-1.8.0-beta-1-SNAPSHOT.jar:/home/users/russel/.m2/repository/org/apache/ant/ant-launcher/1.8.0/ant-launcher-1.8.0.jar:/home/users/russel/.m2/repository/org/apache/ivy/ivy/2.1.0-rc2/ivy-2.1.0-rc2.jar:/home/users/russel/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar
So this could be used to create an initial classpath for the spawned Ant
process and everything worked. It still does work this way with Eclipse
and IntelliJ IDEA. Gradle now has the property set as:
/home/users/russel/lib/JavaPackages/gradle-trunk/lib/gradle-core-0.9-20100301121152+0000.jar:/home/users/russel/lib/JavaPackages/gradle-trunk/lib/jul-to-slf4j-1.5.10.jar:/home/users/russel/lib/JavaPackages/gradle-trunk/lib/logback-classic-0.9.18.jar:/home/users/russel/lib/JavaPackages/gradle-trunk/lib/logback-core-0.9.18.jar:/home/users/russel/lib/JavaPackages/gradle-trunk/lib/slf4j-api-1.5.10.jar
and so does not contain the crucial information about where the code
under test and its dependencies are.
So it seems there is no general algorithm that can be employed from
within the unit tests to know the classpath with which to spawn the Ant
task :-(
If anyone has any ideas how to handle this, I'd appreciate it.
Thanks.
--
Russel.
=============================================================================
Dr Russel Winder Partner
xmpp: [email protected]
Concertant LLP t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road, f: +44 8700 516 084 voip: sip:[email protected]
London SW11 1EN, UK m: +44 7770 465 077 skype: russel_winder
signature.asc
Description: This is a digitally signed message part
