ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Akbar Ibrahim" <>
Subject Re: Problem with Property Task
Date Mon, 10 Jul 2000 08:34:04 GMT

----- Original Message -----
From: <>
To: <>
Sent: Monday, July 10, 2000 10:48 AM
Subject: Re: Problem with Property Task

> Akbar Ibrahim writes:
>  > Well, changing C:/ and D:/ to C:\ and D:\ made it work (with ant3.1 and
>  > classpath concatenation). But I don't understand why. Earlier it worked
>  > C:/ but when I added D:/ it didn't, and when that is changed to C:\ and
>  > it works :(  Maybe I can try to have a look at the "/" and "\" anomaly
>  > send in a patch.
>  >
>  > I agree about the case where ant is run as an inner instance of another
>  > so overriding property values should not be allowed. Couldn't each
>  > target/Task have properties of it's own which it can choose to change
or do
>  > whatever it wanted with and which wouldn't affect the outer version of
>  > property.
>  >
>  > I feel that there should be a way to allow properties, or specifically
>  > paths, to be built incrementally in this, or some other, manner. I hate
>  > have classpaths running to several lines (and wrapping around in the
>  > editor). I like to have each path in the classpath to be on a separate
>  > This make it very clear and easy to edit. If all the paths are in one
>  > line it is very difficult to read/edit and easy to make mistakes.
> Doing this implicitly is, IMHO, not the way to do it.
> <property name="classpath" value="C:\"/>
> <property name="classpath" value="D:\"/>
> <property name="classpath" value="C:\lib"/>
> <property name="classpath" value="C:\classes\jaxp.jar"/>
> does not, to me, look as though it should concatenate all these
> values; it looks like a mistake which will end up with ${classpath}
> evaluating to "C:\classes\jaxp.jar". Doing it this way is pretty
> counter-intuitive, I reckon.

(Tom, maybe you are thinking aloud - suggesting a new method and vetoing it
yourself - or you have got my way of concatenating classpaths wrong.
Assuming the latter, apologies if it is the former, here goes...)
That was not how I was doing it. My code looked like

<property name="classpath" value="C:\"/>
<property name="classpath" value="${classpath};D:\"/>
<property name="classpath" value="${classpath};C:\lib"/>
<property name="classpath" value="${classpath};C:\classes\jaxp.jar"/>

This is intuitive and is exactly how it is done in Unix/Dos shells. Though
that should not be a reason why it should be done this way in ant too. There
*must* be some better way to do it.

> But you're right, wrapped classpaths are
> ugly. Is syntax like:
> <property name="classpath" value="C:\;\
> D:\;\
> C:\lib;\
> C:\classes\jaxp.jar"/>
> recognized, or is that deemed to make-like? ;-)

I don't think this is (or should be) recognized. Anyway, this is not good to
look at either. And there would be umpteen other (superior) ways to acheive
the same effect in XML.

> Regards
> Tom
> --
> Tom Cook - Software Engineer


View raw message