ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maffitt, David" <maffi...@mir.wustl.edu>
Subject need help understanding ant 1.7 <copy todir="dest" flatten="false" >
Date Sat, 01 Dec 2007 06:27:46 GMT
I have a directory with contents:
build.xml
a.txt
dir/b.txt

The content of build.xml is:

<project name="testant" basedir="." default="testcopy" >

<path id="filesToCopy" >
    <pathelement location="a.txt" />
    <pathelement location="dir/b.txt" />
</path>

<target name="testcopy" >
    <copy todir="dest" flatten="true">
        <resources>
            <path refid="filesToCopy" />
        </resources>
    </copy>
</target>

</project>


When flatten is true, all is good and the directory 'dest' is created
with a.txt and b.txt.

When flatten is false, I hoped to get the directory dest with contents
a.txt and dir/b.txt.  Instead the directory 'dest' is not created and I get:

[dmaffi01@coral testant]$ ant -v
Apache Ant version 1.7.0 compiled on April 1 2007
Buildfile: build.xml
Detected Java version: 1.5 in: /usr/java/jdk1.5.0_11/jre
Detected OS: Linux
parsing buildfile /home/dmaffi01/projects/testant/build.xml with URI = file:/hom
e/dmaffi01/projects/testant/build.xml
Project base dir set to: /home/dmaffi01/projects/testant
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apach
e/tools/ant/antlib.xml. It could not be found.
Build sequence for target(s) `testcopy' is [testcopy]
Complete build sequence is [testcopy, ]

testcopy:
     [copy] /home/dmaffi01/projects/testant/a.txt omitted as /home/dmaffi01/proj
ects/testant/a.txt is up to date.
     [copy] /home/dmaffi01/projects/testant/dir/b.txt omitted as /home/dmaffi01/
projects/testant/dir/b.txt is up to date.
     [copy] No sources found.

BUILD SUCCESSFUL
Total time: 0 seconds


HUH?  How can a.txt and dir/b.txt be up to date when their destination doesn't
exist yet?  This seems too fundamental to be a bug so could someone straighten
me out?

I understand from other threads that the missing antlib.xml is not a problem.
I tried updating ant.jar anyway.  There missing antlib.xml warning went away
but the behavior remained the same.

Thanks in advance,

-Dave

The materials in this message are private and may contain Protected Healthcare Information.
 If you are not the intended recipient, be advised that any unauthorized use, disclosure,
copying or the taking of any action in reliance on the contents of this information is strictly
prohibited.  If you have received this email in error, please immediately notify the sender
via telephone or return mail.

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


Mime
View raw message