re PR libgcj/25414 (should update rmic)

2006-04-05  Archit Shah  <ashah@redhat.com>

        PR java/25414
        * gnu/java/rmi/rmic/CompilerProcess.java (computeTypicalArguments):
        Add classpath argument.
        * gnu/java/rmi/rmic/Compile_gcj.java (computeArguments): Adjust
        caller.
        * gnu/java/rmi/rmic/Compile_jikes.java (computeArguments): Likewise.
        * gnu/java/rmi/rmic/Compile_kjc.java (computeArguments): Likewise.
        * gnu/java/rmi/rmic/Compiler.java (getClasspath, setClasspath): New.
        * gnu/java/rmi/rmic/RMIC.java: Set classpath for compiler, call
        mkdirs for destination directory, correct handling of superclasses
        and interfaces of the remote class, correct handling of exceptions
        declared by remote methods.

From-SVN: r112699
This commit is contained in:
Archit Shah
2006-04-05 09:53:08 +00:00
committed by Andrew Haley
parent 6eee989369
commit 917173f4d2
7 changed files with 293 additions and 90 deletions
+27 -4
View File
@@ -58,12 +58,28 @@ public abstract class CompilerProcess extends Compiler
*/
public static String[] computeTypicalArguments(String[] compilerArgs,
String destination, String filename)
{
return computeTypicalArguments(compilerArgs, null, destination, filename);
}
/**
* This is used to compute the command line for the process.
* Most compilers typically arrange their arguments as in
* &lt;compiler name and arguments&gt; &lt;optional destination&gt; &lt;filename&gt;.
* This method builds an argument array out that. It should be used
* to define computeArguments for those compilers that follow the
* argument convention described above.
*/
public static String[] computeTypicalArguments(String[] compilerArgs,
String classpath,
String destination,
String filename)
{
/* length of compiler specific arguments */
final int len = compilerArgs.length;
int len = compilerArgs.length;
/* length of returned array of arguments */
final int arglen = len + (destination == null ? 0 : 2) + 1;
final int arglen = len + (classpath == null ? 0 : 2) +
(destination == null ? 0 : 2) + 1;
/* Allocate String array for computed arguments. */
String [] args = new String[arglen];
@@ -71,11 +87,18 @@ public abstract class CompilerProcess extends Compiler
/* Fill in compiler arguments. */
System.arraycopy(compilerArgs, 0, args, 0, len);
/* Fill in classpath argument if necessary. */
if (classpath != null)
{
args[len++] = "-classpath";
args[len++] = classpath;
}
/* Fill in destination argument if necessary. */
if (destination != null)
{
args[len] = "-d";
args[len + 1] = destination;
args[len++] = "-d";
args[len++] = destination;
}
/* Fill in filename */