Follow up;

Looking further, I found that the foo/dto package does have a dependency to
foo/util/Bar.java ... So that part does make sense too.

But I still don't see the difference between running directly and using the
wrapper.

Still confused,
boz

On 6/12/06, Christofer Jennings <[EMAIL PROTECTED]> wrote:

I'm having trouble with basedir (I think).

It all started with me trying to run a build.xml script from cruisecontrol
(CC). CC uses wrapper scripts to run project builds. I've run the wrapper
without CC and got the same results, so it's not CC. The wrapper build file
looks like this...

<project name="foo build wrapper" default="build" basedir="projects/foo">
    <target name="build">
       <echo message="path right now is ${java.library.path}" />
        <!-- Get the latest from CVS -->
        <cvs command="up -d -P"/>
        <!-- Call the target that does everything -->
        <ant antfile="build.xml" target="clean"/>
        <ant antfile="build.xml" target="common.compile"/>
    </target>
</project>

This works fine for my other projects, but for foo I get weird results. So
I think maybe it has to do more with foo's build file than the wrapper.Foo's
build has lots of stuff in it, so I'll try to limit it here...

<?xml version="1.0"?>
<project name="Foo Builder" default="usage" basedir=".">

  <target name="init">
    <property file="build.properties"/>

    <tstamp/>

    <property name="root.dir" value="."/>
    <property name="lib.dir" value="${root.dir}/lib"/>

    <property name="src.dir" value="${root.dir}/src"/>
    <property name="web.dir" value="${src.dir}/web"/>
    <property name="java.dir" value="${src.dir}/java"/>

    <property name="build.dir" value="${root.dir}/build"/>

    <property name="common.dir" value="${build.dir}/common"/>
    <property name="common.classes" value="${common.dir}/classes"/>

    <property name="wl.home" value="${beahome}/weblogic91"/>
    <property name="wl.lib" value="${wl.home}/server/lib"/>

    <taskdef name="wlappc" classname="weblogic.ant.taskdefs.j2ee.Appc"
classpath="${wl.lib}/weblogic.jar"/>
    <taskdef name="autotype" classname="
weblogic.ant.taskdefs.webservices.javaschema.JavaSchema"
             classpath="${wl.lib}/weblogic.jar"/>

    <path id="common.classpath">
      <fileset dir="${lib.dir}">
        <include name="log4j.jar"/>
        <include name="dfc2-client.jar"/>
        <include name="jdc21-client.jar"/>
      </fileset>
      <pathelement path="${common.classes}"/>
    </path>
  </target>

  <target name="clean" depends="init">
    <delete dir="${build.dir}" includeEmptyDirs="true"/>
  </target>

  <target name="prepare" depends="init">
    <mkdir dir="${build.dir}"/>
  </target>

  <target name="common.compile" depends="prepare">
    <mkdir dir="${common.classes}"/>
    <javac srcdir="${java.dir}" destdir="${common.classes}">
      <classpath refid="common.classpath"/>
      <include name="foo/dto/*.java"/>
    </javac>
  </target>

</project>

So, on to the problem. When I run foo's build directly it works fine, but
when I use the wrapper build I get ...

C:\cc\projects\foo\src\java\foo\util\Bar.java:7: package javax.ejb does
not exist
import javax.ejb.CreateException;
^

It makes no sense to me. Why would something in foo/util be compiled when
javac clearly is et to <include name="foo/dto/*.java"/>?

I tried not using basedir in the wrapper build file. But then the taskdefs
don't load... which does make sense to me.

Any insights would be much appreciated.

Thanks in advance,
boz


Reply via email to