You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Stein, Ben" <Be...@xerox.com> on 2005/01/28 16:54:59 UTC

PropertyFile task is optional?

Last night I tried to use the PropertyFile task.  Unfortunately I got the error that ant could not find the task.  seeing that it was an optional task I looked at the library dependencies table in the manual.  Unfortunately there was no mention of the task.  I then went on a three hour quest on google looking for the jar.  This morning I realized that I misspelled the task by capitalizing the 'F' in the name, and found out that the propertyfile task is in the standard ant distribution.  Before people start replying, "hey dummy, xml is case sensitive"  I would like to ask the following:

	If PropertyFile is in the standard ant distribution for 1.6.2 then why is it an Optional task?
	If It really is an optional task then why isn't it mentioned in the library dependencies table in the manual?

It was listed in the optional tasks so I was expecting to have to find a library for it.  If either of these had been the case I would have checked my spelling a lot sooner.

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


Re: PropertyFile task is optional?

Posted by Douglas Kramer <Do...@Sun.COM>.
Thanks for the explanation.  My purpose here is just to make ant more
usable by clearing up its documentation.

So "external" means external to ant.jar, not external to ant 1.6.2
(which is what I would have expected).

Isn't the location of PropertyFile in ant-nodeps.jar rather than ant.jar
just an implementation detail?  Or is there an Ant specification that
makes distinctions between them?

Because there is no material user difference, I would recommend putting
core and optional tasks in the same list (in the left pane), then making
task names italic if they are optional, bold if they have no third-party
dependency, and strikethrough if they are deprecated.  That would certainly
make the document far more usable.  Is that worthy of consideration?

-Doug

Peter Reilly wrote:
> It is quite simple, non-optional tasks are
> in ant.jar, optional tasks are not.
> 
> Pre ant 1.6, all ant's optional tasks where in
> optional.jar.
> 
> With ant 1.6, all the optional tasks
> are in ant-*.jar, where * is a short-name for the library the task depends
> on.  Some optional tasks do not depend on any third party
> library and are in ant-nodeps.jar
> 
> Peter
> 
> Douglas Kramer wrote:
> 
>> Thanks for replying.  Perhaps I wasn't clear enough to get
>> to my central confusion.  Just some follow-up questions here.
>>
>> Stefan Bodewig wrote:
>>
>>> On Fri, 28 Jan 2005, Douglas Kramer <Do...@sun.com> wrote:
>>>
>>>
>>>> I'm new to Ant and have been wanting to understand optional tasks
>>>> better.  I'm trying to decide between using ReplaceRegExp
>>>> and PropertyFile (which is more what I want, but has the
>>>> comment bug).  I wanted to figure out which to use based
>>>> perhaps on the library for it. 
>>>
>>>
>>>
>>> PropertyFile doesn't need any additional library.  
>>
>>
>>
>> Then why is it an Optional task?  What's optional about it?
>> Did it used to be optional?
>>
>> In fact, the following paragraph refers to core tasks as "built-in",
>> implying that optional tasks are not built-in:
>>
>>   There is a set of <a href="coretasklist">built-in tasks</a>,
>>   along with a number of <a href="optionaltasklist">optional tasks</a>,
>>   but it is also very easy to write your own.
>>
>>   http://ant.apache.org/manual/using.html
>>
>> Okay, I did just find a description of Optional task on
>> the installation page:
>>
>>   Ant supports a number of optional tasks. An optional
>>   task is a task which typically requires an external
>>   library to function. The optional tasks are packaged
>>   together with the core Ant tasks.  The external libraries
>>   required by each of the optional tasks is detailed in
>>   the Library Dependencies section.
>>
>> It sounds like PropertyFile does not require an external
>> library, so why is it in the optional list?  This is
>> confusing.
>>
>> If it was optional for some earlier version of Ant but is
>> no longer optional, please document at which version it
>> became core.  And for the 1.6.2 documentation, please move
>> it to the core list.  (I'll gladly submit a doc bug against
>> this if it makes sense for this to be done -- right now
>> I'm just trying to figure out if it's me or the documentation
>> that is confused.)
>>
>>> In theory
>>> ReplaceRegExp on JDK 1.4 doesn't either, but we highly recommend using
>>> ORO over using JDK's java.util.regexp package.
>>>
>>> BTW, is the comment bug a known one?  I.e. has it been reported?  If
>>> not, please help us find and fix the bug.
>>
>>
>>
>> Yes, it's known (though I haven't looked to see if it's in the bug
>> database), cause it's in the manual:
>>
>>   PropertyFile
>>
>>   Note that the original comment is now lost. Please keep this
>>   in mind when running this task against heavily commented
>>   properties files. It may be best to have a commented version
>>   in the source tree, copy it to a deployment area, and then
>>   run the modifications on the copy. Future versions of
>>   PropertyFile will hopefully eliminate this shortcoming.
>>
>>   http://ant.apache.org/manual/OptionalTasks/propertyfile.html
>>
>> We have a copyright statement at the top of the property file,
>> and it would be too much hassle to post-process the file
>> to put it back in.
>>
>>>> But the documentation doesn't seem to mention clearly which
>>>> libraries they reside in.
>>>
>>>
>>>
>>>
>>> The tasks reside in the Ant download, you need the library to run the
>>> tasks.
>>
>>
>>
>> I don't understand this.  I need which library to run the tasks?
>> The core library or an external library?  Or is there an optional
>> library in the ant 1.6.2 download bundle?
>>
>> -Doug
>>
>>
>>>> Or are all optional tasks included in ant 1.6.2?
>>>
>>>
>>>
>>>
>>> Yes.
>>>
>>> Stefan
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> 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


