You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/09/22 12:43:57 UTC

DO NOT REPLY [Bug 45858] New: AntXtras foreach tasks fail with undefined loop variables

https://issues.apache.org/bugzilla/show_bug.cgi?id=45858

           Summary: AntXtras foreach tasks fail with undefined loop
                    variables
           Product: Ant
           Version: 1.8Alpha (nightly)
          Platform: PC
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: Other
        AssignedTo: notifications@ant.apache.org
        ReportedBy: Tim.Whittington@orionhealth.com


Using nightly snapshot ant_20080922041906.tar.gz, my builds are failing where
they use the AntXtras (http://antxtras.sourceforge.net) callforeach/foreach
tasks (and possibly others - there's a heirarchy of tasks starting at 'call'
that this could apply to).
I'm using AntXtras 0.5.1 (the latest available build).

What appears to be happening is that the loop variable (defined as i="" in the
task) is not being set.
This same build script works with Ant 1.6.x and 1.7.x.

Example build file that demonstrates this issue is:

<?xml version="1.0"?>
<project name="AntXTest" default="build" basedir="."
xmlns:antx="antlib:com.idaremedia.antx">
        <description>
                Demonstrates breakage of Antx foreach task on Ant SVN snapshot
        </description>

        <property name="build.dir" value="${basedir}"/>

        <!-- AntXtras Tasks from "com/idaremedia/antx/antlib.xml" -->
        <taskdef resource="com/idaremedia/antx/antlib.xml"
uri="antlib:com.idaremedia.antx">
                <classpath>
                        <fileset dir="${build.dir}/antx">
                                <include name="JWare_apis.jar"/>
                                <include name="AntX_tasks.jar"/>
                        </fileset>
                </classpath>
        </taskdef>

        <target name="build">
                <antx:foreach i="loop" list="1,2,3,4"  mode="local" >
                        <echo message="Index is ${loop}"/>
                </antx:foreach>
        </target>

</project>

And a verbose log of the foreach task failing to work:

Apache Ant version 1.8.0alpha compiled on September 22 2008
Buildfile:
/Users/archie/Projects/OrionPlatform/Tools/com.orchestral.common.hibernate3/build.xml
Detected Java version: 1.6 in:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Detected OS: Mac OS X
parsing buildfile
/Users/archie/Projects/OrionPlatform/Tools/com.orchestral.common.hibernate3/build.xml
with URI =
file:/Users/archie/Projects/OrionPlatform/Tools/com.orchestral.common.hibernate3/build.xml
Project base dir set to:
/Users/archie/Projects/OrionPlatform/Tools/com.orchestral.common.hibernate3
parsing buildfile
jar:file:/Users/archie/Downloads/ant/dist/lib/ant.jar!/org/apache/tools/ant/antlib.xml
with URI =
jar:file:/Users/archie/Downloads/ant/dist/lib/ant.jar!/org/apache/tools/ant/antlib.xml
parsing buildfile
jar:file:/Users/archie/Projects/OrionPlatform/Tools/com.orchestral.common.hibernate3/antx/AntX_tasks.jar!/com/idaremedia/antx/antlib.xml
with URI =
jar:file:/Users/archie/Projects/OrionPlatform/Tools/com.orchestral.common.hibernate3/antx/AntX_tasks.jar!/com/idaremedia/antx/antlib.xml
[antlib:com.idaremedia.antx] Could not load definitions from resource
com/idaremedia/antx/antlib.xml. It could not be found.
[presetdef] defining preset antlib:com.idaremedia.antx:macrolocals
[presetdef] defining preset antlib:com.idaremedia.antx:macroisolate
[presetdef] defining preset antlib:com.idaremedia.antx:looplocals
[presetdef] defining preset antlib:com.idaremedia.antx:loopisolate
[presetdef] defining preset antlib:com.idaremedia.antx:pathproperty
[presetdef] defining preset antlib:com.idaremedia.antx:true
Build sequence for target(s) `build' is [build]
Complete build sequence is [build, ]

build:
 [macrodef] creating macro  foreach622517_macrodef
Property "loop" has not been set
     [echo] Index is ${loop}
Property "loop" has not been set
     [echo] Index is ${loop}
Property "loop" has not been set
     [echo] Index is ${loop}
Property "loop" has not been set
     [echo] Index is ${loop}


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45858] AntXtras foreach tasks fail with undefined loop variables

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45858


Matt Benson <gu...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




--- Comment #1 from Matt Benson <gu...@yahoo.com>  2008-11-03 18:07:08 PST ---
Yes, AntXtras properties tasks are built atop an API that was declared unstable
from the outset.  When we redesigned that API (relatively) recently, I
attempted to engage Wascally Wabbit (AntXtras' author) to minimize disruption
and/or get input from the project that was arguably the heaviest known consumer
of that API in the wild.  I received no response.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45858] AntXtras foreach tasks fail with undefined loop variables

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45858


wascallywabbit <wa...@earthling.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wascallywabbit@earthling.net




--- Comment #2 from wascallywabbit <wa...@earthling.net>  2008-11-11 17:48:24 PST ---
(In reply to comment #1)
> Yes, AntXtras properties tasks are built atop an API that was declared unstable
> from the outset.  When we redesigned that API (relatively) recently, I
> attempted to engage Wascally Wabbit (AntXtras' author) to minimize disruption
> and/or get input from the project that was arguably the heaviest known consumer
> of that API in the wild.  I received no response.
> 

Hi Mark,
Can you point me to the conversations about the redesign of properties helper
for Ant 1.8. I recall some questions on the ant-dev mailing list but I'll admit
I've not been paying particularly close attention for quite some time.

-The Wabbit


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.