ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Apply, fileset, redirector unexpected behavior
Date Wed, 18 Aug 2004 18:27:00 GMT
Brian:  This behavior, although probably undesirable
(and to be honest, unforeseen), appears to be--believe
it or not--correct.  Filename Mappers operate on
(usually relative) filenames as opposed to Files and
do not take basedirs into account.  I am afraid we
would end up with all kinds of odd code if we tried to
handle this per mapper or any other way that comes to
mind.  I will leave it at that for now and consider
the matter closed unless there is a hue and cry AND
someone with a better idea.  :)

Thanks,
Matt

--- "Dick, Brian E." <Brian.Dick@FMR.com> wrote:

> 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
> 
> 



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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


Mime
View raw message