Re: PropertyFile task is optional?

Posted by Peter Reilly <pe...@apache.org>.
It is quite simple, non-optional tasks are
in ant.jar, optional tasks are not.

Pre ant 1.6, all ant's optional tasks where in
optional.jar.

With ant 1.6, all the optional tasks
are in ant-*.jar, where * is a short-name for the library the task depends
on.  Some optional tasks do not depend on any third party
library and are in ant-nodeps.jar

Peter

Douglas Kramer wrote:

> Thanks for replying.  Perhaps I wasn't clear enough to get
> to my central confusion.  Just some follow-up questions here.
>
> Stefan Bodewig wrote:
>
>> On Fri, 28 Jan 2005, Douglas Kramer <Do...@sun.com> wrote:
>>
>>
>>> I'm new to Ant and have been wanting to understand optional tasks
>>> better.  I'm trying to decide between using ReplaceRegExp
>>> and PropertyFile (which is more what I want, but has the
>>> comment bug).  I wanted to figure out which to use based
>>> perhaps on the library for it. 
>>
>>
>> PropertyFile doesn't need any additional library.  
>
>
> Then why is it an Optional task?  What's optional about it?
> Did it used to be optional?
>
> In fact, the following paragraph refers to core tasks as "built-in",
> implying that optional tasks are not built-in:
>
>   There is a set of <a href="coretasklist">built-in tasks</a>,
>   along with a number of <a href="optionaltasklist">optional tasks</a>,
>   but it is also very easy to write your own.
>
>   http://ant.apache.org/manual/using.html
>
> Okay, I did just find a description of Optional task on
> the installation page:
>
>   Ant supports a number of optional tasks. An optional
>   task is a task which typically requires an external
>   library to function. The optional tasks are packaged
>   together with the core Ant tasks.  The external libraries
>   required by each of the optional tasks is detailed in
>   the Library Dependencies section.
>
> It sounds like PropertyFile does not require an external
> library, so why is it in the optional list?  This is
> confusing.
>
> If it was optional for some earlier version of Ant but is
> no longer optional, please document at which version it
> became core.  And for the 1.6.2 documentation, please move
> it to the core list.  (I'll gladly submit a doc bug against
> this if it makes sense for this to be done -- right now
> I'm just trying to figure out if it's me or the documentation
> that is confused.)
>
>> In theory
>> ReplaceRegExp on JDK 1.4 doesn't either, but we highly recommend using
>> ORO over using JDK's java.util.regexp package.
>>
>> BTW, is the comment bug a known one?  I.e. has it been reported?  If
>> not, please help us find and fix the bug.
>
>
> Yes, it's known (though I haven't looked to see if it's in the bug
> database), cause it's in the manual:
>
>   PropertyFile
>
>   Note that the original comment is now lost. Please keep this
>   in mind when running this task against heavily commented
>   properties files. It may be best to have a commented version
>   in the source tree, copy it to a deployment area, and then
>   run the modifications on the copy. Future versions of
>   PropertyFile will hopefully eliminate this shortcoming.
>
>   http://ant.apache.org/manual/OptionalTasks/propertyfile.html
>
> We have a copyright statement at the top of the property file,
> and it would be too much hassle to post-process the file
> to put it back in.
>
>>> But the documentation doesn't seem to mention clearly which
>>> libraries they reside in.
>>
>>
>>
>> The tasks reside in the Ant download, you need the library to run the
>> tasks.
>
>
> I don't understand this.  I need which library to run the tasks?
> The core library or an external library?  Or is there an optional
> library in the ant 1.6.2 download bundle?
>
> -Doug
>
>
>>> Or are all optional tasks included in ant 1.6.2?
>>
>>
>>
>> Yes.
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>


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


