bodewig 00/09/04 07:06:35
Modified: . WHATSNEW
docs index.html
src/main/org/apache/tools/ant/taskdefs Javac.java
Log:
Added support for jvc (Microsofts Java compiler) to <javac>.
Submitted by: Nico Seessle <[EMAIL PROTECTED]>
Revision Changes Path
1.23 +2 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- WHATSNEW 2000/08/25 11:56:13 1.22
+++ WHATSNEW 2000/09/04 14:06:31 1.23
@@ -30,6 +30,8 @@
* <ejbjar> task syntax has been changed significantly
+* build.compiler supports now jvc as well.
+
Other changes:
--------------
1.86 +2 -0 jakarta-ant/docs/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/index.html,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- index.html 2000/09/04 11:18:38 1.85
+++ index.html 2000/09/04 14:06:33 1.86
@@ -2258,6 +2258,8 @@
<li>jikes (the <a
href="http://oss.software.ibm.com/developerworks/opensource/jikes/project">Jikes</a>
compiler)</li>
+ <li>jvc (the Command-Line Compiler from Microsoft's SDK for Java /
+ Visual J++)</li>
</ul>
<p>For JDK 1.1/1.2 is classic the default. For JDK 1.3 is modern the
default.</p>
<h3>Parameters</h3>
1.36 +55 -0
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.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- Javac.java 2000/08/15 13:34:19 1.35
+++ Javac.java 2000/09/04 14:06:34 1.36
@@ -326,6 +326,8 @@
doModernCompile();
} else if (compiler.equalsIgnoreCase("jikes")) {
doJikesCompile();
+ } else if (compiler.equalsIgnoreCase("jvc")) {
+ doJvcCompile();
} else {
String msg = "Don't know how to use compiler " + compiler;
throw new BuildException(msg);
@@ -776,5 +778,58 @@
}
}
+ private void doJvcCompile() throws BuildException {
+ log("Using jvc compiler", Project.MSG_VERBOSE);
+
+ Path classpath = new Path(project);
+
+ // jvc doesn't support bootclasspath dir (-bootclasspath)
+ // so we'll emulate it for compatibility and convenience.
+ if (bootclasspath != null || bootClasspathReferences.size() > 0) {
+ addReferencesToPath(bootClasspathReferences,
createBootclasspath());
+ classpath.append(bootclasspath);
+ }
+
+ classpath.append(getCompileClasspath(true));
+
+ // jvc doesn't support an extension dir (-extdir)
+ // so we'll emulate it for compatibility and convenience.
+ addExtdirsToClasspath(classpath);
+
+ // jvc has no option for source-path so we
+ // will add it to classpath.
+ classpath.append(src);
+
+ Commandline cmd = new Commandline();
+ cmd.setExecutable("jvc");
+
+ cmd.createArgument().setValue("/d");
+ cmd.createArgument().setFile(destDir);
+ // Add the Classpath before the "internal" one.
+ cmd.createArgument().setValue("/cp:p");
+ cmd.createArgument().setPath(classpath);
+
+ // Enable MS-Extensions and ...
+ cmd.createArgument().setValue("/x-");
+ // ... do not display a Message about this.
+ cmd.createArgument().setValue("/nomessage");
+ // Do not display Logo
+ cmd.createArgument().setValue("/nologo");
+
+ if (debug) {
+ cmd.createArgument().setValue("/g");
+ }
+ if (optimize) {
+ cmd.createArgument().setValue("/O");
+ }
+
+ int firstFileName = cmd.size();
+ logAndAddFilesToCompile(cmd);
+
+ if (executeJikesCompile(cmd.getCommandline(), firstFileName) != 0) {
+ String msg = "Compile failed, messages should have been
provided.";
+ throw new BuildException(msg);
+ }
+ }
}