ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MikeO <michael.obereg...@cibc.ca>
Subject Re: Converting path to fileset issue.
Date Mon, 05 Nov 2007 16:10:54 GMT

This doesn't seem to be working for me. I am printing out the classpath
(using ant-contrib) with this code after the path task:

<pathconvert targetos="windows" property="printPath"
refid="project.class.path" pathsep=";" />
<echo> Your classpath: ${printPath}</echo>

and it displays nothing.

I tried something similar before, but from my experience, it seems that the
fileset task doesn't like dealing with semi-colon separated lists, and only
deals with single files/directories. In other words, this would work if my
properties file said:

classpath.jar.include=lib/*.jar

but once you add in a ; it no longer works. I think this is because fileset
is trying to treat the string as a single filename, rather than a list.
Maybe this works in later versions of ant? Right now, I am using ant 1.7.0. 

Thanks again,

Mike.


Dominique Devienne-2 wrote:
> 
> You're better off leveraging the includes attribute of fileset in this
> case IMHO.
> 
> ---- env.properties ----
> classpath.jar.include = \
>   lib/*.jar;\
>   lib/ext/*.jar;\
>   lib/config/*.jar
> 
> ---- build.xml extract ---
> <properties file="env.properties" />
> <path id="project.class.path">
>   <fileset dir="." includes="${classpath.jar.include}" />
> </path>
> 
> Forces to "list" all jars (well, uses patterns, so not exactly list),
> but specifying it this way is better anyway I think. --DD
> 
> PS: Note the use of forward slashes in .properties. Always prefer
> forward slashes in Ant.
> 
> 

-- 
View this message in context: http://www.nabble.com/Converting-path-to-fileset-issue.-tf4738646.html#a13589882
Sent from the Ant - Dev mailing list archive at Nabble.com.


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


Mime
View raw message