ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: How to Customize Relative Paths Read From Properties File
Date Tue, 02 May 2006 21:00:36 GMT
<path id="compile.classpath">
  <fileset dir="${local.dir}/lib" includes="${local.compile.libs}" />
  <fileset dir="${repository.dir}" includes="${repository.compile.libs}" />
</path>

with maybe changing your separator to the one 'includes' uses (space
and/or comma I think. I'm unsure it will accept semi-colon or colon).
This is slightly different from what you were doing, because it
requires the files dirs and files to exist before-hand, whereas
<pathelement path> does not.

See also the 'includesfile' attribute of <fileset> (and <patternset>). --DD

On 4/27/06, Michael Creech <mike@blueoaksoftware.com> wrote:
>
> I want to read some relative path elements from the contents of a properties
> file, and then create custom absolute paths from these elements by using a
> different directory then the base directory(which is what ANT wants to add).
>
> For example, if we had a properties file with:
>
>   local.compile.libs=mylib1.jar;mylib2.jar
>   repository.compile.libs=bos-utils.jar;junit.jar
>
> I'd want to generate the equivalent to:
>
> <path id="compile.classpath">
>   <pathelement location="${local.dir}/lib/mylib1.jar" />
>   <pathelement location="${local.dir}/lib/mylib2.jar" />
>   <pathelement location="${repository.dir}/bos-utils.jar" />
>   <pathelement location="${repository.dir}/junit.jar" />
> </path>
>
> where I prepend '${local.dir}/lib' and '${repository.dir}' to each path
> element read.
>
> Something that is close to doing the right thing is:
>
> <path id="compile.classpath">
>   <pathelement path="${local.compile.libs}" />
>   <pathelement path="${repository.compile.libs}" />
> </path>
>
> but the problem is that ANT will make these absolute paths
> based on base directory, which isn't what is desired.
>
> Is there some simple way to do this? Do I have to write a custom task?
> --
> View this message in context: http://www.nabble.com/How-to-Customize-Relative-Paths-Read-From-Properties-File-t1519027.html#a4123630
> Sent from the Ant - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message