Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 65866 invoked by uid 500); 6 Sep 2001 18:18:37 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 65852 invoked from network); 6 Sep 2001 18:18:37 -0000 Message-ID: From: Shankar Unni To: "'ant-user@jakarta.apache.org'" Subject: Problem with in Ant 1.4 Date: Thu, 6 Sep 2001 11:14:54 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C136FE.ABF08306" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C136FE.ABF08306 Content-Type: text/plain; charset="iso-8859-1" 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 task as follows: 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\FaultHandlerServiceImpl.java to PATH\gen\package\FaultHandlerServiceImpl.java due to PATH\classes\package\FaultHandlerServiceImpl.java (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 Rmic.java 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, ", Project.MSG_WARN); log("sourcebase attribute will be ignored.", Project.MSG_WARN); } else { for (int j = 0; j < fileCount; j++) { moveGeneratedFile(baseDir, sourceBase, (String) compileList.elementAt(j), adapter); } } } But it looks like *some* of the compile list files are NOT generated (for some reason, 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 direction..) 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. shankar@intruvert.com (408) 434-8311 ------_=_NextPart_001_01C136FE.ABF08306 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Problem with <rmic> in Ant 1.4

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=3D"${build}"
          = sourcebase=3D"${gen}"
          = iiop=3D"yes"
          = debug=3D"${debug}"
          = stubversion=3D"-v1.2"
          = classname=3D"com.intruvert.ext.fault.FaultHandlerServiceImpl"<= /FONT>
          = classpathref=3D"default.class.path"/>

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\FaultHandlerServiceImpl.java to = PATH\gen\package\FaultHandlerServiceImpl.java due to = PATH\classes\package\FaultHandlerServiceImpl.java (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 Rmic.java 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 = !=3D sourceBase && !baseDir.equals(sourceBase)) {
          &nb= sp; if (idl) {
          &nb= sp;     log("Cannot determine sourcefiles in = idl mode, ",
          &nb= sp;         = Project.MSG_WARN);
          &nb= sp;     log("sourcebase attribute will be = ignored.", Project.MSG_WARN);
          &nb= sp; } else {
          &nb= sp;     for (int j =3D 0; j < fileCount; j++) = {
          &nb= sp;         = moveGeneratedFile(baseDir, sourceBase,
          &nb= sp;           &nb= sp;           &nb= sp;   (String) compileList.elementAt(j),
          &nb= sp;           &nb= sp;           &nb= sp;   adapter);
          &nb= sp;     }
          &nb= sp; }
        }

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 direction..)


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.
shankar@intruvert.com   (408) = 434-8311

------_=_NextPart_001_01C136FE.ABF08306--