ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From EXT / FOCAL MALAPRADE Roland <ext.focal.malapr...@sncf.fr>
Subject RE: If anybody is interested.. [foreach] task which doesnt run ou t of memory.
Date Thu, 19 Sep 2002 07:50:02 GMT
Wow! Cool! thanks a lot. I'll try it out.

Roland.

-----Message d'origine-----
De : Geoff Meakin [mailto:geoffm@isocra.com]
Envoyé : mercredi 18 septembre 2002 18:40
À : Ant Users List
Objet : RE: If anybody is interested.. [foreach] task which doesnt run
out of memory.


Dear Roland,

Yes, the difficulty comes in with the fact that
IfTask isnt really an org.apache.tools.ant.Task
but is a ConditionBase instead, with private
<then> and <else> Sequentials, so I cant access
them, and notify them that they need to reset
their properties.

I've changed this by modifying execute() on
Sequential so that it resets its properties from
there instead, so your example now works (as does
mine). This now happens with all <Sequentials>,
but I cant see how that should have any adverse
effects.

If you're happy with this, you can get
the new version (ForEach2 v0.8.1) from the same
place.

Thanks for pointing this out :)

Cheers
-Geoff


-----Original Message-----
From: EXT / FOCAL MALAPRADE Roland [mailto:ext.focal.malaprade@sncf.fr]
Sent: 18 September 2002 02:42 PM
To: 'Ant Users List'
Subject: RE: If anybody is interested.. [foreach] task which doesnt run
out of memory.


I've been trying to use it with an <if> task as so:

<target name="main">
  <foreach2 param="letter" list="a,b,c">
    <do>
      <if>
        <isset property="letter"/>
        <then>
          <foreach2 param="number" list="1,2,3">
            <do>
              <if>
                <isset property="letter"/>
                <then>
                  <echo message="combi is ${letter}${number}"/>
                </then>
                <else>
                  <echo message="number not set" />
                </else>
              </if>
            </do>
          </foreach2>
        </then>
        <else>
          <echo message="letter not set" />
        </else>
      </if>
    </do>
  </foreach2>

and this build script displays:
main:
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1
     [echo] combi is a1

Do you know why this is?

</target>-----Message d'origine-----
De : Geoff Meakin [mailto:geoffm@isocra.com]
Envoyé : mercredi 18 septembre 2002 15:09
À : Ant Users List
Objet : RE: If anybody is interested.. [foreach] task which doesnt run
out of memory.


Yes, it appears so:

<target name="main">
  <foreach2 param="letter" list="a,b,c">
    <do>
      <foreach2 param="number" list="1,2,3">
        <do>
          <echo message="combi is ${letter}${number}"/>
        </do>
      </foreach2>
    </do>
  </foreach2>
</target>

Gives the output:

combi is a1
combi is a2
combi is a3
combi is b1
combi is b2
combi is b3
combi is c1
combi is c2
combi is c3

Cheers
-Geoff


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message