You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Engel <di...@gwl.com> on 2001/03/14 01:06:16 UTC

Is there a way to echo an ant defined path?


Anyone,
  Is there a way to echo a path which I have generated with Ant 1.3?
  I have create a path id of project.class.path and would like to see
  the path.  If I used echo message all I get is the text and not the
  path ( <echo message="Class Path ${project.class.path}" />)






  <!--*********************************************-->
  <!-- set up the classpath                        -->
  <!--*********************************************-->
  <property name="jre.jar.dir" value="/home/d_keys/kypg/jdk/jre" />
  <property name="oracle.jar.dir" value="/home/d_keys/kypg/oracle/" />
  <property name="javax.jar.dir"
value="/home/d_keys/kypg/jdk1.2.2/javax/" />

   <path id="project.class.path" >
     <!--***********************-->
     <!-- Java, Servlets, JCE   -->
     <!--***********************-->
     <fileset dir="${jre.jar.dir}/lib" >
            <include name="**/*.jar" />
             <include name="**/ext/*.jar" />
     </fileset>
    <!--***********************-->
     <!-- XML, JCE              -->
     <!--***********************-->
     <fileset dir="${javax.jar.dir}">
            <include name="**/*.jar" />
     </fileset>

    <!--stuff deleted -->

      <!--***********************-->
     <!-- Local lib/classes     -->
     <!--***********************-->
     <pathelement location="lib/" />
     <pathelement location="classes/" />
  </path>

  <!--*********************************************-->
  <!-- Compiles using jikes                        -->
  <!--*********************************************-->
  <target name = "jikes" depends="prepare, mkdir" description="Compiles
using jikes.">
    <property name="build.compiler" value="jikes" />
    <echo message="Class Path ${project.class.path}" />
    <javac srcdir="${src.dir}"
           destdir="${basedir}/classes" >
  <classpath refid="project.class.path" />
     </javac>
  </target>


David Engel



Re: Is there a way to echo an ant defined path?

Posted by Stefan Bodewig <bo...@apache.org>.
David Engel <di...@gwl.com> wrote:

>   Is there a way to echo a path which I have generated with Ant 1.3?

Yes, transform it into a property first.

>   I have create a path id of project.class.path and would like to
>   see the path.

<property name="project.class.path" refid="project.class.path" />
<echo message="Class Path ${project.class.path}" />

Stefan