ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn McAllister <gl...@somanetworks.com>
Subject Re: [PATCH] Bug 1918 - Target element description attribute does...
Date Wed, 04 Jul 2001 19:54:04 GMT
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.
Mime
View raw message