ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shankar Unni <>
Subject Problem with <rmic> in Ant 1.4
Date Thu, 06 Sep 2001 18:14:54 GMT
In my project, I have a "src" directory with all the Java source files, and
want to build the thing into a "classes" directory. So far, so good. I also
want to "rmic -iiop" a file, and have the *generated source files* in a
"gen" directory (so that "ant clean" can clean up easily, but at the same
time, I don't want those .java files to clutter up my Jar file).

I'm trying to use the <rmic> task as follows:

    <rmic base="${build}"

This worked in 1.3, but in 1.4, the task fails with the message (long path
prefixes replaced by PATH to make the message readable):

PATH\build.xml:46: Failed to copy
PATH\classes\package\ to
PATH\gen\package\ due to
PATH\classes\package\ (The system cannot find
the file specified)

Notice that it seems to assume that the .java file for the .class file being
rmic'ed is also a generated file under the "base" directory.  But the "base"
directory points to where the *class files* are, not where the original
*source files* are (and they can be different!).

The offending code in is (~line 402):

         * Move the generated source file to the base directory.  If
         * base directory and sourcebase are the same, the generated
         * sources are already in place.
        if (null != sourceBase && !baseDir.equals(sourceBase)) {
            if (idl) {
                log("Cannot determine sourcefiles in idl mode, ", 
                log("sourcebase attribute will be ignored.",
            } else {
                for (int j = 0; j < fileCount; j++) {
                    moveGeneratedFile(baseDir, sourceBase,
                                      (String) compileList.elementAt(j),

But it looks like *some* of the compile list files are NOT generated (for
some reason, <rmic> seems to want to recompile the original source file for
the class I'm rmic'ing). 

(Of course, in 1.3, it used to simply leave some of the generated files in
the "base" directory, but 1.4 seems to swing too far in the other

My workaround for this is to specify "base" and "sourcebase" as the same,
and let it leave the ".java" files there, and move them by hand later.

Shankar Unni            IntruVert Networks, Inc.   (408) 434-8311

View raw message