Submitted by: Brian Deitte <bdeitte@macromedia.com> git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269488 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -31,8 +31,10 @@ inclusion/exclusion of files works, and how to write patterns.</p> | |||||
| <p>It is possible to use different compilers. This can be selected with the | <p>It is possible to use different compilers. This can be selected with the | ||||
| "build.compiler" property. There are four choices:</p> | "build.compiler" property. There are four choices:</p> | ||||
| <ul> | <ul> | ||||
| <li>classic (the standard compiler of JDK 1.1/1.2)</li> | |||||
| <li>modern (the new compiler of JDK 1.3)</li> | |||||
| <li>classic (the standard compiler of JDK 1.1/1.2) - javac1.1 and | |||||
| javac1.2 can be used as aliases</li> | |||||
| <li>modern (the standard compiler of JDK 1.3/1.4) - javac1.3 and | |||||
| javac1.4 can be used as aliases</li> | |||||
| <li>jikes (the <a | <li>jikes (the <a | ||||
| href="http://oss.software.ibm.com/developerworks/opensource/jikes/project" target="_top">Jikes</a> | href="http://oss.software.ibm.com/developerworks/opensource/jikes/project" target="_top">Jikes</a> | ||||
| compiler)</li> | compiler)</li> | ||||
| @@ -450,9 +450,18 @@ public class Javac extends MatchingTask { | |||||
| if (fork) { | if (fork) { | ||||
| if (compiler != null) { | if (compiler != null) { | ||||
| log("Since fork is true, ignoring build.compiler setting.", Project.MSG_WARN); | |||||
| } | |||||
| compiler = "extJavac"; | |||||
| if (isJdkCompiler(compiler)) { | |||||
| log("Since fork is true, ignoring build.compiler setting.", | |||||
| Project.MSG_WARN); | |||||
| compiler = "extJavac"; | |||||
| } | |||||
| else { | |||||
| log("Since build.compiler setting isn't classic or modern, ignoring fork setting.", Project.MSG_WARN); | |||||
| } | |||||
| } | |||||
| else { | |||||
| compiler = "extJavac"; | |||||
| } | |||||
| } | } | ||||
| if (compiler == null) { | if (compiler == null) { | ||||
| @@ -522,4 +531,13 @@ public class Javac extends MatchingTask { | |||||
| return compileList; | return compileList; | ||||
| } | } | ||||
| protected boolean isJdkCompiler(String compiler) { | |||||
| return "modern".equals(compiler) || | |||||
| "classic".equals(compiler) || | |||||
| "javac1.1".equals(compiler) || | |||||
| "javac1.2".equals(compiler) || | |||||
| "javac1.3".equals(compiler) || | |||||
| "javac1.4".equals(compiler); | |||||
| } | |||||
| } | } | ||||
| @@ -109,7 +109,8 @@ public class CompilerAdapterFactory { | |||||
| return new Javac12(); | return new Javac12(); | ||||
| } | } | ||||
| if ( compilerType.equalsIgnoreCase("modern") || | if ( compilerType.equalsIgnoreCase("modern") || | ||||
| compilerType.equalsIgnoreCase("javac1.3")) { | |||||
| compilerType.equalsIgnoreCase("javac1.3") || | |||||
| compilerType.equalsIgnoreCase("javac1.4")) { | |||||
| // does the modern compiler exist? | // does the modern compiler exist? | ||||
| try { | try { | ||||
| Class.forName("com.sun.tools.javac.Main"); | Class.forName("com.sun.tools.javac.Main"); | ||||