You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Antoine Levy-Lambert <an...@gmx.de> on 2006/10/30 04:02:26 UTC
Re: echo task documentation error
Hi Steve,
I think you are a committer too. Feel free to edit the documentation.
Regards,
Antoine
Steve Cohen wrote:
> A very minor point:
>
> The ant manual states that the echo task's message attribute is
> required "unless data is included in a character section within this
> element."
>
> This appears to be false. I have by accident discovered that
>
> <echo/>
>
> has the effect of inserting a totally blank line into the output. It
> doesn't even show the normal [echo] prefix. I don't know if this is
> intentional, but it is actually quite useful.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: echo task documentation error
Posted by Steve Cohen <sc...@javactivity.org>.
Dominique Devienne wrote:
>> > empty. If foo is empty by mistake, how will one troubleshoot this?
>> and not a blank line. Undefined properties are echoed as literal
>> text, not skipped.
>
> I'm well aware of that ;-) That's why I wrote "empty", not "not
> defined". As in empty string vs null string.
>
> The proper way to output a line separator is by using
> <echo>${line.separator}</echo>. That this doesn't work in Maven is a
> bug for Maven, not a "feature" of Ant.
>
> AFAIK, *any* task output is prefixed by the task's name. A line
> separator is output in my book ;-) I fail to see why it would be good
> to make an exception for <echo/> somehow.
>
> Go ahead and fix the "doc" bug if you want. Strictly speaking this is
> in keeping with BC; but this is yet another one of these little quirks
> Ant is full of. --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
I stand corrected, thanks.
I checked in the manual change.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: echo task documentation error
Posted by Matt Benson <gu...@yahoo.com>.
--- Dominique Devienne <dd...@gmail.com> wrote:
[SNIP]
> AFAIK, *any* task output is prefixed by the task's
> name. A line
> separator is output in my book ;-) I fail to see why
> it would be good
> to make an exception for <echo/> somehow.
FWIW, I agree.
-Matt
>
> Go ahead and fix the "doc" bug if you want. Strictly
> speaking this is
> in keeping with BC; but this is yet another one of
> these little quirks
> Ant is full of. --DD
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
>
>
____________________________________________________________________________________
Low, Low, Low Rates! Check out Yahoo! Messenger's cheap PC-to-Phone call rates
(http://voice.yahoo.com)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: echo task documentation error
Posted by Dominique Devienne <dd...@gmail.com>.
> > empty. If foo is empty by mistake, how will one troubleshoot this?
> and not a blank line. Undefined properties are echoed as literal text, not skipped.
I'm well aware of that ;-) That's why I wrote "empty", not "not
defined". As in empty string vs null string.
The proper way to output a line separator is by using
<echo>${line.separator}</echo>. That this doesn't work in Maven is a
bug for Maven, not a "feature" of Ant.
AFAIK, *any* task output is prefixed by the task's name. A line
separator is output in my book ;-) I fail to see why it would be good
to make an exception for <echo/> somehow.
Go ahead and fix the "doc" bug if you want. Strictly speaking this is
in keeping with BC; but this is yet another one of these little quirks
Ant is full of. --DD
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: echo task documentation error
Posted by Steve Cohen <sc...@javactivity.org>.
Dominique Devienne wrote:
>> unless someone comes up with a good reason
>> why this is a bug rather than a feature.
>
> It's a bug if it doesn't prefix that line with [echo] in non-emacs mode.
>
> <echo/> is not much different from <echo>${foo}</echo> with foo being
> empty. If foo is empty by mistake, how will one troubleshoot this?
> Sure, not a very good example, but still. Any task output should be
> prefixed with the task name in non-emacs mode. --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
This is the sort of input I wanted before I went off blindly changing
documentation to match current behavior.
But your example isn't quite correct either.
<echo>${foo}</echo> (with foo not defined)
will produce
[echo] ${foo}
and not a blank line. Undefined properties are echoed as literal text, not skipped.
So, although the omission of the task tag may be unintended, I don't see it as
quite as bad a thing as you do. It is handy to be able to emit a totally blank
line. Although, to be perfectly consistent, we should probably define something
like <echo blank="true"/> or some such to get that behavior rather than this
accidental thing.
My feeling for now is to simply update the doc to say (on echo.html, for the
"required" column of the message attribute):
"No. Text may also be included in a character section within this element. If
neither is included a blank line will be emitted in the output."
leaving the question of the missing task label to be disposed of separately.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: echo task documentation error
Posted by Dominique Devienne <dd...@gmail.com>.
> unless someone comes up with a good reason
> why this is a bug rather than a feature.
It's a bug if it doesn't prefix that line with [echo] in non-emacs mode.
<echo/> is not much different from <echo>${foo}</echo> with foo being
empty. If foo is empty by mistake, how will one troubleshoot this?
Sure, not a very good example, but still. Any task output should be
prefixed with the task name in non-emacs mode. --DD
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: echo task documentation error
Posted by Steve Cohen <sc...@javactivity.org>.
Antoine Levy-Lambert wrote:
> Hi Steve,
>
> I think you are a committer too. Feel free to edit the documentation.
>
> Regards,
>
> Antoine
>
> Steve Cohen wrote:
>> A very minor point:
>>
>> The ant manual states that the echo task's message attribute is
>> required "unless data is included in a character section within this
>> element."
>>
>> This appears to be false. I have by accident discovered that
>>
>> <echo/>
>>
>> has the effect of inserting a totally blank line into the output. It
>> doesn't even show the normal [echo] prefix. I don't know if this is
>> intentional, but it is actually quite useful.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
You're right. I have been quite inactive, but I can certainly do this. That
is, unless someone comes up with a good reason why this is a bug rather than a
feature.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org