ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Todd <jwt...@pacbell.net>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefsJavac.java
Date Sun, 25 Jun 2000 18:51:33 GMT

hey conor -

    i'm curious as to if this resolves or worsens a problem i've
    had with ant, that being that if i do a "build of a sub-branch"
    of a package tree any/all resource files (eg xml, properties)
    get reparented under the root package name.

    i'm presently using a 6 month old ant and just at this time
    am freeing up some cylces to upgrade and will again test my
    theory to see if the issue persists but seeing the following
    putback comments prompted me to again ask this question.

    here's a simple example source package structure:

        foo/bar/ bop/Bop.java
        foo/bar/bop/bop.xml

    now, when i build using a tag as follows (again, i could be
    dated on some usage details here to which i will appreciate
    gentle redirection):

        <javac srcdir="foo" ...

    all is well regarding the derived package structure:

        foo.bar.bop.Bop.class
        foo.bar.bop.bop.xml

    but, when i do a "branch build" using a tag as follows:

        <javac srcdir="foo/bar/bop" ...

    the "resource" files (ie bop.xml) are reparented in the
    derived package structure:

        foo.bar.bop.Bop.class
        bop.xml

    i get around this with a rather ugly and redundant
    "resource tree" and supporting copydir tags which i
    really want to do away with.

    is this a bug/is it fixed/is there a better way?

    thx much,

- james

conor@locus.apache.org wrote:

> conor       00/06/25 05:36:46
>
>   Modified:    src/main/org/apache/tools/ant/taskdefs Javac.java
>   Log:
>   Deprecate the implicit copying of support files by Javac.
>
>   Revision  Changes    Path
>   1.14      +17 -14    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
>
>   Index: Javac.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
>   retrieving revision 1.13
>   retrieving revision 1.14
>   diff -u -r1.13 -r1.14
>   --- Javac.java        2000/06/24 10:55:45     1.13
>   +++ Javac.java        2000/06/25 12:36:45     1.14
>   @@ -237,6 +237,10 @@
>            // copy the support files
>
>            if (filecopyList.size() > 0) {
>   +            project.log("The implicit copying of support files by javac has been deprecated.
" +
>   +                        "Use the copydir task to copy support files explicitly.",
>   +                        Project.MSG_WARN);
>   +
>                project.log("Copying " + filecopyList.size() +
>                            " support files to " + destDir.getAbsolutePath());
>                Enumeration enum = filecopyList.keys();
>   @@ -271,22 +275,21 @@
>                File srcFile = new File(srcDir, files[i]);
>                if (files[i].endsWith(".java")) {
>                    File classFile = new File(destDir, files[i].substring(0,
>   -                        files[i].indexOf(".java"))
>   -                                                    + ".class");
>   +                                          files[i].indexOf(".java")) + ".class");
>
>   -                    if (srcFile.lastModified() > now) {
>   -                        project.log("Warning: file modified in the future: " +
>   -                            files[i], project.MSG_WARN);
>   -                    }
>   -
>   -                    if (srcFile.lastModified() > classFile.lastModified()) {
>   -                        compileList.addElement(srcFile.getAbsolutePath());
>   -                    }
>   -                } else {
>   +                if (srcFile.lastModified() > now) {
>   +                    project.log("Warning: file modified in the future: " +
>   +                        files[i], project.MSG_WARN);
>   +                }
>   +
>   +                if (srcFile.lastModified() > classFile.lastModified()) {
>   +                    compileList.addElement(srcFile.getAbsolutePath());
>   +                }
>   +            } else {
>                    File destFile = new File(destDir, files[i]);
>   -                    if (srcFile.lastModified() > destFile.lastModified()) {
>   -                        filecopyList.put(srcFile.getAbsolutePath(),
>   -                                         destFile.getAbsolutePath());
>   +                if (srcFile.lastModified() > destFile.lastModified()) {
>   +                    filecopyList.put(srcFile.getAbsolutePath(),
>   +                                     destFile.getAbsolutePath());
>                    }
>                }
>            }
>
>
>


Mime
View raw message