ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jerome Lacoste @ BBC" <lacostej...@altern.org>
Subject Possible bug with copy in Ant 1.5
Date Wed, 09 Oct 2002 16:26:51 GMT
Summary:
copy identifies files are up to date while they aren't.
copy using filesets works.


Details

Extracted from main build file
  <target name="web.build" depends="compile" description="do the web stuff">
      <ant antfile="${src.dir}/no/bbc/basis/web/ex1/build.xml" 
target="build">
           <reference refid="build.classpath"/>
      </ant>
  </target>

Extracted from the called build file 
("${src.dir}/no/bbc/basis/web/ex1/build.xml")
  <target name="build" depends="compile">

    <!-- this doesn't work in Ant 1.5 - probably a bug - kept to 
remember... -->
    <copy file="${src.ex1.dir}/web.xml" tofile="${build.ex1.dir}/web.xml" />
    <copy file="${src.ex1.dir}/application.xml" 
tofile="${build.ex1.dir}/application.xml" />

    <!-- this does the job -->
    <copy todir="${build.ex1.dir}" >
      <fileset dir="${src.ex1.dir}" >
        <include name="web.xml"/>
        <include name="application.xml"/>
      </fileset>
    </copy>

  </target>

Here is the verbose result of running  ant web.build on the main build file

[...]
build:
     [copy] P:\Basis_trunk\Basis\src\java\no\bbc\basis\web\ex1\web.xml 
omitted as P:\Basis_trunk\Basis\build\classes\web1\web.xml is up to date.
     [copy] 
P:\Basis_trunk\Basis\src\java\no\bbc\basis\web\ex1\application.xml 
omitted as P:\Basis_trunk\Basis\build\classes\web1\application.xml is up 
to date.
     [copy] application.xml added as 
P:\Basis_trunk\Basis\build\classes\web1\application.xml doesn't exist.
     [copy] web.xml added as 
P:\Basis_trunk\Basis\build\classes\web1\web.xml doesn't exist.
     [copy] Copying 2 files to P:\Basis_trunk\Basis\build\classes\web1
     [copy] Copying 
P:\Basis_trunk\Basis\src\java\no\bbc\basis\web\ex1\web.xml to 
P:\Basis_trunk\Basis\build\classes\web1\web.xml
     [copy] Copying 
P:\Basis_trunk\Basis\src\java\no\bbc\basis\web\ex1\application.xml to 
P:\Basis_trunk\Basis\build\classes\web1\application.xml

As you can see
    <!-- this doesn't work in Ant 1.5 - probably a bug - kept to 
remember... -->
    <copy file="${src.ex1.dir}/web.xml" 
tofile="${build.ex1.dir}/web.xml" />  
    <copy file="${src.ex1.dir}/application.xml" 
tofile="${build.ex1.dir}/application.xml" />

doesn't work. File are though to be up to date while they do not exist. 
I tried with option 'todir' instead of 'tofile': same results. But using 
filesets works:

    <copy todir="${build.ex1.dir}" >
      <fileset dir="${src.ex1.dir}" >
        <include name="web.xml"/>
        <include name="application.xml"/>
      </fileset>
    </copy>

Didn't try with ant 1.5.1, but this doesn't appear in the changelog.

P:\>ant -version
Apache Ant version 1.5 compiled on July 9 2002


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