ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick, Brian E." <Brian.D...@FMR.com>
Subject Apply, fileset, redirector unexpected behavior
Date Wed, 18 Aug 2004 16:28:39 GMT
Is this the way it is supposed to work?

The test directory has two files, foo1.txt and foo2.txt.

Running the following build file produces an error. Notice that the
source file sent as a command line argument is different from the file
sent to the redirector.

   <project name="apply.xml" default="applyit">
      <target name="applyit">
         <apply executable="echo">
            <fileset dir="test" includes="*.*"/>

            <redirector>
               <inputmapper type="identity"/>
            </redirector>
         </apply>
      </target>
   </project>

Produces the following.

   applyit:
       [apply] Current OS is Windows XP
       [apply] Executing 'echo' with arguments:
       [apply] 'C:\test\foo1.txt'
       [apply]
       [apply] The ' characters around the executable and arguments are
       [apply] not part of the command.
       [apply] Redirecting input from file
       [apply] Opening C:\foo1.txt

   BUILD FAILED
   C:\apply.xml:5: java.io.FileNotFoundException: C:\foo1.txt
   ...

To get it to work, I had to change the fileset. Notice that the source
file sent as a command line argument is the same as the file sent to the
redirector.

   <project name="apply.xml" default="applyit">
      <target name="applyit">
         <apply executable="echo">
            <fileset dir="." includes="test/*.*"/>

            <redirector>
               <inputmapper type="identity"/>
            </redirector>
         </apply>
      </target>
   </project>

Produces the following.

applyit:
    [apply] Current OS is Windows XP
    [apply] Executing 'echo' with arguments:
    [apply] 'C:\test\foo1.txt'
    [apply]
    [apply] The ' characters around the executable and arguments are
    [apply] not part of the command.
    [apply] Redirecting input from file
    [apply] Opening C:\test\foo1.txt
    [apply] C:\test\foo1.txt
    [apply] Executing 'echo' with arguments:
    [apply] 'C:\test\foo2.txt'
    [apply]
    [apply] The ' characters around the executable and arguments are
    [apply] not part of the command.
    [apply] Redirecting input from file
    [apply] Opening C:\test\foo2.txt
    [apply] C:\test\foo2.txt
    [apply] Applied echo to 2 files and 0 directories.

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


Mime
View raw message