ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Wood <kw...@i2.com>
Subject Re: Foreach task...
Date Tue, 24 Apr 2001 21:17:48 GMT
I don't seem to be having any luck, any ideas?

% ant -buildfile pair.xml pair
Buildfile: pair.xml

pair:

BUILD FAILED

java.lang.NullPointerException
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:208)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:103)
        at org.apache.tools.ant.taskdefs.optional.ForeachTask.executeTarget(ForeachTask.java:212)
        at org.apache.tools.ant.taskdefs.optional.ForeachTask.executeParameters(ForeachTask.java:229)
        at org.apache.tools.ant.taskdefs.optional.ForeachTask.executeParameters(ForeachTask.java:240)
        at org.apache.tools.ant.taskdefs.optional.ForeachTask.executeParameters(ForeachTask.java:240)
        at org.apache.tools.ant.taskdefs.optional.ForeachTask.execute(ForeachTask.java:252)
        at org.apache.tools.ant.Target.execute(Target.java:153)
        at org.apache.tools.ant.Project.runTarget(Project.java:898)
        at org.apache.tools.ant.Project.executeTarget(Project.java:536)
        at org.apache.tools.ant.Project.executeTargets(Project.java:510)
        at org.apache.tools.ant.Main.runBuild(Main.java:421)
        at org.apache.tools.ant.Main.main(Main.java:149)

Total time: 1 second

===================================================================================================

<?xml version="1.0"?>

<project name="pair" default="pair" basedir="./">

  <taskdef name="foreach"
           classname="org.apache.tools.ant.taskdefs.optional.ForeachTask" />

<target name="replace">
  <echo message="replace ${FILE} token ${TOKEN} value XYZ" />
</target>

<target name="pair">

  <foreach target="replace">

    <param name="FILE">
      <fileset dir=".">
        <include name="*.XYZ" />
      </fileset>
    </param>

    <param name="TOKEN">
      <item value="X" />
      <item value="Y" />
      <item value="Z" />
    </param>

  </foreach>

</target>

</project>

======================================

-rw-rw-r--   1 kwood    develop       36 Apr 24 15:40 A.XYZ
-rw-rw-r--   1 kwood    develop       41 Apr 24 15:41 B.XYZ

Mime
View raw message