ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Building a source reference
Date Wed, 02 Oct 2002 11:59:47 GMT
I always just create two path references.  One I use for compilation and 
the other I use for testcases and javadoc.  Here is an example:


<path id="build.classpath">
     <!-- development libraries -->
     <fileset dir="${build.lib.dir}" >
         <include name="*.jar" />
         <exclude name="${jar.all.name}" />
         <exclude name="${jar.config.name}" />
         <exclude name="${jar.admin.name}" />
     </fileset>

     <!-- other development libraries -->
     <fileset dir="${build.jar.dir}" >
         <include name="*.jar" />
     </fileset>
</path>

<path id="build.test.classpath" >
     <pathelement location="${build.classes.dir}" />
     <pathelement location="${build.test.classes.dir}" />
     <path refid="build.classpath" />
</path>

I use <classpath refid="build.classpath" /> for compilation and for testing 
and javadoc I use <classpath refid="build.test.classpath" />.  Notice how 
build.test.classpath includes the newly compiled classes and includes a 
reference to build.classpath.

Does that help?

Jake


At 05:51 PM 10/1/2002 -0500, you wrote:
>I am still struggling with this and hope someone will shed the light.
>
>I want to do something like this (this is obviously not correct
>syntax!):
>
>   <path id="src.java">
>     <pathelement location="csourceweb/source"/>
>     <pathelement location="csourceweb/test" if="compile.tests"/>
>   </path>
>
>   <javac ...>
>     <src refid="src.java">
>
>What works and is the best practice for this (adding additional source
>directories for <javac> and <javadoc> source dirs based on a property)?
>Can someone please point me to the info in either the ant manual or Erik
>& Steve's book (or some other URL)?  I just cannot find the details (and
>have been trying a variety of things)...
>
>
> >>> JJENSEN@agribank.com 10/01/02 12:57PM >>>
>Hi,
>
>In the snippet below, what is the solution to get "src.java"
>shared/accessible in each target (<pathconvert> has to run only in a
>target, right?!)?
>
>And perhaps there is a better approach all around for javac & javadoc
>to access the same source info with the "test" dir included only when
>specified to...?
>
>
>   <fileset id="src.java.files" dir="csourceweb">
>     <include name="source/**/*.java"/>
>     <include name="test/**/*.java" if="compile.tests"/>
>   </fileset>
>
>   <pathconvert property="src.java" pathsep=","
>refid="src.java.files"/>
>
><target ...
>   <javac ...>
>     <src refid="src.java">
>
><target ...
>   <javadoc ...>
>     <sourcepath refid="src.java">
>
>
>--
>To unsubscribe, e-mail:
><mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
><mailto:ant-user-help@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message