Re: PropertyFile task is optional?

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 31 Jan 2005, Douglas Kramer <Do...@sun.com> wrote:

> Stefan Bodewig wrote:

>> PropertyFile doesn't need any additional library.
> 
> Then why is it an Optional task?

Because we once decided to call it an optional task.

> What's optional about it?  Did it used to be optional?

There may have been a JDK 1.2 dependency when Ant was supposed to work
on JDK 1.1, I'm not sure.

> In fact, the following paragraph refers to core tasks as "built-in",
> implying that optional tasks are not built-in:
> 
>    There is a set of <a href="coretasklist">built-in tasks</a>,
>    along with a number of <a href="optionaltasklist">optional
>    tasks</a>, but it is also very easy to write your own.

It's pretty much along the lines of Peter's answer, built-in = "part of
ant.jar"

> If it was optional for some earlier version of Ant but is
> no longer optional, please document at which version it
> became core.

Really, there is no clear distinction between core and optional.  Much
of it is historic.

>>>But the documentation doesn't seem to mention clearly which
>>>libraries they reside in.
>> The tasks reside in the Ant download, you need the library to run
>> the tasks.
> 
> I don't understand this.  I need which library to run the tasks?

Maybe it gets easier if we use a concrete example, <junit>.  The junit
task is in ant-junit.jar, which is part of the Ant 1.6.2 binary
release bundles.  To run the task, you need JUnit itself in addition
to the task.

Stefan

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


Re: PropertyFile task is optional?

Posted by Douglas Kramer <Do...@Sun.COM>.
Thanks for replying.  Perhaps I wasn't clear enough to get
to my central confusion.  Just some follow-up questions here.

Stefan Bodewig wrote:
> On Fri, 28 Jan 2005, Douglas Kramer <Do...@sun.com> wrote:
> 
> 
>>I'm new to Ant and have been wanting to understand optional tasks
>>better.  I'm trying to decide between using ReplaceRegExp
>>and PropertyFile (which is more what I want, but has the
>>comment bug).  I wanted to figure out which to use based
>>perhaps on the library for it. 
> 
> PropertyFile doesn't need any additional library.  

Then why is it an Optional task?  What's optional about it?
Did it used to be optional?

In fact, the following paragraph refers to core tasks as "built-in",
implying that optional tasks are not built-in:

   There is a set of <a href="coretasklist">built-in tasks</a>,
   along with a number of <a href="optionaltasklist">optional tasks</a>,
   but it is also very easy to write your own.

   http://ant.apache.org/manual/using.html

Okay, I did just find a description of Optional task on
the installation page:

   Ant supports a number of optional tasks. An optional
   task is a task which typically requires an external
   library to function. The optional tasks are packaged
   together with the core Ant tasks.  The external libraries
   required by each of the optional tasks is detailed in
   the Library Dependencies section.

It sounds like PropertyFile does not require an external
library, so why is it in the optional list?  This is
confusing.

If it was optional for some earlier version of Ant but is
no longer optional, please document at which version it
became core.  And for the 1.6.2 documentation, please move
it to the core list.  (I'll gladly submit a doc bug against
this if it makes sense for this to be done -- right now
I'm just trying to figure out if it's me or the documentation
that is confused.)

> In theory
> ReplaceRegExp on JDK 1.4 doesn't either, but we highly recommend using
> ORO over using JDK's java.util.regexp package.
> 
> BTW, is the comment bug a known one?  I.e. has it been reported?  If
> not, please help us find and fix the bug.

Yes, it's known (though I haven't looked to see if it's in the bug
database), cause it's in the manual:

   PropertyFile

   Note that the original comment is now lost. Please keep this
   in mind when running this task against heavily commented
   properties files. It may be best to have a commented version
   in the source tree, copy it to a deployment area, and then
   run the modifications on the copy. Future versions of
   PropertyFile will hopefully eliminate this shortcoming.

   http://ant.apache.org/manual/OptionalTasks/propertyfile.html

We have a copyright statement at the top of the property file,
and it would be too much hassle to post-process the file
to put it back in.

>>But the documentation doesn't seem to mention clearly which
>>libraries they reside in.
> 
> 
> The tasks reside in the Ant download, you need the library to run the
> tasks.

