git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278259 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -1,5 +1,5 @@ | |||||
| /* | /* | ||||
| * Copyright 2001-2004 The Apache Software Foundation | |||||
| * Copyright 2001-2005 The Apache Software Foundation | |||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| @@ -37,6 +37,7 @@ public interface CompilerAdapter { | |||||
| /** | /** | ||||
| * Sets the compiler attributes, which are stored in the Javac task. | * Sets the compiler attributes, which are stored in the Javac task. | ||||
| * @param attributes the compiler attributes | |||||
| */ | */ | ||||
| void setJavac(Javac attributes); | void setJavac(Javac attributes); | ||||
| @@ -44,6 +45,7 @@ public interface CompilerAdapter { | |||||
| * Executes the task. | * Executes the task. | ||||
| * | * | ||||
| * @return has the compilation been successful | * @return has the compilation been successful | ||||
| * @throws BuildException on error | |||||
| */ | */ | ||||
| boolean execute() throws BuildException; | boolean execute() throws BuildException; | ||||
| } | } | ||||
| @@ -27,7 +27,7 @@ import org.apache.tools.ant.util.JavaEnvUtils; | |||||
| * | * | ||||
| * @since Ant 1.3 | * @since Ant 1.3 | ||||
| */ | */ | ||||
| public class CompilerAdapterFactory { | |||||
| public final class CompilerAdapterFactory { | |||||
| private static final String MODERN_COMPILER = "com.sun.tools.javac.Main"; | private static final String MODERN_COMPILER = "com.sun.tools.javac.Main"; | ||||
| /** This is a singleton -- can't create instances!! */ | /** This is a singleton -- can't create instances!! */ | ||||
| @@ -55,6 +55,7 @@ public class CompilerAdapterFactory { | |||||
| * @param compilerType either the name of the desired compiler, or the | * @param compilerType either the name of the desired compiler, or the | ||||
| * full classname of the compiler's adapter. | * full classname of the compiler's adapter. | ||||
| * @param task a task to log through. | * @param task a task to log through. | ||||
| * @return the compiler adapter | |||||
| * @throws BuildException if the compiler type could not be resolved into | * @throws BuildException if the compiler type could not be resolved into | ||||
| * a compiler adapter. | * a compiler adapter. | ||||
| */ | */ | ||||
| @@ -145,6 +146,7 @@ public class CompilerAdapterFactory { | |||||
| return true; | return true; | ||||
| } | } | ||||
| } catch (ClassNotFoundException cnfe2) { | } catch (ClassNotFoundException cnfe2) { | ||||
| // Ignore Exception | |||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| @@ -33,6 +33,8 @@ public class Gcj extends DefaultCompilerAdapter { | |||||
| /** | /** | ||||
| * Performs a compile using the gcj compiler. | * Performs a compile using the gcj compiler. | ||||
| * @return true if the compilation succeeded | |||||
| * @throws BuildException on error | |||||
| */ | */ | ||||
| public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
| Commandline cmd; | Commandline cmd; | ||||
| @@ -46,6 +48,10 @@ public class Gcj extends DefaultCompilerAdapter { | |||||
| executeExternalCompile(cmd.getCommandline(), firstFileName) == 0; | executeExternalCompile(cmd.getCommandline(), firstFileName) == 0; | ||||
| } | } | ||||
| /** | |||||
| * Set up the gcj commandline. | |||||
| * @return the command line | |||||
| */ | |||||
| protected Commandline setupGCJCommand() { | protected Commandline setupGCJCommand() { | ||||
| Commandline cmd = new Commandline(); | Commandline cmd = new Commandline(); | ||||
| Path classpath = new Path(project); | Path classpath = new Path(project); | ||||
| @@ -113,7 +119,7 @@ public class Gcj extends DefaultCompilerAdapter { | |||||
| /** | /** | ||||
| * Whether any of the arguments given via <compilerarg> | * Whether any of the arguments given via <compilerarg> | ||||
| * implies that compilation to native code is requested. | * implies that compilation to native code is requested. | ||||
| * | |||||
| * @return true if compilation to native code is requested | |||||
| * @since Ant 1.6.2 | * @since Ant 1.6.2 | ||||
| */ | */ | ||||
| public boolean isNativeBuild() { | public boolean isNativeBuild() { | ||||
| @@ -1,5 +1,5 @@ | |||||
| /* | /* | ||||
| * Copyright 2001-2002,2004 The Apache Software Foundation | |||||
| * Copyright 2001-2002,2004-2005 The Apache Software Foundation | |||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| @@ -37,7 +37,7 @@ public class Javac12 extends DefaultCompilerAdapter { | |||||
| /** | /** | ||||
| * Run the compilation. | * Run the compilation. | ||||
| * | |||||
| * @return true if the compiler ran with a zero exit result (ok) | |||||
| * @exception BuildException if the compilation has problems. | * @exception BuildException if the compilation has problems. | ||||
| */ | */ | ||||
| public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
| @@ -1,5 +1,5 @@ | |||||
| /* | /* | ||||
| * Copyright 2001-2002,2004 The Apache Software Foundation | |||||
| * Copyright 2001-2002,2004-2005 The Apache Software Foundation | |||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| @@ -39,7 +39,7 @@ public class Javac13 extends DefaultCompilerAdapter { | |||||
| /** | /** | ||||
| * Run the compilation. | * Run the compilation. | ||||
| * | |||||
| * @return true if the compiler ran with a zero exit result (ok) | |||||
| * @exception BuildException if the compilation has problems. | * @exception BuildException if the compilation has problems. | ||||
| */ | */ | ||||
| public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
| @@ -36,6 +36,8 @@ public class JavacExternal extends DefaultCompilerAdapter { | |||||
| /** | /** | ||||
| * Performs a compile using the Javac externally. | * Performs a compile using the Javac externally. | ||||
| * @return true if the compilation succeeded | |||||
| * @throws BuildException on error | |||||
| */ | */ | ||||
| public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
| attributes.log("Using external javac compiler", Project.MSG_VERBOSE); | attributes.log("Using external javac compiler", Project.MSG_VERBOSE); | ||||
| @@ -39,7 +39,9 @@ public class Jikes extends DefaultCompilerAdapter { | |||||
| * there is no option in jikes and I don't understand | * there is no option in jikes and I don't understand | ||||
| * what they should do. | * what they should do. | ||||
| * | * | ||||
| * It has been successfully tested with jikes >1.10 | |||||
| * It has been successfully tested with jikes >1.10. | |||||
| * @return true if the compilation succeeded | |||||
| * @throws BuildException on error | |||||
| */ | */ | ||||
| public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
| attributes.log("Using jikes compiler", Project.MSG_VERBOSE); | attributes.log("Using jikes compiler", Project.MSG_VERBOSE); | ||||
| @@ -88,7 +90,7 @@ public class Jikes extends DefaultCompilerAdapter { | |||||
| String exec = getJavac().getExecutable(); | String exec = getJavac().getExecutable(); | ||||
| cmd.setExecutable(exec == null ? "jikes" : exec); | cmd.setExecutable(exec == null ? "jikes" : exec); | ||||
| if (deprecation == true) { | |||||
| if (deprecation) { | |||||
| cmd.createArgument().setValue("-deprecation"); | cmd.createArgument().setValue("-deprecation"); | ||||
| } | } | ||||
| @@ -1,5 +1,5 @@ | |||||
| /* | /* | ||||
| * Copyright 2001-2004 The Apache Software Foundation | |||||
| * Copyright 2001-2005 The Apache Software Foundation | |||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| @@ -33,7 +33,7 @@ public class Jvc extends DefaultCompilerAdapter { | |||||
| /** | /** | ||||
| * Run the compilation. | * Run the compilation. | ||||
| * | |||||
| * @return true if the compiler ran with a zero exit result (ok) | |||||
| * @exception BuildException if the compilation has problems. | * @exception BuildException if the compilation has problems. | ||||
| */ | */ | ||||
| public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
| @@ -34,7 +34,7 @@ public class Kjc extends DefaultCompilerAdapter { | |||||
| /** | /** | ||||
| * Run the compilation. | * Run the compilation. | ||||
| * | |||||
| * @return true if the compilation succeeded | |||||
| * @exception BuildException if the compilation has problems. | * @exception BuildException if the compilation has problems. | ||||
| */ | */ | ||||
| public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
| @@ -48,6 +48,7 @@ public class Kjc extends DefaultCompilerAdapter { | |||||
| /** | /** | ||||
| * setup kjc command arguments. | * setup kjc command arguments. | ||||
| * @return the command line | |||||
| */ | */ | ||||
| protected Commandline setupKjcCommand() { | protected Commandline setupKjcCommand() { | ||||
| Commandline cmd = new Commandline(); | Commandline cmd = new Commandline(); | ||||
| @@ -55,7 +56,7 @@ public class Kjc extends DefaultCompilerAdapter { | |||||
| // generate classpath, because kjc doesn't support sourcepath. | // generate classpath, because kjc doesn't support sourcepath. | ||||
| Path classpath = getCompileClasspath(); | Path classpath = getCompileClasspath(); | ||||
| if (deprecation == true) { | |||||
| if (deprecation) { | |||||
| cmd.createArgument().setValue("-deprecation"); | cmd.createArgument().setValue("-deprecation"); | ||||
| } | } | ||||
| @@ -31,6 +31,8 @@ public class Sj extends DefaultCompilerAdapter { | |||||
| /** | /** | ||||
| * Performs a compile using the sj compiler from Symantec. | * Performs a compile using the sj compiler from Symantec. | ||||
| * @return true if the compilation succeeded | |||||
| * @throws BuildException on error | |||||
| */ | */ | ||||
| public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
| attributes.log("Using symantec java compiler", Project.MSG_VERBOSE); | attributes.log("Using symantec java compiler", Project.MSG_VERBOSE); | ||||