the main build.xml file calls the tests in the subdirs by going

   <ant antfile="test/build_ant.xml" />

This leaves the current directory as that of the main build file.

   <ant antfile="test/build_ant.xml" />

This is, well, usually not what is intended. It has some consequences in the
sub build file

  <path id="test-classpath">
    <pathelement location="${build.dest}" />
    <pathelement path="${java.class.path}" />
    <pathelement location="${java.home}/../lib/tools.jar"/>
    <fileset dir="../java/lib">
     <include name="*.jar"/>
    </fileset>
  </path>


This only works if the main build is in a directory called, java, because it
relies on ../java/lib resolving to ./lib. As my setup didnt do that,
everything broke. Now, I have fixed that configuration change on my system,
but the underlying problem "The axis build files are too brittle" remain.

1. everywhere you assign a filename or a dir name to a property, use
<property location> not <property value>. The latter just assigns a string,
the former resolves the property relative to the current project,
immediately.

2. Once you have paths resolving early, you can hand off the stuff in
subdirectories, thusly:

   <ant dir="test" antfile="build_ant.xml" />

Do that and file references in that invoked build file are all resolved
relative to their dir, not to the base dir.

I am going to patch the core build and test files with (1), but still leave
the existing build going with same-directory-ant calls. They can be fixed on
a case by case basis

-steve


Reply via email to