I don't understand this.  I need which library to run the tasks?
The core library or an external library?  Or is there an optional
library in the ant 1.6.2 download bundle?

-Doug


>>Or are all optional tasks included in ant 1.6.2?
> 
> 
> Yes.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> 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


Re: PropertyFile task is optional?

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 28 Jan 2005, Douglas Kramer <Do...@sun.com> wrote:

> I'm new to Ant and have been wanting to understand optional tasks
> better.  I'm trying to decide between using ReplaceRegExp
> and PropertyFile (which is more what I want, but has the
> comment bug).  I wanted to figure out which to use based
> perhaps on the library for it.

PropertyFile doesn't need any additional library.  In theory
ReplaceRegExp on JDK 1.4 doesn't either, but we highly recommend using
ORO over using JDK's java.util.regexp package.

BTW, is the comment bug a known one?  I.e. has it been reported?  If
not, please help us find and fix the bug.

> But the documentation doesn't seem to mention clearly which
> libraries they reside in.

The tasks reside in the Ant download, you need the library to run the
tasks.

> Or are all optional tasks included in ant 1.6.2?

Yes.

Stefan

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


Re: PropertyFile task is optional?

Posted by Douglas Kramer <Do...@Sun.COM>.
Stefan Bodewig wrote:
> On Fri, 28 Jan 2005, Matt Benson <gu...@yahoo.com> wrote:
> 
> 
>>Indeed, I have myself wondered (though I never have
>>bothered to bring it up) why propertyfile and
>>echoproperties are an optional tasks when they have no
>>external dependencies?
>>
>>Any old-timers have any insights?
> 
> 
> Unless Conor jumps in, it won't get any older than me.
> 
> These tasks are by far not the only tasks that are listed as optional
> but don't have any external dependency.  At one point in time we used
> the core vs. optional distinction much the same way we now use "part
> of Ant's distribution" vs. "ship as an antlib".  Some tasks simply
> ended up in optional because they weren't considered *that* useful for
> the broad audience.
> 
> It's been a long time since anybody brought up the "why is X optional"
> question.  I guess most people have settled with, "it is called
> optional, but it is always there" by now.
> 
> Stefan

I'm new to Ant and have been wanting to understand optional tasks
better.  I'm trying to decide between using ReplaceRegExp
and PropertyFile (which is more what I want, but has the
comment bug).  I wanted to figure out which to use based
perhaps on the library for it.  But the documentation doesn't
seem to mention clearly which libraries they reside in.
Am I supposed to waddle through the URLs in this table
to find that out?
http://ant.apache.org/manual/install.html#librarydependencies

Or are all optional tasks included in ant 1.6.2?

I don't see this mentioned in the documentation.

(I'm big on documentation -- I've submitted three doc enhancement
requests already this week, and one was fixed within 10 minutes.)

-Doug


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


Re: PropertyFile task is optional?

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 28 Jan 2005, Matt Benson <gu...@yahoo.com> wrote:

> Indeed, I have myself wondered (though I never have
> bothered to bring it up) why propertyfile and
> echoproperties are an optional tasks when they have no
> external dependencies?
> 
> Any old-timers have any insights?

Unless Conor jumps in, it won't get any older than me.

These tasks are by far not the only tasks that are listed as optional
but don't have any external dependency.  At one point in time we used
the core vs. optional distinction much the same way we now use "part
of Ant's distribution" vs. "ship as an antlib".  Some tasks simply
ended up in optional because they weren't considered *that* useful for
the broad audience.

It's been a long time since anybody brought up the "why is X optional"
question.  I guess most people have settled with, "it is called
optional, but it is always there" by now.

Stefan

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


Re: PropertyFile task is optional?

Posted by Matt Benson <gu...@yahoo.com>.
--- "Stein, Ben" <Be...@xerox.com> wrote:
[SNIP]
> 	If PropertyFile is in the standard ant distribution
> for 1.6.2 then why is it an Optional task?

That's not the right question; lots of optional tasks
exist in the standard distribution.  You are close,
however.  The correct question is along the lines of
your next:

> 	If It really is an optional task then why isn't it
> mentioned in the library dependencies table in the
> manual?
> 
> It was listed in the optional tasks so I was
> expecting to have to find a library for it.  If
> either of these had been the case I would have
> checked my spelling a lot sooner.
> 
Indeed, I have myself wondered (though I never have
bothered to bring it up) why propertyfile and
echoproperties are an optional tasks when they have no
external dependencies?

Any old-timers have any insights?

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


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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