ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Getting the filename from a property
Date Fri, 01 Mar 2002 21:41:33 GMT
--- Erik Hatcher <> wrote:
> Your examples are working within what you've been given with the current
> version of Ant, and you are dealing with a "file" as if its a string,

Actually, I thought I was working with a file -name- as if it's a string,
which, coincidentally, it is. :)

> My blue-sky syntax, ${property,file,basename} is not scripty really,
> its saying that the underlying type of property is really and truly a
> file and just "formatting" the output as the base name, for example.

But it seems more scripty to me than current Ant lingo, since it doesn't
spell anything out. One thing you can definitely say about Ant is that
it's anything but terse -- ask anyone who's ever put together three
different targets because they can't say <target if="foo=bar" .../>

> Its not scripty to ask <tstamp/> for a date in a particular format -
> just a different visual representation of the same underlying thing.

But it's the very "visual representation" that makes yours seem scripty
(for Ant). I mean, if you want to make <property> more of a work-horse,
and have it deal with things like being told, eg., "consider this property
I'm derefencing as type 'file', retrieve its basename, and apply it as the
value of this new property I'm defining", that's okay -- but in order to
keep that functionality in line with how Ant currently goes about
representing that sort of thing, it seems to me it should be done with
attributes and nested elements.

> You're without a doubt a Unix shell scripting wiz.

Without a doubt -- but that's only because I happen to be a wiz at just
about everything :) 

> And you're not a Java programmer by day like most of the rest of us
> (self-confessed).

True -- at the moment, I'm not any kind of programmer by day (but if I
don't win the lottery soon, I may well need to go back to being one :)

But you shouldn't limit it just Java. I have no background in OO stuff at
all -- I started with BASIC (for a couple of days, to get the gist of what
"programming" was), jumped to assembler, then finally settled into C.

> Agreed.  I want <script> to be just like a task.

What is it you think it currently is? I've never seen it as anything else.

> Its our job to get those representations right so that a build file
> reads like someone telling you the steps of the build process [...]

But that was my point from the beginning -- that your proposed syntax
doesn't "read".

> And those same people that can't write a new task shouldn't be
> writing <script> either since they are essentially the same thing (even
> in your own words).

Can't agree there. If the pat answer for someone needing some new
functionality is going to be "write a task", and the person doesn't know
Java, but they do know one of <script>'s supported scripting languages,
then a script for <script> is exactly what they should be writing.

> And I agree with you, when there is no other option, its time to hack
> and make do with whats there - not any argument there.

Can't agree with you here, either -- I don't know what "hack" you think
has been getting done. I certainly don't see using the <script> task as a



Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message