ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: AW: Showing current classpath Ant is using in Build executing state
Date Mon, 08 Oct 2007 10:41:31 GMT
Knuplesch wrote:
> Hello,
> 
> Depending on the task you use, you can define a lot of classpaths.
> I usually use the classpath or classpathref attribute to set the classpath e.g. for the
javac task.
> 
> The question is: For which task you need the classpath and how do you set the classpath??
> 
> This is how i trace the classpath, if it is stored in a refid:
>    <property name="ausgabejunit" refid="junit.classpath" />
>     <echo>Klassenpfad in junit: classpath=${ausgabejunit}</echo>
> 

Actually, you can skip the conversion by calling toString on the 
classpath (since ant1.6)


<echo>Klassenpfad in junit: classpath=${toString:junit.classpath}</echo>


We use <pathconvert> to split our classpath up with newlines before printing


	    <!-- to get the classpath in a printable form -->
	  <pathconvert pathsep="${line.separator}|   |-- "
	               property="echo.compile.classpath"
	               refid="compile.classpath">
	  </pathconvert>
           <echo message=" 
--------------------------------------------------------"/>
	  <echo message=" Project: ${ant.project.name}"/>
	  <echo message=" Ant file: ${ant.file}"/>
           <echo message=" Compile Class Path= ${line.separator}| 
|-- ${echo.compile.classpath}"/>	
	  <echo message=" 
--------------------------------------------------------"/>


-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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


Mime
View raw message