#90 Variable task breaks on ant 1.6.1

property (13)
Anne Veling

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


  • Matt Inger

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

    Matt Inger - 2004-05-13

    Logged In: YES

    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

    the <var name="x" unset="true"/> command gives an error on

    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

    have you tried the 1.0b1 version?

  • Marcelo Vanzin

    Marcelo Vanzin - 2004-09-08

    Logged In: YES

    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

    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">
    <pathelement location="../ant-contrib-1.0b1.jar"/>

    <target name="test">
    <var name="x" value="6" />
    <runtarget target="callthis" />
    <var name="x" value="12" />
    <runtarget target="callthis" />

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

    ========= end build.xml

  • Matt Inger

    Matt Inger - 2006-08-16
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks