#90 Variable task breaks on ant 1.6.1

closed-fixed
nobody
property (13)
5
2006-08-16
2004-05-06
Anne Veling
No

The var task seems not to work correctly using ant
1.6.1. The "object rape" method of stealing
the "properties" field from the Project class is no longer
valid since this had moved to a PropertyHelper class.

This breaks its functionality. A.o. the example in the
documentation that does <var name="x" value=""/> no
longer works; the <format/> task later on cannot use
the value anymore.

And: the documentation of the task speaks of a
(handy) "unset" attribute of the task, but this is not
available.

Discussion

  • Matt Inger
    Matt Inger
    2004-05-13

    • status: open --> closed
     
  • Matt Inger
    Matt Inger
    2004-05-13

    Logged In: YES
    user_id=83032

    This is more a documenation issue than anything. Setting the
    value to "" no longer allows the format task to set the value.
    I have changed the example to use unset="true"

     
  • Anne Veling
    Anne Veling
    2004-05-14

    Logged In: YES
    user_id=1036363

    the <var name="x" unset="true"/> command gives an error on
    ant-contrib-0.6:

    The <var> type doesn't support the "unset" attribute.

    This would be a handy thing. Seems the attribute is not
    available for this task. Problem still occurs.

     
  • Anne Veling
    Anne Veling
    2004-05-14

    • status: closed --> open
     
  • Matt Inger
    Matt Inger
    2004-05-25

    Logged In: YES
    user_id=83032

    have you tried the 1.0b1 version?

     
  • Marcelo Vanzin
    Marcelo Vanzin
    2004-09-08

    Logged In: YES
    user_id=75113

    I'm having a strange problem with this task. I've copied a
    simple build file that shows the problem to the end of the
    message.

    I don't know if I'm doing something wrong or if this is
    supposed to be the correct behavior, but it's not what I'd
    expect from the task description.

    It involves calling other targets in the same project using
    "runtarget" and changing the value of some property used by
    that target. Within the same task the values of "x" are
    changed, but the target called by "runtarget" always sees
    the first value assigned to "x".

    ========= begin build.xml
    <project name="bug" default="test">

    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
    <pathelement location="../ant-contrib-1.0b1.jar"/>
    </classpath>
    </taskdef>

    <target name="test">
    <var name="x" value="6" />
    <echo>${x}</echo>
    <runtarget target="callthis" />
    <var name="x" value="12" />
    <echo>${x}</echo>
    <runtarget target="callthis" />
    </target>

    <target name="callthis">
    <echo>From "callthis": ${x}</echo>
    </target>

    </project>
    ========= end build.xml

     
  • Matt Inger
    Matt Inger
    2006-08-16

    • status: open --> closed-fixed