ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Path, refid, <src>
Date Fri, 26 Apr 2002 18:40:19 GMT
As Diane pointed out, <path> is normally a collection of ordered
directories, not of individual files. <classpath> conceptually is also a
<path> which can contain JAR and ZIP files. In your example, your <path
id="framework.src"> should be a <fileset>, since it appears to be the files
you want to compile. By the way, your second <include> for
AbstractAppServer.java looks suspicious. If the class name if
client.AbstractAppServer instead of eshop.src.client.AbstractAppServer, then
your include is probably wrong...

Assuming you have sources in:
${base.dir}			for your "framework" package
				(should be "com.versant.framework"?!)
${base.dir}/eshop/src	for the "client" package of the eshop module

Your <javac> task should look something like this:

<javac destdir="${out.classes.dir}"
       failonerror="true"
       debug="${debug}"
       deprecation="${deprecation}"
       optimize="${optimize}">
  <classpath path="${project.class.path}"/>
  <src path="${base.dir}" />
  <src path="${base.dir}/eshop/src" />
  <include name="framework/**" />
  <include name="client/**" />
</javac>

What people normally do is compile all the sources under a single "src" or
"sources" directory. Also, the <classpath> inside the <javac> task usually
refers to another one defined elsewhere with an id, and it's refid'd.

Anyways, I hope this helps. --DD

-----Original Message-----
From: Gurdev Parmar [mailto:gparmar@versant.com] 
Sent: Friday, April 26, 2002 12:42 PM
To: Ant Users List
Subject: Path, refid, <src>

Hi,
my build.xml has something like this:

<project ......>
 ........
.........

<path id="framework.src">
    <fileset dir="${base.dir}">
    <include name="framework/*.java"/>
     <include name="eshop/src/client/AbstractAppServer.java"/>
   </fileset>
</path>

    <target name="framework"
            description="Creates framework.jar in install directory">
        <javac destdir="${out.classes.dir}" failonerror="true"
               debug="${debug}" deprecation="${deprecation}"
optimize="${optimize}">
            <src refid="framework.src"/>
            <classpath path="${project.class.path}"/>
        </javac>
        ............
    </target>
..........
..........
</project>

Now, I get the following error 
n:\gsp_v\test\syseng\java\bin\build.xml:251:
N:\gsp_v\test\syseng\java\framework\AbstractTestClient.java is not a
directory.

Isn't path id supposed to be used to have a template of a set of files?
Or is it for a template of directories? If it is for directories, why was it
done
like that?

Is this a bug? I am using: Ant version 1.4.1 compiled on October 11 2001.

Thanks in advance,
Gurdev

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message