Ceki Gülcü wrote:

> Robert,
>
> Sorry to be a PITA but what's this ANT classpath variable? I am afraid I am not 
>familiar with it. What does it accomplish? Ceki

sorry - i probably haven't been very clear. i'll try to explain what i meant.

ant allows named path-like structures to be declared in the xml. so, rather than using 
the ${CLASSPATH} environmental variable,
you can define a path towards the top of the file to be used. (this is the approach 
that turbine takes.) for example

<path id="classpath">
   <fileset dir="../lib">
       <include name="**/*.jar"/>
   </fileset>
</path>

sets up a path-like variable called "classpath" which includes all the jars in ../lib 
(doesn't have to be called classpath - could
be called fred or anything. classpath is the name used in the turbine build scripts 
and IMHO it seems a pretty good name to me).

you can then use this anywhere you need a (class)path rather than using the 
${CLASSPATH}  environment variable. for example

  <target name="swingCheck">
    <available classname="javax.swing.JTextPane" property="swing-present">
       <classpath refid="classpath"/>
    </available>
  </target>

and

  <target name="build.swing" depends="init, swing" if="swing-present">
    <mkdir dir="${classes}/icons"/>
    <copy todir="${classes}/icons">
      <fileset dir="icons"/>
    </copy>
    <javac srcdir="${srcdir}"
    destdir="${classes}"
    includes="${stem}/gui/*.java"
           excludes="**/JListView.java, **/JTableAppender.java">
       <classpath refid="classpath"/>
    </javac>
  </target>


the main advantage of this is that the build doesn't depend on the user's classpath 
environmental variable. this makes the build
much more portable.

hope this is a bit clearer.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to