You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Magesh Umasankar <um...@rediffmail.com> on 2001/07/04 19:03:35 UTC

[PATCH] Bug 1918 - Target element description attribute does...

Please find attached a fix for Issue 1918.

Thanks,
Magesh

____________________________________________________
Buy Feng Shui Package for Rs. 151/- only, at http://shopping.rediff.com/shopping/fengshui_mailer.htm


Re: [PATCH] Bug 1918 - Target element description attribute does...

Posted by Glenn McAllister <gl...@somanetworks.com>.
Glenn McAllister wrote:

> I don't have a problem with property expansion in target descriptions, but I DO have one
> in if, name, depends, etc.

Just to clarify, in the end of that email I did come out against having property expansion in target
descriptions.  There.  I've filled my quota of looking like an idiot for the day. :-)

Glenn McAllister
SOMA Networks, Inc.


Re: [PATCH] Bug 1918 - Target element description attribute does...

Posted by Glenn McAllister <gl...@somanetworks.com>.
Magesh Umasankar wrote:

> Please find attached a fix for Issue 1918.

<snip>

>  public class ProjectHelper {
> @@ -386,6 +387,8 @@
>              for (int i = 0; i < attrs.getLength(); i++) {
>                  String key = attrs.getName(i);
>                  String value = attrs.getValue(i);
> +                value = replaceProperties(project, value,
> +                               project.getProperties() );

This isn't acceptable because it will do property subsitution in *all* attribute values, not just
description.  I don't have a problem with property expansion in target descriptions, but I DO have one
in if, name, depends, etc.  Hmm... lets think about property expansion in descriptions.  Why do you
want it?  Nominally, to reflect what is happening in the target based on what are effectively
parameters to the target.  What happens when I have

<property name="funky.stuff" value="use your imagination" />
<property name="sucker" value="someone you don't like" />

<target name="do_this" description="Do ${funky.stuff} to ${sucker}.">
  ...
</target>

<target name="call_do_this">
  <antcall target="do_this">
    <param name="funky.stuff" value="throw chickens at" />
    <param name="sucker" value="your boss" />
  </antcall>
</target>

with ant -projecthelp you get

  do_this     Do use your imagination to someone you don't like

but in reality you mean

  do_this     Do throw chickens at to your boss


Ok, the English grammer sucks, but you get the point.  I'd argue that having the property names
unexpanded in the description are more useful than having the potentially incorrect information - at
least you know which properties are involved in the target.

Glenn McAllister
SOMA Networks, Inc.