for now git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272450 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1,13 +1,15 @@ | |||||
<project default="checkstyle" name="CheckAnt"> | <project default="checkstyle" name="CheckAnt"> | ||||
<property name="java.dir" value="src/main"/> | <property name="java.dir" value="src/main"/> | ||||
<property name="tocheck" value="**/*.java"/> | <property name="tocheck" value="**/*.java"/> | ||||
<property name="javadoc.scope" value="public"/> | |||||
<target name="checkstyle"> | <target name="checkstyle"> | ||||
<taskdef name="checkstyle" | <taskdef name="checkstyle" | ||||
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/> | classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/> | ||||
<checkstyle headerFile="src/etc/RequiredHeader.txt" | <checkstyle headerFile="src/etc/RequiredHeader.txt" | ||||
headerIgnoreLine="4" | headerIgnoreLine="4" | ||||
allowProtected="true"> | |||||
allowProtected="true" | |||||
javadocScope="${javadoc.scope}"> | |||||
<fileset dir="${java.dir}"> | <fileset dir="${java.dir}"> | ||||
<include name="${tocheck}"/> | <include name="${tocheck}"/> | ||||
</fileset> | </fileset> | ||||
@@ -100,7 +100,7 @@ public class StringInputStream | |||||
} | } | ||||
/** | /** | ||||
* Resetthe StringReader | |||||
* Reset the StringReader. | |||||
*/ | */ | ||||
public synchronized void reset() throws IOException { | public synchronized void reset() throws IOException { | ||||
in.reset(); | in.reset(); | ||||
@@ -182,11 +182,11 @@ public abstract class AbstractCvsTask extends Task { | |||||
super(); | super(); | ||||
} | } | ||||
public void setExecuteStreamHandler(ExecuteStreamHandler handler){ | |||||
public void setExecuteStreamHandler(ExecuteStreamHandler handler) { | |||||
this.executeStreamHandler = handler; | this.executeStreamHandler = handler; | ||||
} | } | ||||
protected ExecuteStreamHandler getExecuteStreamHandler(){ | |||||
protected ExecuteStreamHandler getExecuteStreamHandler() { | |||||
if (this.executeStreamHandler == null) { | if (this.executeStreamHandler == null) { | ||||
setExecuteStreamHandler(new PumpStreamHandler(getOutputStream(), | setExecuteStreamHandler(new PumpStreamHandler(getOutputStream(), | ||||
@@ -197,12 +197,12 @@ public abstract class AbstractCvsTask extends Task { | |||||
} | } | ||||
protected void setOutputStream(OutputStream outputStream){ | |||||
protected void setOutputStream(OutputStream outputStream) { | |||||
this.outputStream = outputStream; | this.outputStream = outputStream; | ||||
} | } | ||||
protected OutputStream getOutputStream(){ | |||||
protected OutputStream getOutputStream() { | |||||
if (this.outputStream == null) { | if (this.outputStream == null) { | ||||
@@ -224,12 +224,12 @@ public abstract class AbstractCvsTask extends Task { | |||||
return this.outputStream; | return this.outputStream; | ||||
} | } | ||||
protected void setErrorStream(OutputStream errorStream){ | |||||
protected void setErrorStream(OutputStream errorStream) { | |||||
this.errorStream = errorStream; | this.errorStream = errorStream; | ||||
} | } | ||||
protected OutputStream getErrorStream(){ | |||||
protected OutputStream getErrorStream() { | |||||
if (this.errorStream == null) { | if (this.errorStream == null) { | ||||
@@ -535,7 +535,9 @@ public class Ant extends Task { | |||||
public static class Reference | public static class Reference | ||||
extends org.apache.tools.ant.types.Reference { | extends org.apache.tools.ant.types.Reference { | ||||
public Reference() {super();} | |||||
public Reference() { | |||||
super(); | |||||
} | |||||
private String targetid = null; | private String targetid = null; | ||||
@@ -83,7 +83,6 @@ import java.io.IOException; | |||||
* | * | ||||
* @ant.task category="xml" | * @ant.task category="xml" | ||||
*/ | */ | ||||
public class AntStructure extends Task { | public class AntStructure extends Task { | ||||
private final String lSep = System.getProperty("line.separator"); | private final String lSep = System.getProperty("line.separator"); | ||||
@@ -103,6 +102,11 @@ public class AntStructure extends Task { | |||||
this.output = output; | this.output = output; | ||||
} | } | ||||
/** | |||||
* Build the antstructure DTD. | |||||
* | |||||
* @exception BuildException if the DTD cannot be written. | |||||
*/ | |||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (output == null) { | if (output == null) { | ||||
@@ -106,6 +106,9 @@ public class CVSPass extends Task { | |||||
243, 233, 253, 240, 194, 250, 191, 155, 142, 137, 245, 235, 163, 242, 178, 152 | 243, 233, 253, 240, 194, 250, 191, 155, 142, 137, 245, 235, 163, 242, 178, 152 | ||||
}; | }; | ||||
/** | |||||
* Create a CVS task using the default cvspass file location. | |||||
*/ | |||||
public CVSPass(){ | public CVSPass(){ | ||||
passFile = new File(System.getProperty("user.home") + "/.cvspass"); | passFile = new File(System.getProperty("user.home") + "/.cvspass"); | ||||
} | } | ||||
@@ -121,6 +121,9 @@ public class Copy extends Task { | |||||
private FileUtils fileUtils; | private FileUtils fileUtils; | ||||
private String encoding = null; | private String encoding = null; | ||||
/** | |||||
* Copy task constructor. | |||||
*/ | |||||
public Copy() { | public Copy() { | ||||
fileUtils = FileUtils.newFileUtils(); | fileUtils = FileUtils.newFileUtils(); | ||||
} | } | ||||
@@ -76,6 +76,9 @@ public class Ear extends Jar { | |||||
private File deploymentDescriptor; | private File deploymentDescriptor; | ||||
private boolean descriptorAdded; | private boolean descriptorAdded; | ||||
/** | |||||
* Create an Ear task. | |||||
*/ | |||||
public Ear() { | public Ear() { | ||||
super(); | super(); | ||||
archiveType = "ear"; | archiveType = "ear"; | ||||
@@ -114,6 +114,12 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter { | |||||
private FileUtils fileUtils = FileUtils.newFileUtils(); | private FileUtils fileUtils = FileUtils.newFileUtils(); | ||||
/** | |||||
* Set the Javac instance which contains the configured compilation | |||||
* attributes. | |||||
* | |||||
* @param attributes a configured Javac task. | |||||
*/ | |||||
public void setJavac(Javac attributes) { | public void setJavac(Javac attributes) { | ||||
this.attributes = attributes; | this.attributes = attributes; | ||||
src = attributes.getSrcdir(); | src = attributes.getSrcdir(); | ||||
@@ -138,6 +144,11 @@ public abstract class DefaultCompilerAdapter implements CompilerAdapter { | |||||
memoryMaximumSize = attributes.getMemoryMaximumSize(); | memoryMaximumSize = attributes.getMemoryMaximumSize(); | ||||
} | } | ||||
/** | |||||
* Get the Javac task instance associated with this compiler adapter | |||||
* | |||||
* @return the configured Javac task instance used by this adapter. | |||||
*/ | |||||
public Javac getJavac() { | public Javac getJavac() { | ||||
return attributes; | return attributes; | ||||
} | } | ||||
@@ -79,6 +79,11 @@ import java.lang.reflect.Method; | |||||
*/ | */ | ||||
public class Javac12 extends DefaultCompilerAdapter { | public class Javac12 extends DefaultCompilerAdapter { | ||||
/** | |||||
* Run the compilation. | |||||
* | |||||
* @exception BuildException if the compilation has problems. | |||||
*/ | |||||
public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
attributes.log("Using classic compiler", Project.MSG_VERBOSE); | attributes.log("Using classic compiler", Project.MSG_VERBOSE); | ||||
Commandline cmd = setupJavacCommand(true); | Commandline cmd = setupJavacCommand(true); | ||||
@@ -82,6 +82,11 @@ public class Javac13 extends DefaultCompilerAdapter { | |||||
*/ | */ | ||||
private static final int MODERN_COMPILER_SUCCESS = 0; | private static final int MODERN_COMPILER_SUCCESS = 0; | ||||
/** | |||||
* Run the compilation. | |||||
* | |||||
* @exception BuildException if the compilation has problems. | |||||
*/ | |||||
public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
attributes.log("Using modern compiler", Project.MSG_VERBOSE); | attributes.log("Using modern compiler", Project.MSG_VERBOSE); | ||||
Commandline cmd = setupModernJavacCommand(); | Commandline cmd = setupModernJavacCommand(); | ||||
@@ -73,6 +73,11 @@ import org.apache.tools.ant.types.Commandline; | |||||
*/ | */ | ||||
public class Jvc extends DefaultCompilerAdapter { | public class Jvc extends DefaultCompilerAdapter { | ||||
/** | |||||
* Run the compilation. | |||||
* | |||||
* @exception BuildException if the compilation has problems. | |||||
*/ | |||||
public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
attributes.log("Using jvc compiler", Project.MSG_VERBOSE); | attributes.log("Using jvc compiler", Project.MSG_VERBOSE); | ||||
@@ -74,6 +74,11 @@ import java.lang.reflect.Method; | |||||
*/ | */ | ||||
public class Kjc extends DefaultCompilerAdapter { | public class Kjc extends DefaultCompilerAdapter { | ||||
/** | |||||
* Run the compilation. | |||||
* | |||||
* @exception BuildException if the compilation has problems. | |||||
*/ | |||||
public boolean execute() throws BuildException { | public boolean execute() throws BuildException { | ||||
attributes.log("Using kjc compiler", Project.MSG_VERBOSE); | attributes.log("Using kjc compiler", Project.MSG_VERBOSE); | ||||
Commandline cmd = setupKjcCommand(); | Commandline cmd = setupKjcCommand(); | ||||
@@ -65,7 +65,7 @@ import java.io.File; | |||||
/** | /** | ||||
* Build EJB support classes using Weblogic's ejbc tool from a directory containing | * Build EJB support classes using Weblogic's ejbc tool from a directory containing | ||||
* a set of deployment descriptors. | * a set of deployment descriptors. | ||||
* | |||||
* | * | ||||
* @author Conor MacNeill, Cortex ebusiness Pty Limited | * @author Conor MacNeill, Cortex ebusiness Pty Limited | ||||
*/ | */ | ||||
@@ -100,6 +100,7 @@ public class Path extends DataType implements Cloneable { | |||||
private Vector elements; | private Vector elements; | ||||
/** The system classspath as a Path object */ | |||||
public static Path systemClasspath = | public static Path systemClasspath = | ||||
new Path(null, System.getProperty("java.class.path")); | new Path(null, System.getProperty("java.class.path")); | ||||
@@ -97,6 +97,7 @@ import org.apache.tools.ant.util.regexp.RegexpFactory; | |||||
* @ant.datatype name="regexp" | * @ant.datatype name="regexp" | ||||
*/ | */ | ||||
public class RegularExpression extends DataType { | public class RegularExpression extends DataType { | ||||
/** Name of this data type */ | |||||
public static final String DATA_TYPE_NAME = "regexp"; | public static final String DATA_TYPE_NAME = "regexp"; | ||||
// The regular expression factory | // The regular expression factory | ||||
@@ -71,6 +71,7 @@ import org.apache.tools.ant.Project; | |||||
* @author Matthew Inger <a href="mailto:mattinger@mindless.com">mattinger@mindless.com</a> | * @author Matthew Inger <a href="mailto:mattinger@mindless.com">mattinger@mindless.com</a> | ||||
*/ | */ | ||||
public class Substitution extends DataType { | public class Substitution extends DataType { | ||||
/** The name of this data type */ | |||||
public static final String DATA_TYPE_NAME = "substitition"; | public static final String DATA_TYPE_NAME = "substitition"; | ||||
private String expression; | private String expression; | ||||
@@ -71,8 +71,13 @@ import java.io.IOException; | |||||
* @author Timothy Gerard Endres <a href="mailto:time@ice.com">time@ice.com</a> | * @author Timothy Gerard Endres <a href="mailto:time@ice.com">time@ice.com</a> | ||||
*/ | */ | ||||
public class TarOutputStream extends FilterOutputStream { | public class TarOutputStream extends FilterOutputStream { | ||||
/** Fail if a long file name is required in the archive. */ | |||||
public static final int LONGFILE_ERROR = 0; | public static final int LONGFILE_ERROR = 0; | ||||
/** Long paths will be truncated in the archive. */ | |||||
public static final int LONGFILE_TRUNCATE = 1; | public static final int LONGFILE_TRUNCATE = 1; | ||||
/** GNU tar extensions are used to store long file names in the archive. */ | |||||
public static final int LONGFILE_GNU = 2; | public static final int LONGFILE_GNU = 2; | ||||
protected boolean debug; | protected boolean debug; | ||||