You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2002/05/07 15:40:10 UTC
cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers DefaultCompilerAdapter.java JavacExternal.java
bodewig 02/05/07 06:40:10
Modified: . Tag: ANT_15_BRANCH WHATSNEW
src/main/org/apache/tools/ant/taskdefs/compilers Tag:
ANT_15_BRANCH DefaultCompilerAdapter.java
JavacExternal.java
Log:
Don't use @files syntax in forked javac if we are using JDK 1.1.
Revision Changes Path
No revision
No revision
1.263.2.6 +6 -0 jakarta-ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
retrieving revision 1.263.2.5
retrieving revision 1.263.2.6
diff -u -r1.263.2.5 -r1.263.2.6
--- WHATSNEW 7 May 2002 12:50:57 -0000 1.263.2.5
+++ WHATSNEW 7 May 2002 13:40:10 -0000 1.263.2.6
@@ -22,6 +22,12 @@
* <property environment=... /> now works on z/OS.
+* forked <javac> failed for the wrong reason on JDK 1.1 - Ant would
+use a temporary file to hold the names of the files to compile under
+some conditons, but 1.1 doesn't support this feature. Ant will no
+longer try this, but you may run into problems with the length of the
+command line now.
+
Changes from Ant 1.4.1 to 1.5beta1
==================================
No revision
No revision
1.28.2.1 +7 -3 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
Index: DefaultCompilerAdapter.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -r1.28 -r1.28.2.1
--- DefaultCompilerAdapter.java 25 Apr 2002 12:14:49 -0000 1.28
+++ DefaultCompilerAdapter.java 7 May 2002 13:40:10 -0000 1.28.2.1
@@ -397,7 +397,10 @@
/**
* Do the compile with the specified arguments.
* @param args - arguments to pass to process on command line
- * @param firstFileName - index of the first source file in args
+ * @param firstFileName - index of the first source file in args,
+ * if the index is negative, no temporary file will ever be
+ * created, but this may hit the command line length limit on your
+ * system.
*/
protected int executeExternalCompile(String[] args, int firstFileName) {
String[] commandArray = null;
@@ -411,12 +414,13 @@
* POSIX seems to define a lower limit of 4k, so use a temporary
* file if the total length of the command line exceeds this limit.
*/
- if (Commandline.toString(args).length() > 4096) {
+ if (Commandline.toString(args).length() > 4096
+ && firstFileName >= 0) {
PrintWriter out = null;
try {
String userDirName = System.getProperty("user.dir");
File userDir = new File(userDirName);
- tmpFile = fileUtils.createTempFile("jikes", "", userDir);
+ tmpFile = fileUtils.createTempFile("files", "", userDir);
out = new PrintWriter(new FileWriter(tmpFile));
for (int i = firstFileName; i < args.length; i++) {
out.println(args[i]);
1.6.2.1 +3 -1 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java
Index: JavacExternal.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- JavacExternal.java 11 Apr 2002 15:20:33 -0000 1.6
+++ JavacExternal.java 7 May 2002 13:40:10 -0000 1.6.2.1
@@ -57,6 +57,7 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.util.JavaEnvUtils;
/**
* Performs a compile using javac externally.
@@ -75,7 +76,8 @@
Commandline cmd = new Commandline();
cmd.setExecutable(getJavac().getJavacExecutable());
setupModernJavacCommandlineSwitches(cmd);
- int firstFileName = cmd.size();
+ int firstFileName = JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)
+ ? -1 : cmd.size();
logAndAddFilesToCompile(cmd);
return
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>