git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273157 13f79535-47bb-0310-9956-ffa450edef68master
@@ -65,12 +65,26 @@ import java.util.Enumeration; | |||||
* @see Project#createTask | * @see Project#createTask | ||||
*/ | */ | ||||
public abstract class Task extends ProjectComponent { | public abstract class Task extends ProjectComponent { | ||||
/** Target this task belongs to, if any. */ | |||||
/** | |||||
* Target this task belongs to, if any. | |||||
* @deprecated You should not be accessing this variable directly. | |||||
* Please use the {@link #getOwningTarget()} method. | |||||
*/ | |||||
protected Target target; | protected Target target; | ||||
/** Description of this task, if any. */ | |||||
/** | |||||
* Description of this task, if any. | |||||
* @deprecated You should not be accessing this variable directly. | |||||
*/ | |||||
protected String description; | protected String description; | ||||
/** Location within the build file of this task definition. */ | |||||
/** | |||||
* Location within the build file of this task definition. | |||||
* @deprecated You should not be accessing this variable directly. | |||||
* Please use the {@link #getLocation()} method. | |||||
*/ | |||||
protected Location location = Location.UNKNOWN_LOCATION; | protected Location location = Location.UNKNOWN_LOCATION; | ||||
/** | /** | ||||
* Name of this task to be used for logging purposes. | * Name of this task to be used for logging purposes. | ||||
* This defaults to the same as the type, but may be | * This defaults to the same as the type, but may be | ||||
@@ -78,18 +92,33 @@ public abstract class Task extends ProjectComponent { | |||||
* isn't terribly descriptive for a task used within | * isn't terribly descriptive for a task used within | ||||
* another task - the outer task code can probably | * another task - the outer task code can probably | ||||
* provide a better one. | * provide a better one. | ||||
* @deprecated You should not be accessing this variable directly. | |||||
* Please use the {@link #getTaskName()} method. | |||||
*/ | |||||
protected String taskName; | |||||
/** | |||||
* Type of this task. | |||||
* | |||||
* @deprecated You should not be accessing this variable directly. | |||||
* Please use the {@link #getTaskType()} method. | |||||
*/ | |||||
protected String taskType; | |||||
/** | |||||
* Wrapper for this object, used to configure it at runtime. | |||||
* | |||||
* @deprecated You should not be accessing this variable directly. | |||||
* Please use the {@link #getWrapper()} method. | |||||
*/ | */ | ||||
protected String taskName = null; | |||||
/** Type of this task. */ | |||||
protected String taskType = null; | |||||
/** Wrapper for this object, used to configure it at runtime. */ | |||||
protected RuntimeConfigurable wrapper; | protected RuntimeConfigurable wrapper; | ||||
/** | /** | ||||
* Whether or not this task is invalid. A task becomes invalid | * Whether or not this task is invalid. A task becomes invalid | ||||
* if a conflicting class is specified as the implementation for | * if a conflicting class is specified as the implementation for | ||||
* its type. | * its type. | ||||
*/ | */ | ||||
private boolean invalid = false; | |||||
private boolean invalid; | |||||
/** Sole constructor. */ | /** Sole constructor. */ | ||||
public Task() { | public Task() { | ||||
@@ -401,4 +430,12 @@ public abstract class Task extends ProjectComponent { | |||||
replaceChildren(childWrapper, childElement); | replaceChildren(childWrapper, childElement); | ||||
} | } | ||||
} | } | ||||
protected String getTaskType() { | |||||
return taskType; | |||||
} | |||||
protected RuntimeConfigurable getWrapper() { | |||||
return wrapper; | |||||
} | |||||
} | } |
@@ -112,16 +112,16 @@ public class UnknownElement extends Task { | |||||
* @exception BuildException if the configuration fails | * @exception BuildException if the configuration fails | ||||
*/ | */ | ||||
public void maybeConfigure() throws BuildException { | public void maybeConfigure() throws BuildException { | ||||
realThing = makeObject(this, wrapper); | |||||
realThing = makeObject(this, getWrapper()); | |||||
wrapper.setProxy(realThing); | |||||
getWrapper().setProxy(realThing); | |||||
if (realThing instanceof Task) { | if (realThing instanceof Task) { | ||||
((Task) realThing).setRuntimeConfigurableWrapper(wrapper); | |||||
((Task) realThing).setRuntimeConfigurableWrapper(getWrapper()); | |||||
} | } | ||||
handleChildren(realThing, wrapper); | |||||
handleChildren(realThing, getWrapper()); | |||||
wrapper.maybeConfigure(getProject()); | |||||
getWrapper().maybeConfigure(getProject()); | |||||
} | } | ||||
/** | /** | ||||
@@ -159,7 +159,7 @@ public class UnknownElement extends Task { | |||||
// plain impossible to get here, maybeConfigure should | // plain impossible to get here, maybeConfigure should | ||||
// have thrown an exception. | // have thrown an exception. | ||||
throw new BuildException("Could not create task of type: " | throw new BuildException("Could not create task of type: " | ||||
+ elementName, location); | |||||
+ elementName, getLocation()); | |||||
} | } | ||||
if (realThing instanceof Task) { | if (realThing instanceof Task) { | ||||
@@ -271,7 +271,7 @@ public class UnknownElement extends Task { | |||||
if (task != null) { | if (task != null) { | ||||
task.setLocation(getLocation()); | task.setLocation(getLocation()); | ||||
// UnknownElement always has an associated target | // UnknownElement always has an associated target | ||||
task.setOwningTarget(target); | |||||
task.setOwningTarget(getOwningTarget()); | |||||
task.init(); | task.init(); | ||||
} | } | ||||
return task; | return task; | ||||
@@ -325,7 +325,7 @@ public class UnknownElement extends Task { | |||||
+ "as this is not an Ant bug."; | + "as this is not an Ant bug."; | ||||
return new BuildException(msg, location); | |||||
return new BuildException(msg, getLocation()); | |||||
} | } | ||||
/** | /** | ||||
@@ -214,7 +214,7 @@ public abstract class AbstractCvsTask extends Task { | |||||
.getPath(), | .getPath(), | ||||
append)))); | append)))); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} else { | } else { | ||||
setOutputStream(new LogOutputStream(this, Project.MSG_INFO)); | setOutputStream(new LogOutputStream(this, Project.MSG_INFO)); | ||||
@@ -241,7 +241,7 @@ public abstract class AbstractCvsTask extends Task { | |||||
new FileOutputStream(error.getPath(), | new FileOutputStream(error.getPath(), | ||||
append)))); | append)))); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} else { | } else { | ||||
setErrorStream(new LogOutputStream(this, Project.MSG_WARN)); | setErrorStream(new LogOutputStream(this, Project.MSG_WARN)); | ||||
@@ -333,11 +333,11 @@ public abstract class AbstractCvsTask extends Task { | |||||
+ retCode | + retCode | ||||
+ StringUtils.LINE_SEP | + StringUtils.LINE_SEP | ||||
+ "Command line was [" | + "Command line was [" | ||||
+ actualCommandLine + "]", location); | |||||
+ actualCommandLine + "]", getLocation()); | |||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} else { | } else { | ||||
log("Caught exception: " + e.getMessage(), Project.MSG_WARN); | log("Caught exception: " + e.getMessage(), Project.MSG_WARN); | ||||
} | } | ||||
@@ -353,7 +353,7 @@ public abstract class AbstractCvsTask extends Task { | |||||
} | } | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} else { | } else { | ||||
log("Caught exception: " + e.getMessage(), Project.MSG_WARN); | log("Caught exception: " + e.getMessage(), Project.MSG_WARN); | ||||
} | } | ||||
@@ -488,7 +488,7 @@ public class Ant extends Task { | |||||
} catch (Exception e2) { | } catch (Exception e2) { | ||||
String msg = "Error setting new project instance for " | String msg = "Error setting new project instance for " | ||||
+ "reference with id " + oldKey; | + "reference with id " + oldKey; | ||||
throw new BuildException(msg, e2, location); | |||||
throw new BuildException(msg, e2, getLocation()); | |||||
} | } | ||||
} | } | ||||
newProject.addReference(newKey, copy); | newProject.addReference(newKey, copy); | ||||
@@ -110,7 +110,7 @@ public class AntStructure extends Task { | |||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (output == null) { | if (output == null) { | ||||
throw new BuildException("output attribute is required", location); | |||||
throw new BuildException("output attribute is required", getLocation()); | |||||
} | } | ||||
PrintWriter out = null; | PrintWriter out = null; | ||||
@@ -147,8 +147,8 @@ public class AntStructure extends Task { | |||||
} | } | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException("Error writing " | |||||
+ output.getAbsolutePath(), ioe, location); | |||||
throw new BuildException("Error writing " | |||||
+ output.getAbsolutePath(), ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (out != null) { | if (out != null) { | ||||
out.close(); | out.close(); | ||||
@@ -349,8 +349,8 @@ public class AntStructure extends Task { | |||||
final int count = v.size(); | final int count = v.size(); | ||||
for (int i = 0; i < count; i++) { | for (int i = 0; i < count; i++) { | ||||
String nestedName = (String) v.elementAt(i); | String nestedName = (String) v.elementAt(i); | ||||
if (!"#PCDATA".equals(nestedName) | |||||
&& !TASKS.equals(nestedName) | |||||
if (!"#PCDATA".equals(nestedName) | |||||
&& !TASKS.equals(nestedName) | |||||
&& !TYPES.equals(nestedName)) { | && !TYPES.equals(nestedName)) { | ||||
printElementDecl(out, nestedName, ih.getElementType(nestedName)); | printElementDecl(out, nestedName, ih.getElementType(nestedName)); | ||||
} | } | ||||
@@ -240,7 +240,7 @@ public class Available extends Task implements Condition { | |||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (property == null) { | if (property == null) { | ||||
throw new BuildException("property attribute is required", | throw new BuildException("property attribute is required", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
isTask = true; | isTask = true; | ||||
@@ -269,14 +269,14 @@ public class Available extends Task implements Condition { | |||||
public boolean eval() throws BuildException { | public boolean eval() throws BuildException { | ||||
if (classname == null && file == null && resource == null) { | if (classname == null && file == null && resource == null) { | ||||
throw new BuildException("At least one of (classname|file|" | throw new BuildException("At least one of (classname|file|" | ||||
+ "resource) is required", location); | |||||
+ "resource) is required", getLocation()); | |||||
} | } | ||||
if (type != null) { | if (type != null) { | ||||
if (file == null) { | if (file == null) { | ||||
throw new BuildException("The type attribute is only valid " | throw new BuildException("The type attribute is only valid " | ||||
+ "when specifying the file " | + "when specifying the file " | ||||
+ "attribute.", location); | |||||
+ "attribute.", getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -97,11 +97,11 @@ public class BUnzip2 extends Unpack { | |||||
bis = new BufferedInputStream(fis); | bis = new BufferedInputStream(fis); | ||||
int b = bis.read(); | int b = bis.read(); | ||||
if (b != 'B') { | if (b != 'B') { | ||||
throw new BuildException("Invalid bz2 file.", location); | |||||
throw new BuildException("Invalid bz2 file.", getLocation()); | |||||
} | } | ||||
b = bis.read(); | b = bis.read(); | ||||
if (b != 'Z') { | if (b != 'Z') { | ||||
throw new BuildException("Invalid bz2 file.", location); | |||||
throw new BuildException("Invalid bz2 file.", getLocation()); | |||||
} | } | ||||
zIn = new CBZip2InputStream(bis); | zIn = new CBZip2InputStream(bis); | ||||
byte[] buffer = new byte[8 * 1024]; | byte[] buffer = new byte[8 * 1024]; | ||||
@@ -112,7 +112,7 @@ public class BUnzip2 extends Unpack { | |||||
} while (count != -1); | } while (count != -1); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "Problem expanding bzip2 " + ioe.getMessage(); | String msg = "Problem expanding bzip2 " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (bis != null) { | if (bis != null) { | ||||
try { | try { | ||||
@@ -84,7 +84,7 @@ public class BZip2 extends Pack { | |||||
zipFile(source, zOut); | zipFile(source, zOut); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "Problem creating bzip2 " + ioe.getMessage(); | String msg = "Problem creating bzip2 " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (zOut != null) { | if (zOut != null) { | ||||
try { | try { | ||||
@@ -119,10 +119,10 @@ public class Basename extends Task { | |||||
// The method executing the task | // The method executing the task | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (property == null) { | if (property == null) { | ||||
throw new BuildException("property attribute required", location); | |||||
throw new BuildException("property attribute required", getLocation()); | |||||
} | } | ||||
if (file == null) { | if (file == null) { | ||||
throw new BuildException("file attribute required", location); | |||||
throw new BuildException("file attribute required", getLocation()); | |||||
} | } | ||||
String value = file.getName(); | String value = file.getName(); | ||||
if (suffix != null && value.endsWith(suffix)) { | if (suffix != null && value.endsWith(suffix)) { | ||||
@@ -133,7 +133,7 @@ public class CallTarget extends Task { | |||||
if (subTarget == null) { | if (subTarget == null) { | ||||
throw new BuildException("Attribute target is required.", | throw new BuildException("Attribute target is required.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
callee.setAntfile(getProject().getProperty("ant.file")); | callee.setAntfile(getProject().getProperty("ant.file")); | ||||
@@ -284,21 +284,21 @@ public class Checksum extends MatchingTask implements Condition { | |||||
try { | try { | ||||
messageDigest = MessageDigest.getInstance(algorithm, provider); | messageDigest = MessageDigest.getInstance(algorithm, provider); | ||||
} catch (NoSuchAlgorithmException noalgo) { | } catch (NoSuchAlgorithmException noalgo) { | ||||
throw new BuildException(noalgo, location); | |||||
throw new BuildException(noalgo, getLocation()); | |||||
} catch (NoSuchProviderException noprovider) { | } catch (NoSuchProviderException noprovider) { | ||||
throw new BuildException(noprovider, location); | |||||
throw new BuildException(noprovider, getLocation()); | |||||
} | } | ||||
} else { | } else { | ||||
try { | try { | ||||
messageDigest = MessageDigest.getInstance(algorithm); | messageDigest = MessageDigest.getInstance(algorithm); | ||||
} catch (NoSuchAlgorithmException noalgo) { | } catch (NoSuchAlgorithmException noalgo) { | ||||
throw new BuildException(noalgo, location); | |||||
throw new BuildException(noalgo, getLocation()); | |||||
} | } | ||||
} | } | ||||
if (messageDigest == null) { | if (messageDigest == null) { | ||||
throw new BuildException("Unable to create Message Digest", | throw new BuildException("Unable to create Message Digest", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (fileext == null) { | if (fileext == null) { | ||||
@@ -354,7 +354,7 @@ public class Checksum extends MatchingTask implements Condition { | |||||
+ file.getAbsolutePath() | + file.getAbsolutePath() | ||||
+ " to generate checksum for."; | + " to generate checksum for."; | ||||
log(message); | log(message); | ||||
throw new BuildException(message, location); | |||||
throw new BuildException(message, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -429,7 +429,7 @@ public class Checksum extends MatchingTask implements Condition { | |||||
} | } | ||||
} | } | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} finally { | } finally { | ||||
if (fis != null) { | if (fis != null) { | ||||
try { | try { | ||||
@@ -190,7 +190,7 @@ public class Chmod extends ExecuteOn { | |||||
protected void checkConfiguration() { | protected void checkConfiguration() { | ||||
if (!havePerm) { | if (!havePerm) { | ||||
throw new BuildException("Required attribute perm not set in chmod", | throw new BuildException("Required attribute perm not set in chmod", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (defaultSetDefined && defaultSet.getDir(getProject()) != null) { | if (defaultSetDefined && defaultSet.getDir(getProject()) != null) { | ||||
@@ -224,7 +224,7 @@ public class Chmod extends ExecuteOn { | |||||
execute.setCommandline(cloned.getCommandline()); | execute.setCommandline(cloned.getCommandline()); | ||||
runExecute(execute); | runExecute(execute); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException("Execute failed: " + e, e, location); | |||||
throw new BuildException("Execute failed: " + e, e, getLocation()); | |||||
} finally { | } finally { | ||||
// close the output file if required | // close the output file if required | ||||
logFlush(); | logFlush(); | ||||
@@ -236,24 +236,24 @@ public class Chmod extends ExecuteOn { | |||||
* @ant.attribute ignore="true" | * @ant.attribute ignore="true" | ||||
*/ | */ | ||||
public void setExecutable(String e) { | public void setExecutable(String e) { | ||||
throw new BuildException(taskType | |||||
+ " doesn\'t support the executable attribute", location); | |||||
throw new BuildException(getTaskType() | |||||
+ " doesn\'t support the executable attribute", getLocation()); | |||||
} | } | ||||
/** | /** | ||||
* @ant.attribute ignore="true" | * @ant.attribute ignore="true" | ||||
*/ | */ | ||||
public void setCommand(Commandline cmdl) { | public void setCommand(Commandline cmdl) { | ||||
throw new BuildException(taskType | |||||
+ " doesn\'t support the command attribute", location); | |||||
throw new BuildException(getTaskType() | |||||
+ " doesn\'t support the command attribute", getLocation()); | |||||
} | } | ||||
/** | /** | ||||
* @ant.attribute ignore="true" | * @ant.attribute ignore="true" | ||||
*/ | */ | ||||
public void setSkipEmptyFilesets(boolean skip) { | public void setSkipEmptyFilesets(boolean skip) { | ||||
throw new BuildException(taskType | |||||
+ " doesn\'t support the skipemptyfileset attribute", location); | |||||
throw new BuildException(getTaskType() | |||||
+ " doesn\'t support the skipemptyfileset attribute", getLocation()); | |||||
} | } | ||||
protected boolean isValidOs() { | protected boolean isValidOs() { | ||||
@@ -280,7 +280,7 @@ public class Copy extends Task { | |||||
public Mapper createMapper() throws BuildException { | public Mapper createMapper() throws BuildException { | ||||
if (mapperElement != null) { | if (mapperElement != null) { | ||||
throw new BuildException("Cannot define more than one mapper", | throw new BuildException("Cannot define more than one mapper", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
mapperElement = new Mapper(getProject()); | mapperElement = new Mapper(getProject()); | ||||
return mapperElement; | return mapperElement; | ||||
@@ -531,7 +531,7 @@ public class Copy extends Task { | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "Failed to copy " + fromFile + " to " + toFile | String msg = "Failed to copy " + fromFile + " to " + toFile | ||||
+ " due to " + ioe.getMessage(); | + " due to " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -106,17 +106,17 @@ public class Copydir extends MatchingTask { | |||||
if (srcDir == null) { | if (srcDir == null) { | ||||
throw new BuildException("src attribute must be set!", | throw new BuildException("src attribute must be set!", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (!srcDir.exists()) { | if (!srcDir.exists()) { | ||||
throw new BuildException("srcdir " + srcDir.toString() | throw new BuildException("srcdir " + srcDir.toString() | ||||
+ " does not exist!", location); | |||||
+ " does not exist!", getLocation()); | |||||
} | } | ||||
if (destDir == null) { | if (destDir == null) { | ||||
throw new BuildException("The dest attribute must be set.", | throw new BuildException("The dest attribute must be set.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (srcDir.equals(destDir)) { | if (srcDir.equals(destDir)) { | ||||
@@ -142,7 +142,7 @@ public class Copydir extends MatchingTask { | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "Failed to copy " + fromFile + " to " | String msg = "Failed to copy " + fromFile + " to " | ||||
+ toFile + " due to " + ioe.getMessage(); | + toFile + " due to " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -100,17 +100,17 @@ public class Copyfile extends Task { | |||||
if (srcFile == null) { | if (srcFile == null) { | ||||
throw new BuildException("The src attribute must be present.", | throw new BuildException("The src attribute must be present.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (!srcFile.exists()) { | if (!srcFile.exists()) { | ||||
throw new BuildException("src " + srcFile.toString() | throw new BuildException("src " + srcFile.toString() | ||||
+ " does not exist.", location); | |||||
+ " does not exist.", getLocation()); | |||||
} | } | ||||
if (destFile == null) { | if (destFile == null) { | ||||
throw new BuildException("The dest attribute must be present.", | throw new BuildException("The dest attribute must be present.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (srcFile.equals(destFile)) { | if (srcFile.equals(destFile)) { | ||||
@@ -168,13 +168,13 @@ public abstract class Definer extends Task { | |||||
if (name != null || value != null) { | if (name != null || value != null) { | ||||
String msg = "You must not specify name or value " | String msg = "You must not specify name or value " | ||||
+ "together with file or resource."; | + "together with file or resource."; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
if (file != null && resource != null) { | if (file != null && resource != null) { | ||||
String msg = "You must not specify both, file and " | String msg = "You must not specify both, file and " | ||||
+ "resource."; | + "resource."; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
@@ -209,7 +209,7 @@ public abstract class Definer extends Task { | |||||
} | } | ||||
} | } | ||||
} catch (IOException ex) { | } catch (IOException ex) { | ||||
throw new BuildException(ex, location); | |||||
throw new BuildException(ex, getLocation()); | |||||
} finally { | } finally { | ||||
if (is != null) { | if (is != null) { | ||||
try { | try { | ||||
@@ -233,11 +233,11 @@ public abstract class Definer extends Task { | |||||
} catch (ClassNotFoundException cnfe) { | } catch (ClassNotFoundException cnfe) { | ||||
String msg = getTaskName() + " class " + value | String msg = getTaskName() + " class " + value | ||||
+ " cannot be found"; | + " cannot be found"; | ||||
throw new BuildException(msg, cnfe, location); | |||||
throw new BuildException(msg, cnfe, getLocation()); | |||||
} catch (NoClassDefFoundError ncdfe) { | } catch (NoClassDefFoundError ncdfe) { | ||||
String msg = getTaskName() + " class " + value | String msg = getTaskName() + " class " + value | ||||
+ " cannot be found"; | + " cannot be found"; | ||||
throw new BuildException(msg, ncdfe, location); | |||||
throw new BuildException(msg, ncdfe, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -279,7 +279,7 @@ public class Delete extends MatchingTask { | |||||
if (quiet && failonerror) { | if (quiet && failonerror) { | ||||
throw new BuildException("quiet and failonerror cannot both be " | throw new BuildException("quiet and failonerror cannot both be " | ||||
+ "set to true", location); | |||||
+ "set to true", getLocation()); | |||||
} | } | ||||
@@ -94,7 +94,7 @@ public class Deltree extends Task { | |||||
+ "Use delete instead."); | + "Use delete instead."); | ||||
if (dir == null) { | if (dir == null) { | ||||
throw new BuildException("dir attribute must be set!", location); | |||||
throw new BuildException("dir attribute must be set!", getLocation()); | |||||
} | } | ||||
if (dir.exists()) { | if (dir.exists()) { | ||||
@@ -102,7 +102,7 @@ public class Deltree extends Task { | |||||
if (!dir.delete()) { | if (!dir.delete()) { | ||||
throw new BuildException("Unable to delete directory " | throw new BuildException("Unable to delete directory " | ||||
+ dir.getAbsolutePath(), | + dir.getAbsolutePath(), | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
return; | return; | ||||
} | } | ||||
@@ -113,7 +113,7 @@ public class Deltree extends Task { | |||||
removeDir(dir); | removeDir(dir); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "Unable to delete " + dir.getAbsolutePath(); | String msg = "Unable to delete " + dir.getAbsolutePath(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -107,10 +107,10 @@ public class Dirname extends Task { | |||||
// The method executing the task | // The method executing the task | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (property == null) { | if (property == null) { | ||||
throw new BuildException("property attribute required", location); | |||||
throw new BuildException("property attribute required", getLocation()); | |||||
} | } | ||||
if (file == null) { | if (file == null) { | ||||
throw new BuildException("file attribute required", location); | |||||
throw new BuildException("file attribute required", getLocation()); | |||||
} else { | } else { | ||||
String value = file.getParent(); | String value = file.getParent(); | ||||
getProject().setNewProperty(property, value); | getProject().setNewProperty(property, value); | ||||
@@ -129,7 +129,7 @@ public class Ear extends Jar { | |||||
throws IOException, BuildException { | throws IOException, BuildException { | ||||
// If no webxml file is specified, it's an error. | // If no webxml file is specified, it's an error. | ||||
if (deploymentDescriptor == null && !isInUpdateMode()) { | if (deploymentDescriptor == null && !isInUpdateMode()) { | ||||
throw new BuildException("appxml attribute is required", location); | |||||
throw new BuildException("appxml attribute is required", getLocation()); | |||||
} | } | ||||
super.initZipOutputStream(zOut); | super.initZipOutputStream(zOut); | ||||
@@ -93,7 +93,7 @@ public class Echo extends Task { | |||||
out = new FileWriter(file.getAbsolutePath(), append); | out = new FileWriter(file.getAbsolutePath(), append); | ||||
out.write(message, 0, message.length()); | out.write(message, 0, message.length()); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException(ioe, location); | |||||
throw new BuildException(ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (out != null) { | if (out != null) { | ||||
try { | try { | ||||
@@ -125,7 +125,7 @@ public class Exec extends Task { | |||||
String ant = getProject().getProperty("ant.home"); | String ant = getProject().getProperty("ant.home"); | ||||
if (ant == null) { | if (ant == null) { | ||||
throw new BuildException("Property 'ant.home' not " | throw new BuildException("Property 'ant.home' not " | ||||
+ "found", location); | |||||
+ "found", getLocation()); | |||||
} | } | ||||
String antRun = getProject().resolveFile(ant + "/bin/antRun.bat").toString(); | String antRun = getProject().resolveFile(ant + "/bin/antRun.bat").toString(); | ||||
@@ -135,8 +135,8 @@ public class Exec extends Task { | |||||
} else { | } else { | ||||
String ant = getProject().getProperty("ant.home"); | String ant = getProject().getProperty("ant.home"); | ||||
if (ant == null) { | if (ant == null) { | ||||
throw new BuildException("Property 'ant.home' not found", | |||||
location); | |||||
throw new BuildException("Property 'ant.home' not found", | |||||
getLocation()); | |||||
} | } | ||||
String antRun = getProject().resolveFile(ant + "/bin/antRun").toString(); | String antRun = getProject().resolveFile(ant + "/bin/antRun").toString(); | ||||
@@ -178,13 +178,13 @@ public class Exec extends Task { | |||||
err = proc.exitValue(); | err = proc.exitValue(); | ||||
if (err != 0) { | if (err != 0) { | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException("Exec returned: " + err, location); | |||||
throw new BuildException("Exec returned: " + err, getLocation()); | |||||
} else { | } else { | ||||
log("Result: " + err, Project.MSG_ERR); | log("Result: " + err, Project.MSG_ERR); | ||||
} | } | ||||
} | } | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException("Error exec: " + command, ioe, location); | |||||
throw new BuildException("Error exec: " + command, ioe, getLocation()); | |||||
} catch (InterruptedException ex) {} | } catch (InterruptedException ex) {} | ||||
return err; | return err; | ||||
@@ -259,7 +259,7 @@ public class ExecTask extends Task { | |||||
*/ | */ | ||||
protected void checkConfiguration() throws BuildException { | protected void checkConfiguration() throws BuildException { | ||||
if (cmdl.getExecutable() == null) { | if (cmdl.getExecutable() == null) { | ||||
throw new BuildException("no executable specified", location); | |||||
throw new BuildException("no executable specified", getLocation()); | |||||
} | } | ||||
if (dir != null && !dir.exists()) { | if (dir != null && !dir.exists()) { | ||||
throw new BuildException("The directory you specified does not " | throw new BuildException("The directory you specified does not " | ||||
@@ -334,8 +334,8 @@ public class ExecTask extends Task { | |||||
maybeSetResultPropertyValue(err); | maybeSetResultPropertyValue(err); | ||||
if (err != 0) { | if (err != 0) { | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException(taskType + " returned: " + err, | |||||
location); | |||||
throw new BuildException(getTaskType() + " returned: " + err, | |||||
getLocation()); | |||||
} else { | } else { | ||||
log("Result: " + err, Project.MSG_ERR); | log("Result: " + err, Project.MSG_ERR); | ||||
} | } | ||||
@@ -369,7 +369,7 @@ public class ExecTask extends Task { | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
if (failIfExecFails) { | if (failIfExecFails) { | ||||
throw new BuildException("Execute failed: " + e.toString(), e, | throw new BuildException("Execute failed: " + e.toString(), e, | ||||
location); | |||||
getLocation()); | |||||
} else { | } else { | ||||
log("Execute failed: " + e.toString(), Project.MSG_ERR); | log("Execute failed: " + e.toString(), Project.MSG_ERR); | ||||
} | } | ||||
@@ -390,10 +390,10 @@ public class ExecTask extends Task { | |||||
return new PumpStreamHandler(fos); | return new PumpStreamHandler(fos); | ||||
} catch (FileNotFoundException fne) { | } catch (FileNotFoundException fne) { | ||||
throw new BuildException("Cannot write to " + out, fne, | throw new BuildException("Cannot write to " + out, fne, | ||||
location); | |||||
getLocation()); | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException("Cannot write to " + out, ioe, | throw new BuildException("Cannot write to " + out, ioe, | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
} else if (outputprop != null) { | } else if (outputprop != null) { | ||||
baos = new ByteArrayOutputStream(); | baos = new ByteArrayOutputStream(); | ||||
@@ -151,8 +151,8 @@ public class ExecuteOn extends ExecTask { | |||||
*/ | */ | ||||
public Commandline.Marker createSrcfile() { | public Commandline.Marker createSrcfile() { | ||||
if (srcFilePos != null) { | if (srcFilePos != null) { | ||||
throw new BuildException(taskType + " doesn\'t support multiple " | |||||
+ "srcfile elements.", location); | |||||
throw new BuildException(getTaskType() + " doesn\'t support multiple " | |||||
+ "srcfile elements.", getLocation()); | |||||
} | } | ||||
srcFilePos = cmdl.createMarker(); | srcFilePos = cmdl.createMarker(); | ||||
return srcFilePos; | return srcFilePos; | ||||
@@ -164,8 +164,8 @@ public class ExecuteOn extends ExecTask { | |||||
*/ | */ | ||||
public Commandline.Marker createTargetfile() { | public Commandline.Marker createTargetfile() { | ||||
if (targetFilePos != null) { | if (targetFilePos != null) { | ||||
throw new BuildException(taskType + " doesn\'t support multiple " | |||||
+ "targetfile elements.", location); | |||||
throw new BuildException(getTaskType() + " doesn\'t support multiple " | |||||
+ "targetfile elements.", getLocation()); | |||||
} | } | ||||
targetFilePos = cmdl.createMarker(); | targetFilePos = cmdl.createMarker(); | ||||
srcIsFirst = (srcFilePos != null); | srcIsFirst = (srcFilePos != null); | ||||
@@ -178,7 +178,7 @@ public class ExecuteOn extends ExecTask { | |||||
public Mapper createMapper() throws BuildException { | public Mapper createMapper() throws BuildException { | ||||
if (mapperElement != null) { | if (mapperElement != null) { | ||||
throw new BuildException("Cannot define more than one mapper", | throw new BuildException("Cannot define more than one mapper", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
mapperElement = new Mapper(getProject()); | mapperElement = new Mapper(getProject()); | ||||
return mapperElement; | return mapperElement; | ||||
@@ -189,24 +189,24 @@ public class ExecuteOn extends ExecTask { | |||||
* this should probably be modified to use the classname instead. | * this should probably be modified to use the classname instead. | ||||
*/ | */ | ||||
protected void checkConfiguration() { | protected void checkConfiguration() { | ||||
if ("execon".equals(taskName)) { | |||||
if ("execon".equals(getTaskName())) { | |||||
log("!! execon is deprecated. Use apply instead. !!"); | log("!! execon is deprecated. Use apply instead. !!"); | ||||
} | } | ||||
super.checkConfiguration(); | super.checkConfiguration(); | ||||
if (filesets.size() == 0) { | if (filesets.size() == 0) { | ||||
throw new BuildException("no filesets specified", location); | |||||
throw new BuildException("no filesets specified", getLocation()); | |||||
} | } | ||||
if (targetFilePos != null || mapperElement != null | if (targetFilePos != null || mapperElement != null | ||||
|| destDir != null) { | || destDir != null) { | ||||
if (mapperElement == null) { | if (mapperElement == null) { | ||||
throw new BuildException("no mapper specified", location); | |||||
throw new BuildException("no mapper specified", getLocation()); | |||||
} | } | ||||
if (destDir == null) { | if (destDir == null) { | ||||
throw new BuildException("no dest attribute specified", | throw new BuildException("no dest attribute specified", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
mapper = mapperElement.getImplementation(); | mapper = mapperElement.getImplementation(); | ||||
} | } | ||||
@@ -271,7 +271,7 @@ public class ExecuteOn extends ExecTask { | |||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException("Execute failed: " + e, e, location); | |||||
throw new BuildException("Execute failed: " + e, e, getLocation()); | |||||
} finally { | } finally { | ||||
// close the output file if required | // close the output file if required | ||||
logFlush(); | logFlush(); | ||||
@@ -99,7 +99,7 @@ public class Expand extends Task { | |||||
* @exception BuildException Thrown in unrecoverable error. | * @exception BuildException Thrown in unrecoverable error. | ||||
*/ | */ | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if ("expand".equals(taskType)) { | |||||
if ("expand".equals(getTaskType())) { | |||||
log("!! expand is deprecated. Use unzip instead. !!"); | log("!! expand is deprecated. Use unzip instead. !!"); | ||||
} | } | ||||
@@ -114,7 +114,7 @@ public class Expand extends Task { | |||||
} | } | ||||
if (dest.exists() && !dest.isDirectory()) { | if (dest.exists() && !dest.isDirectory()) { | ||||
throw new BuildException("Dest must be a directory.", location); | |||||
throw new BuildException("Dest must be a directory.", getLocation()); | |||||
} | } | ||||
FileUtils fileUtils = FileUtils.newFileUtils(); | FileUtils fileUtils = FileUtils.newFileUtils(); | ||||
@@ -122,7 +122,7 @@ public class Expand extends Task { | |||||
if (source != null) { | if (source != null) { | ||||
if (source.isDirectory()) { | if (source.isDirectory()) { | ||||
throw new BuildException("Src must not be a directory." + | throw new BuildException("Src must not be a directory." + | ||||
" Use nested filesets instead.", location); | |||||
" Use nested filesets instead.", getLocation()); | |||||
} else { | } else { | ||||
expandFile(fileUtils, source, dest); | expandFile(fileUtils, source, dest); | ||||
} | } | ||||
@@ -115,7 +115,7 @@ public class Filter extends Task { | |||||
if (!isFiltersFromFile && !isSingleFilter) { | if (!isFiltersFromFile && !isSingleFilter) { | ||||
throw new BuildException("both token and value parameters, or " | throw new BuildException("both token and value parameters, or " | ||||
+ "only a filtersFile parameter is " | + "only a filtersFile parameter is " | ||||
+ "required", location); | |||||
+ "required", getLocation()); | |||||
} | } | ||||
if (isSingleFilter) { | if (isSingleFilter) { | ||||
@@ -299,7 +299,7 @@ public class FixCRLF extends MatchingTask { | |||||
public void setTablength(int tlength) throws BuildException { | public void setTablength(int tlength) throws BuildException { | ||||
if (tlength < 2 || tlength > 80) { | if (tlength < 2 || tlength > 80) { | ||||
throw new BuildException("tablength must be between 2 and 80", | throw new BuildException("tablength must be between 2 and 80", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
tablength = tlength; | tablength = tlength; | ||||
StringBuffer sp = new StringBuffer(); | StringBuffer sp = new StringBuffer(); | ||||
@@ -102,7 +102,7 @@ public class GUnzip extends Unpack { | |||||
} while (count != -1); | } while (count != -1); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "Problem expanding gzip " + ioe.getMessage(); | String msg = "Problem expanding gzip " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (fis != null) { | if (fis != null) { | ||||
try { | try { | ||||
@@ -81,7 +81,7 @@ public class GZip extends Pack { | |||||
zipFile(source, zOut); | zipFile(source, zOut); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "Problem creating gzip " + ioe.getMessage(); | String msg = "Problem creating gzip " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (zOut != null) { | if (zOut != null) { | ||||
try { | try { | ||||
@@ -98,21 +98,21 @@ public class Get extends Task { | |||||
*/ | */ | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (source == null) { | if (source == null) { | ||||
throw new BuildException("src attribute is required", location); | |||||
throw new BuildException("src attribute is required", getLocation()); | |||||
} | } | ||||
if (dest == null) { | if (dest == null) { | ||||
throw new BuildException("dest attribute is required", location); | |||||
throw new BuildException("dest attribute is required", getLocation()); | |||||
} | } | ||||
if (dest.exists() && dest.isDirectory()) { | if (dest.exists() && dest.isDirectory()) { | ||||
throw new BuildException("The specified destination is a directory", | throw new BuildException("The specified destination is a directory", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (dest.exists() && !dest.canWrite()) { | if (dest.exists() && !dest.canWrite()) { | ||||
throw new BuildException("Can't write to " + dest.getAbsolutePath(), | throw new BuildException("Can't write to " + dest.getAbsolutePath(), | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
try { | try { | ||||
@@ -209,7 +209,7 @@ public class Get extends Task { | |||||
return; | return; | ||||
} | } | ||||
throw new BuildException("Can't get " + source + " to " + dest, | throw new BuildException("Can't get " + source + " to " + dest, | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
FileOutputStream fos = new FileOutputStream(dest); | FileOutputStream fos = new FileOutputStream(dest); | ||||
@@ -263,7 +263,7 @@ public class Get extends Task { | |||||
if (ignoreErrors) { | if (ignoreErrors) { | ||||
return; | return; | ||||
} | } | ||||
throw new BuildException(ioe, location); | |||||
throw new BuildException(ioe, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -325,13 +325,13 @@ public abstract class JDBCTask extends Task { | |||||
*/ | */ | ||||
protected Connection getConnection() throws BuildException { | protected Connection getConnection() throws BuildException { | ||||
if (userId == null) { | if (userId == null) { | ||||
throw new BuildException("User Id attribute must be set!", location); | |||||
throw new BuildException("User Id attribute must be set!", getLocation()); | |||||
} | } | ||||
if (password == null) { | if (password == null) { | ||||
throw new BuildException("Password attribute must be set!", location); | |||||
throw new BuildException("Password attribute must be set!", getLocation()); | |||||
} | } | ||||
if (url == null) { | if (url == null) { | ||||
throw new BuildException("Url attribute must be set!", location); | |||||
throw new BuildException("Url attribute must be set!", getLocation()); | |||||
} | } | ||||
try { | try { | ||||
@@ -349,7 +349,7 @@ public abstract class JDBCTask extends Task { | |||||
conn.setAutoCommit(autocommit); | conn.setAutoCommit(autocommit); | ||||
return conn; | return conn; | ||||
} catch (SQLException e) { | } catch (SQLException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -362,7 +362,7 @@ public abstract class JDBCTask extends Task { | |||||
*/ | */ | ||||
private Driver getDriver() throws BuildException { | private Driver getDriver() throws BuildException { | ||||
if (driver == null) { | if (driver == null) { | ||||
throw new BuildException("Driver attribute must be set!", location); | |||||
throw new BuildException("Driver attribute must be set!", getLocation()); | |||||
} | } | ||||
Driver driverInstance = null; | Driver driverInstance = null; | ||||
@@ -402,15 +402,15 @@ public abstract class JDBCTask extends Task { | |||||
} catch (ClassNotFoundException e) { | } catch (ClassNotFoundException e) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"Class Not Found: JDBC driver " + driver + " could not be loaded", | "Class Not Found: JDBC driver " + driver + " could not be loaded", | ||||
location); | |||||
getLocation()); | |||||
} catch (IllegalAccessException e) { | } catch (IllegalAccessException e) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"Illegal Access: JDBC driver " + driver + " could not be loaded", | "Illegal Access: JDBC driver " + driver + " could not be loaded", | ||||
location); | |||||
getLocation()); | |||||
} catch (InstantiationException e) { | } catch (InstantiationException e) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"Instantiation Exception: JDBC driver " + driver + " could not be loaded", | "Instantiation Exception: JDBC driver " + driver + " could not be loaded", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
return driverInstance; | return driverInstance; | ||||
} | } | ||||
@@ -107,7 +107,7 @@ public class Java extends Task { | |||||
try { | try { | ||||
if ((err = executeJava()) != 0) { | if ((err = executeJava()) != 0) { | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException("Java returned: " + err, location); | |||||
throw new BuildException("Java returned: " + err, getLocation()); | |||||
} else { | } else { | ||||
log("Java Result: " + err, Project.MSG_ERR); | log("Java Result: " + err, Project.MSG_ERR); | ||||
} | } | ||||
@@ -405,7 +405,7 @@ public class Java extends Task { | |||||
append)); | append)); | ||||
exe.execute(getProject()); | exe.execute(getProject()); | ||||
} catch (IOException io) { | } catch (IOException io) { | ||||
throw new BuildException(io, location); | |||||
throw new BuildException(io, getLocation()); | |||||
} finally { | } finally { | ||||
if (outStream != null) { | if (outStream != null) { | ||||
outStream.close(); | outStream.close(); | ||||
@@ -440,7 +440,7 @@ public class Java extends Task { | |||||
} else if (!dir.exists() || !dir.isDirectory()) { | } else if (!dir.exists() || !dir.isDirectory()) { | ||||
throw new BuildException(dir.getAbsolutePath() | throw new BuildException(dir.getAbsolutePath() | ||||
+ " is not a valid directory", | + " is not a valid directory", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
exe.setWorkingDirectory(dir); | exe.setWorkingDirectory(dir); | ||||
@@ -463,10 +463,10 @@ public class Java extends Task { | |||||
} | } | ||||
return rc; | return rc; | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} catch (IOException io) { | } catch (IOException io) { | ||||
throw new BuildException(io, location); | |||||
throw new BuildException(io, getLocation()); | |||||
} finally { | } finally { | ||||
if (fos != null) { | if (fos != null) { | ||||
try {fos.close();} catch (IOException io) {} | try {fos.close();} catch (IOException io) {} | ||||
@@ -670,7 +670,7 @@ public class Javac extends MatchingTask { | |||||
if (!srcDir.exists()) { | if (!srcDir.exists()) { | ||||
throw new BuildException("srcdir \"" | throw new BuildException("srcdir \"" | ||||
+ srcDir.getPath() | + srcDir.getPath() | ||||
+ "\" does not exist!", location); | |||||
+ "\" does not exist!", getLocation()); | |||||
} | } | ||||
DirectoryScanner ds = this.getDirectoryScanner(srcDir); | DirectoryScanner ds = this.getDirectoryScanner(srcDir); | ||||
@@ -794,18 +794,18 @@ public class Javac extends MatchingTask { | |||||
protected void checkParameters() throws BuildException { | protected void checkParameters() throws BuildException { | ||||
if (src == null) { | if (src == null) { | ||||
throw new BuildException("srcdir attribute must be set!", | throw new BuildException("srcdir attribute must be set!", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (src.size() == 0) { | if (src.size() == 0) { | ||||
throw new BuildException("srcdir attribute must be set!", | throw new BuildException("srcdir attribute must be set!", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (destDir != null && !destDir.isDirectory()) { | if (destDir != null && !destDir.isDirectory()) { | ||||
throw new BuildException("destination directory \"" | throw new BuildException("destination directory \"" | ||||
+ destDir | + destDir | ||||
+ "\" does not exist " | + "\" does not exist " | ||||
+ "or is not a directory", location); | |||||
+ "or is not a directory", getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -839,7 +839,7 @@ public class Javac extends MatchingTask { | |||||
// finally, lets execute the compiler!! | // finally, lets execute the compiler!! | ||||
if (!adapter.execute()) { | if (!adapter.execute()) { | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException(FAIL_MSG, location); | |||||
throw new BuildException(FAIL_MSG, getLocation()); | |||||
} else { | } else { | ||||
log(FAIL_MSG, Project.MSG_ERR); | log(FAIL_MSG, Project.MSG_ERR); | ||||
} | } | ||||
@@ -1498,7 +1498,7 @@ public class Javadoc extends Task { | |||||
} | } | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if ("javadoc2".equals(taskType)) { | |||||
if ("javadoc2".equals(getTaskType())) { | |||||
log("!! javadoc2 is deprecated. Use javadoc instead. !!"); | log("!! javadoc2 is deprecated. Use javadoc instead. !!"); | ||||
} | } | ||||
@@ -1598,7 +1598,7 @@ public class Javadoc extends Task { | |||||
if (doclet != null) { | if (doclet != null) { | ||||
if (doclet.getName() == null) { | if (doclet.getName() == null) { | ||||
throw new BuildException("The doclet name must be " | throw new BuildException("The doclet name must be " | ||||
+ "specified.", location); | |||||
+ "specified.", getLocation()); | |||||
} else { | } else { | ||||
toExecute.createArgument().setValue("-doclet"); | toExecute.createArgument().setValue("-doclet"); | ||||
toExecute.createArgument().setValue(doclet.getName()); | toExecute.createArgument().setValue(doclet.getName()); | ||||
@@ -1806,7 +1806,7 @@ public class Javadoc extends Task { | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
tmpList.delete(); | tmpList.delete(); | ||||
throw new BuildException("Error creating temporary file", | throw new BuildException("Error creating temporary file", | ||||
e, location); | |||||
e, getLocation()); | |||||
} finally { | } finally { | ||||
if (srcListWriter != null) { | if (srcListWriter != null) { | ||||
srcListWriter.close(); | srcListWriter.close(); | ||||
@@ -1836,10 +1836,10 @@ public class Javadoc extends Task { | |||||
exe.setCommandline(toExecute.getCommandline()); | exe.setCommandline(toExecute.getCommandline()); | ||||
int ret = exe.execute(); | int ret = exe.execute(); | ||||
if (ret != 0 && failOnError) { | if (ret != 0 && failOnError) { | ||||
throw new BuildException("Javadoc returned " + ret, location); | |||||
throw new BuildException("Javadoc returned " + ret, getLocation()); | |||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException("Javadoc failed: " + e, e, location); | |||||
throw new BuildException("Javadoc failed: " + e, e, getLocation()); | |||||
} finally { | } finally { | ||||
if (tmpList != null) { | if (tmpList != null) { | ||||
tmpList.delete(); | tmpList.delete(); | ||||
@@ -206,7 +206,7 @@ public final class LoadFile extends Task { | |||||
} catch (final IOException ioe) { | } catch (final IOException ioe) { | ||||
final String message = "Unable to load file: " + ioe.toString(); | final String message = "Unable to load file: " + ioe.toString(); | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException(message, ioe, location); | |||||
throw new BuildException(message, ioe, getLocation()); | |||||
} else { | } else { | ||||
log(message, Project.MSG_ERR); | log(message, Project.MSG_ERR); | ||||
} | } | ||||
@@ -190,7 +190,7 @@ public final class LoadProperties extends Task { | |||||
} catch (final IOException ioe) { | } catch (final IOException ioe) { | ||||
final String message = "Unable to load file: " + ioe.toString(); | final String message = "Unable to load file: " + ioe.toString(); | ||||
throw new BuildException(message, ioe, location); | |||||
throw new BuildException(message, ioe, getLocation()); | |||||
} catch (final BuildException be) { | } catch (final BuildException be) { | ||||
throw be; | throw be; | ||||
} finally { | } finally { | ||||
@@ -176,10 +176,10 @@ public class ManifestTask extends Task { | |||||
current = new Manifest(f); | current = new Manifest(f); | ||||
} catch (ManifestException m) { | } catch (ManifestException m) { | ||||
error = new BuildException("Existing manifest " + manifestFile | error = new BuildException("Existing manifest " + manifestFile | ||||
+ " is invalid", m, location); | |||||
+ " is invalid", m, getLocation()); | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
error = new BuildException("Failed to read " + manifestFile, | error = new BuildException("Failed to read " + manifestFile, | ||||
e, location); | |||||
e, getLocation()); | |||||
} finally { | } finally { | ||||
if (f != null) { | if (f != null) { | ||||
try { | try { | ||||
@@ -200,7 +200,7 @@ public class ManifestTask extends Task { | |||||
toWrite.merge(nestedManifest); | toWrite.merge(nestedManifest); | ||||
} catch (ManifestException m) { | } catch (ManifestException m) { | ||||
throw new BuildException("Manifest is invalid", m, location); | |||||
throw new BuildException("Manifest is invalid", m, getLocation()); | |||||
} | } | ||||
if (toWrite.equals(current)) { | if (toWrite.equals(current)) { | ||||
@@ -215,7 +215,7 @@ public class ManifestTask extends Task { | |||||
toWrite.write(w); | toWrite.write(w); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException("Failed to write " + manifestFile, | throw new BuildException("Failed to write " + manifestFile, | ||||
e, location); | |||||
e, getLocation()); | |||||
} finally { | } finally { | ||||
if (w != null) { | if (w != null) { | ||||
w.close(); | w.close(); | ||||
@@ -82,7 +82,7 @@ public class Mkdir extends Task { | |||||
*/ | */ | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (dir == null) { | if (dir == null) { | ||||
throw new BuildException("dir attribute is required", location); | |||||
throw new BuildException("dir attribute is required", getLocation()); | |||||
} | } | ||||
if (dir.isFile()) { | if (dir.isFile()) { | ||||
@@ -96,7 +96,7 @@ public class Mkdir extends Task { | |||||
if (!result) { | if (!result) { | ||||
String msg = "Directory " + dir.getAbsolutePath() | String msg = "Directory " + dir.getAbsolutePath() | ||||
+ " creation was not successful for an unknown reason"; | + " creation was not successful for an unknown reason"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
log("Created dir: " + dir.getAbsolutePath()); | log("Created dir: " + dir.getAbsolutePath()); | ||||
} | } | ||||
@@ -116,7 +116,7 @@ public class Move extends Copy { | |||||
String msg = "Failed to rename dir " + fromDir | String msg = "Failed to rename dir " + fromDir | ||||
+ " to " + toDir | + " to " + toDir | ||||
+ " due to " + ioe.getMessage(); | + " due to " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -148,7 +148,7 @@ public class Move extends Copy { | |||||
String msg = "Failed to rename " + fromFile | String msg = "Failed to rename " + fromFile | ||||
+ " to " + toFile | + " to " + toFile | ||||
+ " due to " + ioe.getMessage(); | + " due to " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} | } | ||||
if (!moved) { | if (!moved) { | ||||
@@ -185,7 +185,7 @@ public class Move extends Copy { | |||||
String msg = "Failed to copy " + fromFile + " to " | String msg = "Failed to copy " + fromFile + " to " | ||||
+ toFile | + toFile | ||||
+ " due to " + ioe.getMessage(); | + " due to " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -99,21 +99,21 @@ public abstract class Pack extends Task { | |||||
*/ | */ | ||||
private void validate() throws BuildException { | private void validate() throws BuildException { | ||||
if (zipFile == null) { | if (zipFile == null) { | ||||
throw new BuildException("zipfile attribute is required", location); | |||||
throw new BuildException("zipfile attribute is required", getLocation()); | |||||
} | } | ||||
if (zipFile.isDirectory()) { | if (zipFile.isDirectory()) { | ||||
throw new BuildException("zipfile attribute must not " + | throw new BuildException("zipfile attribute must not " + | ||||
"represent a directory!", location); | |||||
"represent a directory!", getLocation()); | |||||
} | } | ||||
if (source == null) { | if (source == null) { | ||||
throw new BuildException("src attribute is required", location); | |||||
throw new BuildException("src attribute is required", getLocation()); | |||||
} | } | ||||
if (source.isDirectory()) { | if (source.isDirectory()) { | ||||
throw new BuildException("Src attribute must not " + | throw new BuildException("Src attribute must not " + | ||||
"represent a directory!", location); | |||||
"represent a directory!", getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -91,7 +91,7 @@ public class Patch extends Task { | |||||
public void setPatchfile(File file) { | public void setPatchfile(File file) { | ||||
if (!file.exists()) { | if (!file.exists()) { | ||||
throw new BuildException("patchfile " + file + " doesn\'t exist", | throw new BuildException("patchfile " + file + " doesn\'t exist", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
cmd.createArgument().setValue("-i"); | cmd.createArgument().setValue("-i"); | ||||
cmd.createArgument().setFile(file); | cmd.createArgument().setFile(file); | ||||
@@ -125,7 +125,7 @@ public class Patch extends Task { | |||||
*/ | */ | ||||
public void setStrip(int num) throws BuildException { | public void setStrip(int num) throws BuildException { | ||||
if (num < 0) { | if (num < 0) { | ||||
throw new BuildException("strip has to be >= 0", location); | |||||
throw new BuildException("strip has to be >= 0", getLocation()); | |||||
} | } | ||||
cmd.createArgument().setValue("-p" + num); | cmd.createArgument().setValue("-p" + num); | ||||
} | } | ||||
@@ -166,7 +166,7 @@ public class Patch extends Task { | |||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (!havePatchfile) { | if (!havePatchfile) { | ||||
throw new BuildException("patchfile argument is required", | throw new BuildException("patchfile argument is required", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
Commandline toExecute = (Commandline) cmd.clone(); | Commandline toExecute = (Commandline) cmd.clone(); | ||||
toExecute.setExecutable("patch"); | toExecute.setExecutable("patch"); | ||||
@@ -185,10 +185,10 @@ public class Patch extends Task { | |||||
exe.setWorkingDirectory(directory); | exe.setWorkingDirectory(directory); | ||||
} else if (!directory.isDirectory()) { | } else if (!directory.isDirectory()) { | ||||
throw new BuildException(directory + " is not a directory.", | throw new BuildException(directory + " is not a directory.", | ||||
location); | |||||
getLocation()); | |||||
} else { | } else { | ||||
throw new BuildException("directory " + directory | throw new BuildException("directory " + directory | ||||
+ " doesn\'t exist", location); | |||||
+ " doesn\'t exist", getLocation()); | |||||
} | } | ||||
} else { | } else { | ||||
exe.setWorkingDirectory(getProject().getBaseDir()); | exe.setWorkingDirectory(getProject().getBaseDir()); | ||||
@@ -198,7 +198,7 @@ public class Patch extends Task { | |||||
try { | try { | ||||
exe.execute(); | exe.execute(); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -323,19 +323,19 @@ public class Property extends Task { | |||||
if (value == null && ref == null) { | if (value == null && ref == null) { | ||||
throw new BuildException("You must specify value, location or " | throw new BuildException("You must specify value, location or " | ||||
+ "refid with the name attribute", | + "refid with the name attribute", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
} else { | } else { | ||||
if (file == null && resource == null && env == null) { | if (file == null && resource == null && env == null) { | ||||
throw new BuildException("You must specify file, resource or " | throw new BuildException("You must specify file, resource or " | ||||
+ "environment when not using the " | + "environment when not using the " | ||||
+ "name attribute", location); | |||||
+ "name attribute", getLocation()); | |||||
} | } | ||||
} | } | ||||
if (file == null && resource == null && prefix != null) { | if (file == null && resource == null && prefix != null) { | ||||
throw new BuildException("Prefix is only valid when loading from " | throw new BuildException("Prefix is only valid when loading from " | ||||
+ "a file or resource", location); | |||||
+ "a file or resource", getLocation()); | |||||
} | } | ||||
if ((name != null) && (value != null)) { | if ((name != null) && (value != null)) { | ||||
@@ -392,7 +392,7 @@ public class Property extends Task { | |||||
Project.MSG_VERBOSE); | Project.MSG_VERBOSE); | ||||
} | } | ||||
} catch (IOException ex) { | } catch (IOException ex) { | ||||
throw new BuildException(ex, location); | |||||
throw new BuildException(ex, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -426,7 +426,7 @@ public class Property extends Task { | |||||
log("Unable to find resource " + name, Project.MSG_WARN); | log("Unable to find resource " + name, Project.MSG_WARN); | ||||
} | } | ||||
} catch (IOException ex) { | } catch (IOException ex) { | ||||
throw new BuildException(ex, location); | |||||
throw new BuildException(ex, getLocation()); | |||||
} finally { | } finally { | ||||
if (is != null) { | if (is != null) { | ||||
try { | try { | ||||
@@ -109,11 +109,11 @@ public class Rename extends Task { | |||||
log("DEPRECATED - The rename task is deprecated. Use move instead."); | log("DEPRECATED - The rename task is deprecated. Use move instead."); | ||||
if (dest == null) { | if (dest == null) { | ||||
throw new BuildException("dest attribute is required", location); | |||||
throw new BuildException("dest attribute is required", getLocation()); | |||||
} | } | ||||
if (src == null) { | if (src == null) { | ||||
throw new BuildException("src attribute is required", location); | |||||
throw new BuildException("src attribute is required", getLocation()); | |||||
} | } | ||||
if (replace && dest.exists()) { | if (replace && dest.exists()) { | ||||
@@ -318,21 +318,21 @@ public class Replace extends MatchingTask { | |||||
if (src == null && dir == null) { | if (src == null && dir == null) { | ||||
String message = "Either the file or the dir attribute " | String message = "Either the file or the dir attribute " | ||||
+ "must be specified"; | + "must be specified"; | ||||
throw new BuildException(message, location); | |||||
throw new BuildException(message, getLocation()); | |||||
} | } | ||||
if (propertyFile != null && !propertyFile.exists()) { | if (propertyFile != null && !propertyFile.exists()) { | ||||
String message = "Property file " + propertyFile.getPath() | String message = "Property file " + propertyFile.getPath() | ||||
+ " does not exist."; | + " does not exist."; | ||||
throw new BuildException(message, location); | |||||
throw new BuildException(message, getLocation()); | |||||
} | } | ||||
if (token == null && replacefilters.size() == 0) { | if (token == null && replacefilters.size() == 0) { | ||||
String message = "Either token or a nested replacefilter " | String message = "Either token or a nested replacefilter " | ||||
+ "must be specified"; | + "must be specified"; | ||||
throw new BuildException(message, location); | |||||
throw new BuildException(message, getLocation()); | |||||
} | } | ||||
if (token != null && "".equals(token.getText())) { | if (token != null && "".equals(token.getText())) { | ||||
String message = "The token attribute must not be an empty string."; | String message = "The token attribute must not be an empty string."; | ||||
throw new BuildException(message, location); | |||||
throw new BuildException(message, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -387,7 +387,7 @@ public class Replace extends MatchingTask { | |||||
private void processFile(File src) throws BuildException { | private void processFile(File src) throws BuildException { | ||||
if (!src.exists()) { | if (!src.exists()) { | ||||
throw new BuildException("Replace: source file " + src.getPath() | throw new BuildException("Replace: source file " + src.getPath() | ||||
+ " doesn't exist", location); | |||||
+ " doesn't exist", getLocation()); | |||||
} | } | ||||
File temp = fileUtils.createTempFile("rep", ".tmp", | File temp = fileUtils.createTempFile("rep", ".tmp", | ||||
@@ -474,7 +474,7 @@ public class Replace extends MatchingTask { | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException("IOException in " + src + " - " + | throw new BuildException("IOException in " + src + " - " + | ||||
ioe.getClass().getName() + ":" | ioe.getClass().getName() + ":" | ||||
+ ioe.getMessage(), ioe, location); | |||||
+ ioe.getMessage(), ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (reader != null) { | if (reader != null) { | ||||
try { | try { | ||||
@@ -477,10 +477,10 @@ public class Rmic extends MatchingTask { | |||||
*/ | */ | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (baseDir == null) { | if (baseDir == null) { | ||||
throw new BuildException("base attribute must be set!", location); | |||||
throw new BuildException("base attribute must be set!", getLocation()); | |||||
} | } | ||||
if (!baseDir.exists()) { | if (!baseDir.exists()) { | ||||
throw new BuildException("base does not exist!", location); | |||||
throw new BuildException("base does not exist!", getLocation()); | |||||
} | } | ||||
if (verify) { | if (verify) { | ||||
@@ -519,7 +519,7 @@ public class Rmic extends MatchingTask { | |||||
// finally, lets execute the compiler!! | // finally, lets execute the compiler!! | ||||
if (!adapter.execute()) { | if (!adapter.execute()) { | ||||
throw new BuildException(FAIL_MSG, location); | |||||
throw new BuildException(FAIL_MSG, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -594,7 +594,7 @@ public class Rmic extends MatchingTask { | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "Failed to copy " + oldFile + " to " + | String msg = "Failed to copy " + oldFile + " to " + | ||||
newFile + " due to " + ioe.getMessage(); | newFile + " due to " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -327,12 +327,12 @@ public class SQLExec extends JDBCTask { | |||||
if (transactions.size() == 0) { | if (transactions.size() == 0) { | ||||
throw new BuildException("Source file or fileset, " | throw new BuildException("Source file or fileset, " | ||||
+ "transactions or sql statement " | + "transactions or sql statement " | ||||
+ "must be set!", location); | |||||
+ "must be set!", getLocation()); | |||||
} | } | ||||
} | } | ||||
if (srcFile != null && !srcFile.exists()) { | if (srcFile != null && !srcFile.exists()) { | ||||
throw new BuildException("Source file does not exist!", location); | |||||
throw new BuildException("Source file does not exist!", getLocation()); | |||||
} | } | ||||
// deal with the filesets | // deal with the filesets | ||||
@@ -395,14 +395,14 @@ public class SQLExec extends JDBCTask { | |||||
conn.rollback(); | conn.rollback(); | ||||
} catch (SQLException ex) {} | } catch (SQLException ex) {} | ||||
} | } | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} catch (SQLException e){ | } catch (SQLException e){ | ||||
if (!isAutocommit() && conn != null && onError.equals("abort")) { | if (!isAutocommit() && conn != null && onError.equals("abort")) { | ||||
try { | try { | ||||
conn.rollback(); | conn.rollback(); | ||||
} catch (SQLException ex) {} | } catch (SQLException ex) {} | ||||
} | } | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} finally { | } finally { | ||||
try { | try { | ||||
if (statement != null) { | if (statement != null) { | ||||
@@ -227,17 +227,17 @@ public class Tar extends MatchingTask { | |||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (tarFile == null) { | if (tarFile == null) { | ||||
throw new BuildException("tarfile attribute must be set!", | throw new BuildException("tarfile attribute must be set!", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (tarFile.exists() && tarFile.isDirectory()) { | if (tarFile.exists() && tarFile.isDirectory()) { | ||||
throw new BuildException("tarfile is a directory!", | throw new BuildException("tarfile is a directory!", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (tarFile.exists() && !tarFile.canWrite()) { | if (tarFile.exists() && !tarFile.canWrite()) { | ||||
throw new BuildException("Can not write to the specified tarfile!", | throw new BuildException("Can not write to the specified tarfile!", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
Vector savedFileSets = (Vector) filesets.clone(); | Vector savedFileSets = (Vector) filesets.clone(); | ||||
@@ -245,7 +245,7 @@ public class Tar extends MatchingTask { | |||||
if (baseDir != null) { | if (baseDir != null) { | ||||
if (!baseDir.exists()) { | if (!baseDir.exists()) { | ||||
throw new BuildException("basedir does not exist!", | throw new BuildException("basedir does not exist!", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
// add the main fileset to the list of filesets to process. | // add the main fileset to the list of filesets to process. | ||||
@@ -257,7 +257,7 @@ public class Tar extends MatchingTask { | |||||
if (filesets.size() == 0) { | if (filesets.size() == 0) { | ||||
throw new BuildException("You must supply either a basedir " | throw new BuildException("You must supply either a basedir " | ||||
+ "attribute or some nested filesets.", | + "attribute or some nested filesets.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
// check if tar is out of date with respect to each | // check if tar is out of date with respect to each | ||||
@@ -275,7 +275,7 @@ public class Tar extends MatchingTask { | |||||
if (tarFile.equals(new File(fs.getDir(getProject()), | if (tarFile.equals(new File(fs.getDir(getProject()), | ||||
files[i]))) { | files[i]))) { | ||||
throw new BuildException("A tar file cannot include " | throw new BuildException("A tar file cannot include " | ||||
+ "itself", location); | |||||
+ "itself", getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -324,7 +324,7 @@ public class Tar extends MatchingTask { | |||||
} | } | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
String msg = "Problem creating TAR: " + ioe.getMessage(); | String msg = "Problem creating TAR: " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (tOut != null) { | if (tOut != null) { | ||||
try { | try { | ||||
@@ -394,7 +394,7 @@ public class Tar extends MatchingTask { | |||||
} else if (longFileMode.isFailMode()) { | } else if (longFileMode.isFailMode()) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"Entry: " + vPath + " longer than " + | "Entry: " + vPath + " longer than " + | ||||
TarConstants.NAMELEN + "characters.", location); | |||||
TarConstants.NAMELEN + "characters.", getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -164,7 +164,7 @@ public class Touch extends Task { | |||||
+ "00:00:00 GMT)."); | + "00:00:00 GMT)."); | ||||
} | } | ||||
} catch (ParseException pe) { | } catch (ParseException pe) { | ||||
throw new BuildException(pe.getMessage(), pe, location); | |||||
throw new BuildException(pe.getMessage(), pe, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -185,7 +185,7 @@ public class Touch extends Task { | |||||
fileUtils.createNewFile(file); | fileUtils.createNewFile(file); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException("Could not create " + file, ioe, | throw new BuildException("Could not create " + file, ioe, | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -112,7 +112,7 @@ public class Tstamp extends Task { | |||||
Enumeration i = customFormats.elements(); | Enumeration i = customFormats.elements(); | ||||
while (i.hasMoreElements()) { | while (i.hasMoreElements()) { | ||||
CustomFormat cts = (CustomFormat) i.nextElement(); | CustomFormat cts = (CustomFormat) i.nextElement(); | ||||
cts.execute(getProject(), d, location); | |||||
cts.execute(getProject(), d, getLocation()); | |||||
} | } | ||||
SimpleDateFormat dstamp = new SimpleDateFormat ("yyyyMMdd"); | SimpleDateFormat dstamp = new SimpleDateFormat ("yyyyMMdd"); | ||||
@@ -116,15 +116,15 @@ public abstract class Unpack extends Task { | |||||
private void validate() throws BuildException { | private void validate() throws BuildException { | ||||
if (source == null) { | if (source == null) { | ||||
throw new BuildException("No Src specified", location); | |||||
throw new BuildException("No Src specified", getLocation()); | |||||
} | } | ||||
if (!source.exists()) { | if (!source.exists()) { | ||||
throw new BuildException("Src doesn't exist", location); | |||||
throw new BuildException("Src doesn't exist", getLocation()); | |||||
} | } | ||||
if (source.isDirectory()) { | if (source.isDirectory()) { | ||||
throw new BuildException("Cannot expand a directory", location); | |||||
throw new BuildException("Cannot expand a directory", getLocation()); | |||||
} | } | ||||
if (dest == null) { | if (dest == null) { | ||||
@@ -130,7 +130,7 @@ public class Untar extends Expand { | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException("Error while expanding " + srcF.getPath(), | throw new BuildException("Error while expanding " + srcF.getPath(), | ||||
ioe, location); | |||||
ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (tis != null) { | if (tis != null) { | ||||
try { | try { | ||||
@@ -154,7 +154,7 @@ public class UpToDate extends Task implements Condition { | |||||
public Mapper createMapper() throws BuildException { | public Mapper createMapper() throws BuildException { | ||||
if (mapperElement != null) { | if (mapperElement != null) { | ||||
throw new BuildException("Cannot define more than one mapper", | throw new BuildException("Cannot define more than one mapper", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
mapperElement = new Mapper(getProject()); | mapperElement = new Mapper(getProject()); | ||||
return mapperElement; | return mapperElement; | ||||
@@ -225,7 +225,7 @@ public class UpToDate extends Task implements Condition { | |||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (_property == null) { | if (_property == null) { | ||||
throw new BuildException("property attribute is required.", | throw new BuildException("property attribute is required.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
boolean upToDate = eval(); | boolean upToDate = eval(); | ||||
if (upToDate) { | if (upToDate) { | ||||
@@ -164,7 +164,7 @@ public class War extends Jar { | |||||
throws IOException, BuildException { | throws IOException, BuildException { | ||||
// If no webxml file is specified, it's an error. | // If no webxml file is specified, it's an error. | ||||
if (deploymentDescriptor == null && !isInUpdateMode()) { | if (deploymentDescriptor == null && !isInUpdateMode()) { | ||||
throw new BuildException("webxml attribute is required", location); | |||||
throw new BuildException("webxml attribute is required", getLocation()); | |||||
} | } | ||||
super.initZipOutputStream(zOut); | super.initZipOutputStream(zOut); | ||||
@@ -188,7 +188,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
String[] dirs; | String[] dirs; | ||||
if (xslFile == null) { | if (xslFile == null) { | ||||
throw new BuildException("no stylesheet specified", location); | |||||
throw new BuildException("no stylesheet specified", getLocation()); | |||||
} | } | ||||
try { | try { | ||||
@@ -433,7 +433,7 @@ public class Zip extends MatchingTask { | |||||
} | } | ||||
} | } | ||||
throw new BuildException(msg, ioe, location); | |||||
throw new BuildException(msg, ioe, getLocation()); | |||||
} finally { | } finally { | ||||
cleanUp(); | cleanUp(); | ||||
} | } | ||||
@@ -586,7 +586,7 @@ public class Zip extends MatchingTask { | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException("Could not create empty ZIP archive " | throw new BuildException("Could not create empty ZIP archive " | ||||
+ "(" + ioe.getMessage() + ")", ioe, | + "(" + ioe.getMessage() + ")", ioe, | ||||
location); | |||||
getLocation()); | |||||
} finally { | } finally { | ||||
if (os != null) { | if (os != null) { | ||||
try { | try { | ||||
@@ -620,7 +620,7 @@ public class Zip extends MatchingTask { | |||||
} else if (emptyBehavior.equals("fail")) { | } else if (emptyBehavior.equals("fail")) { | ||||
throw new BuildException("Cannot create " + archiveType | throw new BuildException("Cannot create " + archiveType | ||||
+ " archive " + zipFile + | + " archive " + zipFile + | ||||
": no files were included.", location); | |||||
": no files were included.", getLocation()); | |||||
} else { | } else { | ||||
// Create. | // Create. | ||||
return createEmptyZip(zipFile); | return createEmptyZip(zipFile); | ||||
@@ -629,7 +629,7 @@ public class Zip extends MatchingTask { | |||||
for (int i = 0; i < files.length; ++i) { | for (int i = 0; i < files.length; ++i) { | ||||
if (files[i].equals(zipFile)) { | if (files[i].equals(zipFile)) { | ||||
throw new BuildException("A zip file cannot include " | throw new BuildException("A zip file cannot include " | ||||
+ "itself", location); | |||||
+ "itself", getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -793,7 +793,7 @@ public class Zip extends MatchingTask { | |||||
throws IOException { | throws IOException { | ||||
if (file.equals(zipFile)) { | if (file.equals(zipFile)) { | ||||
throw new BuildException("A zip file cannot include itself", | throw new BuildException("A zip file cannot include itself", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
FileInputStream fIn = new FileInputStream(file); | FileInputStream fIn = new FileInputStream(file); | ||||
@@ -273,7 +273,7 @@ public class ANTLR extends Task { | |||||
log(commandline.describeCommand(), Project.MSG_VERBOSE); | log(commandline.describeCommand(), Project.MSG_VERBOSE); | ||||
int err = run(commandline.getCommandline()); | int err = run(commandline.getCommandline()); | ||||
if (err == 1) { | if (err == 1) { | ||||
throw new BuildException("ANTLR returned: " + err, location); | |||||
throw new BuildException("ANTLR returned: " + err, getLocation()); | |||||
} | } | ||||
} else { | } else { | ||||
log("Skipped grammar file. Generated file is newer.", Project.MSG_VERBOSE); | log("Skipped grammar file. Generated file is newer.", Project.MSG_VERBOSE); | ||||
@@ -364,7 +364,7 @@ public class ANTLR extends Task { | |||||
try { | try { | ||||
return exe.execute(); | return exe.execute(); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -248,7 +248,7 @@ public class EchoProperties extends Task { | |||||
if (inFile.exists() && inFile.isDirectory()) { | if (inFile.exists() && inFile.isDirectory()) { | ||||
String message = "srcfile is a directory!"; | String message = "srcfile is a directory!"; | ||||
if (failonerror) { | if (failonerror) { | ||||
throw new BuildException(message, location); | |||||
throw new BuildException(message, getLocation()); | |||||
} else { | } else { | ||||
log(message, Project.MSG_ERR); | log(message, Project.MSG_ERR); | ||||
} | } | ||||
@@ -258,7 +258,7 @@ public class EchoProperties extends Task { | |||||
if (inFile.exists() && !inFile.canRead()) { | if (inFile.exists() && !inFile.canRead()) { | ||||
String message = "Can not read from the specified srcfile!"; | String message = "Can not read from the specified srcfile!"; | ||||
if (failonerror) { | if (failonerror) { | ||||
throw new BuildException( message, location ); | |||||
throw new BuildException( message, getLocation() ); | |||||
} else { | } else { | ||||
log( message, Project.MSG_ERR ); | log( message, Project.MSG_ERR ); | ||||
} | } | ||||
@@ -275,7 +275,7 @@ public class EchoProperties extends Task { | |||||
String message = | String message = | ||||
"Could not find file " + inFile.getAbsolutePath(); | "Could not find file " + inFile.getAbsolutePath(); | ||||
if (failonerror) { | if (failonerror) { | ||||
throw new BuildException(message, fnfe, location); | |||||
throw new BuildException(message, fnfe, getLocation()); | |||||
} else { | } else { | ||||
log( message, Project.MSG_WARN ); | log( message, Project.MSG_WARN ); | ||||
} | } | ||||
@@ -284,7 +284,7 @@ public class EchoProperties extends Task { | |||||
String message = | String message = | ||||
"Could not read file " + inFile.getAbsolutePath(); | "Could not read file " + inFile.getAbsolutePath(); | ||||
if (failonerror) { | if (failonerror) { | ||||
throw new BuildException(message, ioe, location); | |||||
throw new BuildException(message, ioe, getLocation()); | |||||
} else { | } else { | ||||
log( message, Project.MSG_WARN ); | log( message, Project.MSG_WARN ); | ||||
} | } | ||||
@@ -308,7 +308,7 @@ public class EchoProperties extends Task { | |||||
if (destfile.exists() && destfile.isDirectory()) { | if (destfile.exists() && destfile.isDirectory()) { | ||||
String message = "destfile is a directory!"; | String message = "destfile is a directory!"; | ||||
if (failonerror) { | if (failonerror) { | ||||
throw new BuildException(message, location); | |||||
throw new BuildException(message, getLocation()); | |||||
} else { | } else { | ||||
log(message, Project.MSG_ERR); | log(message, Project.MSG_ERR); | ||||
} | } | ||||
@@ -319,7 +319,7 @@ public class EchoProperties extends Task { | |||||
String message = | String message = | ||||
"Can not write to the specified destfile!"; | "Can not write to the specified destfile!"; | ||||
if (failonerror) { | if (failonerror) { | ||||
throw new BuildException(message, location); | |||||
throw new BuildException(message, getLocation()); | |||||
} else { | } else { | ||||
log(message, Project.MSG_ERR); | log(message, Project.MSG_ERR); | ||||
} | } | ||||
@@ -330,7 +330,7 @@ public class EchoProperties extends Task { | |||||
} | } | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
if (failonerror) { | if (failonerror) { | ||||
throw new BuildException(ioe, location); | |||||
throw new BuildException(ioe, getLocation()); | |||||
} else { | } else { | ||||
log(ioe.getMessage(), Project.MSG_INFO); | log(ioe.getMessage(), Project.MSG_INFO); | ||||
} | } | ||||
@@ -654,22 +654,22 @@ public class IContract extends MatchingTask { | |||||
/** Checks that the required attributes are set. */ | /** Checks that the required attributes are set. */ | ||||
private void preconditions() throws BuildException { | private void preconditions() throws BuildException { | ||||
if (srcDir == null) { | if (srcDir == null) { | ||||
throw new BuildException("srcdir attribute must be set!", location); | |||||
throw new BuildException("srcdir attribute must be set!", getLocation()); | |||||
} | } | ||||
if (!srcDir.exists()) { | if (!srcDir.exists()) { | ||||
throw new BuildException("srcdir \"" + srcDir.getPath() + "\" does not exist!", location); | |||||
throw new BuildException("srcdir \"" + srcDir.getPath() + "\" does not exist!", getLocation()); | |||||
} | } | ||||
if (instrumentDir == null) { | if (instrumentDir == null) { | ||||
throw new BuildException("instrumentdir attribute must be set!", location); | |||||
throw new BuildException("instrumentdir attribute must be set!", getLocation()); | |||||
} | } | ||||
if (repositoryDir == null) { | if (repositoryDir == null) { | ||||
throw new BuildException("repositorydir attribute must be set!", location); | |||||
throw new BuildException("repositorydir attribute must be set!", getLocation()); | |||||
} | } | ||||
if (updateIcontrol == true && classDir == null) { | if (updateIcontrol == true && classDir == null) { | ||||
throw new BuildException("classdir attribute must be specified when updateicontrol=true!", location); | |||||
throw new BuildException("classdir attribute must be specified when updateicontrol=true!", getLocation()); | |||||
} | } | ||||
if (updateIcontrol == true && controlFile == null) { | if (updateIcontrol == true && controlFile == null) { | ||||
throw new BuildException("controlfile attribute must be specified when updateicontrol=true!", location); | |||||
throw new BuildException("controlfile attribute must be specified when updateicontrol=true!", getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -283,19 +283,19 @@ public class Javah extends Task { | |||||
// first off, make sure that we've got a srcdir | // first off, make sure that we've got a srcdir | ||||
if ((cls == null) && (classes.size() == 0)) { | if ((cls == null) && (classes.size() == 0)) { | ||||
throw new BuildException("class attribute must be set!", location); | |||||
throw new BuildException("class attribute must be set!", getLocation()); | |||||
} | } | ||||
if ((cls != null) && (classes.size() > 0)) { | if ((cls != null) && (classes.size() > 0)) { | ||||
throw new BuildException("set class attribute or class element, not both.", location); | |||||
throw new BuildException("set class attribute or class element, not both.", getLocation()); | |||||
} | } | ||||
if (destDir != null) { | if (destDir != null) { | ||||
if (!destDir.isDirectory()) { | if (!destDir.isDirectory()) { | ||||
throw new BuildException("destination directory \"" + destDir + "\" does not exist or is not a directory", location); | |||||
throw new BuildException("destination directory \"" + destDir + "\" does not exist or is not a directory", getLocation()); | |||||
} | } | ||||
if (outputFile != null) { | if (outputFile != null) { | ||||
throw new BuildException("destdir and outputFile are mutually exclusive", location); | |||||
throw new BuildException("destdir and outputFile are mutually exclusive", getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -350,7 +350,7 @@ public class Javah extends Task { | |||||
if (ex instanceof BuildException) { | if (ex instanceof BuildException) { | ||||
throw (BuildException) ex; | throw (BuildException) ex; | ||||
} else { | } else { | ||||
throw new BuildException("Error starting javah: " + ex, ex, location); | |||||
throw new BuildException("Error starting javah: " + ex, ex, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -396,7 +396,7 @@ public class Javah extends Task { | |||||
if (stubs) { | if (stubs) { | ||||
if (!old) { | if (!old) { | ||||
throw new BuildException("stubs only available in old mode.", location); | |||||
throw new BuildException("stubs only available in old mode.", getLocation()); | |||||
} | } | ||||
cmd.createArgument().setValue("-stubs"); | cmd.createArgument().setValue("-stubs"); | ||||
} | } | ||||
@@ -140,7 +140,7 @@ public class Native2Ascii extends MatchingTask { | |||||
public Mapper createMapper() throws BuildException { | public Mapper createMapper() throws BuildException { | ||||
if (mapper != null) { | if (mapper != null) { | ||||
throw new BuildException("Cannot define more than one mapper", | throw new BuildException("Cannot define more than one mapper", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
mapper = new Mapper(getProject()); | mapper = new Mapper(getProject()); | ||||
return mapper; | return mapper; | ||||
@@ -235,7 +235,7 @@ public class PropertyFile extends Task { | |||||
private void checkParameters() throws BuildException { | private void checkParameters() throws BuildException { | ||||
if (!checkParam(propertyfile)) { | if (!checkParam(propertyfile)) { | ||||
throw new BuildException("file token must not be null.", location); | |||||
throw new BuildException("file token must not be null.", getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -270,12 +270,12 @@ public class PropertyFile extends Task { | |||||
properties.save(bos, comment); | properties.save(bos, comment); | ||||
} catch (InvocationTargetException ite) { | } catch (InvocationTargetException ite) { | ||||
Throwable t = ite.getTargetException(); | Throwable t = ite.getTargetException(); | ||||
throw new BuildException(t, location); | |||||
throw new BuildException(t, getLocation()); | |||||
} catch (IllegalAccessException iae) { | } catch (IllegalAccessException iae) { | ||||
// impossible | // impossible | ||||
throw new BuildException(iae, location); | |||||
throw new BuildException(iae, getLocation()); | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException(ioe, location); | |||||
throw new BuildException(ioe, getLocation()); | |||||
} finally { | } finally { | ||||
if (bos != null) { | if (bos != null) { | ||||
try { | try { | ||||
@@ -152,7 +152,7 @@ public class RenameExtensions extends MatchingTask { | |||||
Project.MSG_INFO); | Project.MSG_INFO); | ||||
Move move = (Move) getProject().createTask("move"); | Move move = (Move) getProject().createTask("move"); | ||||
move.setOwningTarget(target); | |||||
move.setOwningTarget(getOwningTarget()); | |||||
move.setTaskName(getTaskName()); | move.setTaskName(getTaskName()); | ||||
move.setLocation(getLocation()); | move.setLocation(getLocation()); | ||||
move.setTodir(srcDir); | move.setTodir(srcDir); | ||||
@@ -150,7 +150,7 @@ public class Rpm extends Task { | |||||
try { | try { | ||||
outputstream = new PrintStream(new BufferedOutputStream(new FileOutputStream(output))); | outputstream = new PrintStream(new BufferedOutputStream(new FileOutputStream(output))); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} else { | } else { | ||||
outputstream = new LogOutputStream(this, Project.MSG_INFO); | outputstream = new LogOutputStream(this, Project.MSG_INFO); | ||||
@@ -159,7 +159,7 @@ public class Rpm extends Task { | |||||
try { | try { | ||||
errorstream = new PrintStream(new BufferedOutputStream(new FileOutputStream(error))); | errorstream = new PrintStream(new BufferedOutputStream(new FileOutputStream(error))); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} else { | } else { | ||||
errorstream = new LogOutputStream(this, Project.MSG_WARN); | errorstream = new LogOutputStream(this, Project.MSG_WARN); | ||||
@@ -180,7 +180,7 @@ public class Rpm extends Task { | |||||
exe.execute(); | exe.execute(); | ||||
log("Building the RPM based on the " + specFile + " file"); | log("Building the RPM based on the " + specFile + " file"); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} finally { | } finally { | ||||
if (output != null) { | if (output != null) { | ||||
try { | try { | ||||
@@ -218,7 +218,7 @@ public class Rpm extends Task { | |||||
*/ | */ | ||||
public void setSpecFile(String sf) { | public void setSpecFile(String sf) { | ||||
if ((sf == null) || (sf.trim().equals(""))) { | if ((sf == null) || (sf.trim().equals(""))) { | ||||
throw new BuildException("You must specify a spec file", location); | |||||
throw new BuildException("You must specify a spec file", getLocation()); | |||||
} | } | ||||
this.specFile = sf; | this.specFile = sf; | ||||
} | } | ||||
@@ -149,7 +149,7 @@ public class CCMCheck extends Continuus { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -110,7 +110,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler { | |||||
result = run(commandLine, this); | result = run(commandLine, this); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
//create task ok, set this task as the default one | //create task ok, set this task as the default one | ||||
@@ -124,7 +124,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler { | |||||
result = run(commandLine2); | result = run(commandLine2); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine2.toString(); | String msg = "Failed executing: " + commandLine2.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -98,7 +98,7 @@ public class CCMReconfigure extends Continuus { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -130,7 +130,7 @@ public abstract class Continuus extends Task { | |||||
exe.setCommandline(cmd.getCommandline()); | exe.setCommandline(cmd.getCommandline()); | ||||
return exe.execute(); | return exe.execute(); | ||||
} catch (java.io.IOException e) { | } catch (java.io.IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -146,7 +146,7 @@ public class CCCheckin extends ClearCase { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -158,7 +158,7 @@ public class CCCheckout extends ClearCase { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -116,7 +116,7 @@ public class CCUnCheckout extends ClearCase { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -151,7 +151,7 @@ public class CCUpdate extends ClearCase { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -134,7 +134,7 @@ public abstract class ClearCase extends Task { | |||||
exe.setCommandline(cmd.getCommandline()); | exe.setCommandline(cmd.getCommandline()); | ||||
return exe.execute(); | return exe.execute(); | ||||
} catch (java.io.IOException e) { | } catch (java.io.IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -638,14 +638,14 @@ public class Depend extends MatchingTask { | |||||
try { | try { | ||||
long start = System.currentTimeMillis(); | long start = System.currentTimeMillis(); | ||||
if (srcPath == null) { | if (srcPath == null) { | ||||
throw new BuildException("srcdir attribute must be set", | |||||
location); | |||||
throw new BuildException("srcdir attribute must be set", | |||||
getLocation()); | |||||
} | } | ||||
srcPathList = srcPath.list(); | srcPathList = srcPath.list(); | ||||
if (srcPathList.length == 0) { | if (srcPathList.length == 0) { | ||||
throw new BuildException("srcdir attribute must be non-empty", | |||||
location); | |||||
throw new BuildException("srcdir attribute must be non-empty", | |||||
getLocation()); | |||||
} | } | ||||
if (destPath == null) { | if (destPath == null) { | ||||
@@ -239,34 +239,34 @@ public class IPlanetEjbcTask extends Task { | |||||
if (ejbdescriptor == null) { | if (ejbdescriptor == null) { | ||||
String msg = "The standard EJB descriptor must be specified using " | String msg = "The standard EJB descriptor must be specified using " | ||||
+ "the \"ejbdescriptor\" attribute."; | + "the \"ejbdescriptor\" attribute."; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
if ((!ejbdescriptor.exists()) || (!ejbdescriptor.isFile())) { | if ((!ejbdescriptor.exists()) || (!ejbdescriptor.isFile())) { | ||||
String msg = "The standard EJB descriptor (" + ejbdescriptor | String msg = "The standard EJB descriptor (" + ejbdescriptor | ||||
+ ") was not found or isn't a file."; | + ") was not found or isn't a file."; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
if (iasdescriptor == null) { | if (iasdescriptor == null) { | ||||
String msg = "The iAS-speific XML descriptor must be specified using" | String msg = "The iAS-speific XML descriptor must be specified using" | ||||
+ " the \"iasdescriptor\" attribute."; | + " the \"iasdescriptor\" attribute."; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
if ((!iasdescriptor.exists()) || (!iasdescriptor.isFile())) { | if ((!iasdescriptor.exists()) || (!iasdescriptor.isFile())) { | ||||
String msg = "The iAS-specific XML descriptor (" + iasdescriptor | String msg = "The iAS-specific XML descriptor (" + iasdescriptor | ||||
+ ") was not found or isn't a file."; | + ") was not found or isn't a file."; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
if (dest == null) { | if (dest == null) { | ||||
String msg = "The destination directory must be specified using " | String msg = "The destination directory must be specified using " | ||||
+ "the \"dest\" attribute."; | + "the \"dest\" attribute."; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
if ((!dest.exists()) || (!dest.isDirectory())) { | if ((!dest.exists()) || (!dest.isDirectory())) { | ||||
String msg = "The destination directory (" + dest + ") was not " | String msg = "The destination directory (" + dest + ") was not " | ||||
+ "found or isn't a directory."; | + "found or isn't a directory."; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
if ((iashome != null) && (!iashome.isDirectory())) { | if ((iashome != null) && (!iashome.isDirectory())) { | ||||
@@ -291,10 +291,10 @@ public class IPlanetEjbcTask extends Task { | |||||
saxParser = saxParserFactory.newSAXParser(); | saxParser = saxParserFactory.newSAXParser(); | ||||
} catch (SAXException e) { | } catch (SAXException e) { | ||||
String msg = "Unable to create a SAXParser: " + e.getMessage(); | String msg = "Unable to create a SAXParser: " + e.getMessage(); | ||||
throw new BuildException(msg, e, location); | |||||
throw new BuildException(msg, e, getLocation()); | |||||
} catch (ParserConfigurationException e) { | } catch (ParserConfigurationException e) { | ||||
String msg = "Unable to create a SAXParser: " + e.getMessage(); | String msg = "Unable to create a SAXParser: " + e.getMessage(); | ||||
throw new BuildException(msg, e, location); | |||||
throw new BuildException(msg, e, getLocation()); | |||||
} | } | ||||
return saxParser; | return saxParser; | ||||
@@ -325,15 +325,15 @@ public class IPlanetEjbcTask extends Task { | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
String msg = "An IOException occurred while trying to read the XML " | String msg = "An IOException occurred while trying to read the XML " | ||||
+ "descriptor file: " + e.getMessage(); | + "descriptor file: " + e.getMessage(); | ||||
throw new BuildException(msg, e, location); | |||||
throw new BuildException(msg, e, getLocation()); | |||||
} catch (SAXException e) { | } catch (SAXException e) { | ||||
String msg = "A SAXException occurred while trying to read the XML " | String msg = "A SAXException occurred while trying to read the XML " | ||||
+ "descriptor file: " + e.getMessage(); | + "descriptor file: " + e.getMessage(); | ||||
throw new BuildException(msg, e, location); | |||||
throw new BuildException(msg, e, getLocation()); | |||||
} catch (IPlanetEjbc.EjbcException e) { | } catch (IPlanetEjbc.EjbcException e) { | ||||
String msg = "An exception occurred while trying to run the ejbc " | String msg = "An exception occurred while trying to run the ejbc " | ||||
+ "utility: " + e.getMessage(); | + "utility: " + e.getMessage(); | ||||
throw new BuildException(msg, e, location); | |||||
throw new BuildException(msg, e, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -248,29 +248,29 @@ public class Translate extends MatchingTask { | |||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
if (bundle == null) { | if (bundle == null) { | ||||
throw new BuildException("The bundle attribute must be set.", | throw new BuildException("The bundle attribute must be set.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (startToken == null) { | if (startToken == null) { | ||||
throw new BuildException("The starttoken attribute must be set.", | throw new BuildException("The starttoken attribute must be set.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (startToken.length() != 1) { | if (startToken.length() != 1) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"The starttoken attribute must be a single character.", | "The starttoken attribute must be a single character.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (endToken == null) { | if (endToken == null) { | ||||
throw new BuildException("The endtoken attribute must be set.", | throw new BuildException("The endtoken attribute must be set.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (endToken.length() != 1) { | if (endToken.length() != 1) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"The endtoken attribute must be a single character.", | "The endtoken attribute must be a single character.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (bundleLanguage == null) { | if (bundleLanguage == null) { | ||||
@@ -289,7 +289,7 @@ public class Translate extends MatchingTask { | |||||
if (toDir == null) { | if (toDir == null) { | ||||
throw new BuildException("The todir attribute must be set.", | throw new BuildException("The todir attribute must be set.", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (!toDir.exists()) { | if (!toDir.exists()) { | ||||
@@ -405,7 +405,7 @@ public class Translate extends MatchingTask { | |||||
//have been scanned for and still not able to | //have been scanned for and still not able to | ||||
//find a single resrouce file, throw exception | //find a single resrouce file, throw exception | ||||
if (!loaded && checkLoaded) { | if (!loaded && checkLoaded) { | ||||
throw new BuildException(ioe.getMessage(), location); | |||||
throw new BuildException(ioe.getMessage(), getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -463,7 +463,7 @@ public class Translate extends MatchingTask { | |||||
in.close(); | in.close(); | ||||
} | } | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException(ioe.getMessage(), location); | |||||
throw new BuildException(ioe.getMessage(), getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -579,7 +579,7 @@ outer: while (true) { | |||||
Project.MSG_VERBOSE); | Project.MSG_VERBOSE); | ||||
} | } | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException(ioe.getMessage(), location); | |||||
throw new BuildException(ioe.getMessage(), getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -303,7 +303,7 @@ public class JDependTask extends Task { | |||||
if (errorOccurred) { | if (errorOccurred) { | ||||
if (getHaltonerror()) { | if (getHaltonerror()) { | ||||
throw new BuildException("JDepend failed", | throw new BuildException("JDepend failed", | ||||
location); | |||||
getLocation()); | |||||
} else { | } else { | ||||
log("JDepend FAILED", Project.MSG_ERR); | log("JDepend FAILED", Project.MSG_ERR); | ||||
} | } | ||||
@@ -426,7 +426,7 @@ public class JDependTask extends Task { | |||||
try { | try { | ||||
return execute.execute(); | return execute.execute(); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException("Process fork failed.", e, location); | |||||
throw new BuildException("Process fork failed.", e, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -177,7 +177,7 @@ public class JlinkTask extends MatchingTask { | |||||
try { | try { | ||||
linker.link(); | linker.link(); | ||||
} catch (Exception ex) { | } catch (Exception ex) { | ||||
throw new BuildException(ex, location); | |||||
throw new BuildException(ex, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -402,19 +402,19 @@ public class JspC extends MatchingTask { | |||||
// first off, make sure that we've got a srcdir | // first off, make sure that we've got a srcdir | ||||
if (src == null) { | if (src == null) { | ||||
throw new BuildException("srcdir attribute must be set!", | throw new BuildException("srcdir attribute must be set!", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
String [] list = src.list(); | String [] list = src.list(); | ||||
if (list.length == 0) { | if (list.length == 0) { | ||||
throw new BuildException("srcdir attribute must be set!", | throw new BuildException("srcdir attribute must be set!", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
if (destDir != null && !destDir.isDirectory()) { | if (destDir != null && !destDir.isDirectory()) { | ||||
throw new | throw new | ||||
BuildException("destination directory \"" + destDir + | BuildException("destination directory \"" + destDir + | ||||
"\" does not exist or is not a directory", | "\" does not exist or is not a directory", | ||||
location); | |||||
getLocation()); | |||||
} | } | ||||
File dest = getActualDestDir(); | File dest = getActualDestDir(); | ||||
@@ -441,7 +441,7 @@ public class JspC extends MatchingTask { | |||||
File srcDir = (File) getProject().resolveFile(list[i]); | File srcDir = (File) getProject().resolveFile(list[i]); | ||||
if (!srcDir.exists()) { | if (!srcDir.exists()) { | ||||
throw new BuildException("srcdir \"" + srcDir.getPath() + | throw new BuildException("srcdir \"" + srcDir.getPath() + | ||||
"\" does not exist!", location); | |||||
"\" does not exist!", getLocation()); | |||||
} | } | ||||
DirectoryScanner ds = this.getDirectoryScanner(srcDir); | DirectoryScanner ds = this.getDirectoryScanner(srcDir); | ||||
String[] files = ds.getIncludedFiles(); | String[] files = ds.getIncludedFiles(); | ||||
@@ -497,7 +497,7 @@ public class JspC extends MatchingTask { | |||||
// finally, lets execute the compiler!! | // finally, lets execute the compiler!! | ||||
if (!compiler.execute()) { | if (!compiler.execute()) { | ||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException(FAIL_MSG, location); | |||||
throw new BuildException(FAIL_MSG, getLocation()); | |||||
} else { | } else { | ||||
log(FAIL_MSG, Project.MSG_ERR); | log(FAIL_MSG, Project.MSG_ERR); | ||||
} | } | ||||
@@ -139,7 +139,7 @@ public class WLJspc extends MatchingTask { | |||||
} | } | ||||
if (destinationPackage == null) { | if (destinationPackage == null) { | ||||
throw new BuildException("package attribute must be present.", location); | |||||
throw new BuildException("package attribute must be present.", getLocation()); | |||||
} | } | ||||
@@ -566,7 +566,7 @@ public class JUnitTask extends Task { | |||||
if ((errorOccurredHere && test.getHaltonerror()) | if ((errorOccurredHere && test.getHaltonerror()) | ||||
|| (failureOccurredHere && test.getHaltonfailure())) { | || (failureOccurredHere && test.getHaltonfailure())) { | ||||
throw new BuildException("Test " + test.getName() + " failed" | throw new BuildException("Test " + test.getName() + " failed" | ||||
+ (wasKilled ? " (timeout)" : ""), location); | |||||
+ (wasKilled ? " (timeout)" : ""), getLocation()); | |||||
} else { | } else { | ||||
log("TEST " + test.getName() + " FAILED" | log("TEST " + test.getName() + " FAILED" | ||||
+ (wasKilled ? " (timeout)" : ""), Project.MSG_ERR); | + (wasKilled ? " (timeout)" : ""), Project.MSG_ERR); | ||||
@@ -651,7 +651,7 @@ public class JUnitTask extends Task { | |||||
} catch (java.io.IOException e) { | } catch (java.io.IOException e) { | ||||
propsFile.delete(); | propsFile.delete(); | ||||
throw new BuildException("Error creating temporary properties " | throw new BuildException("Error creating temporary properties " | ||||
+ "file.", e, location); | |||||
+ "file.", e, getLocation()); | |||||
} | } | ||||
Execute execute = new Execute(new LogStreamHandler(this, | Execute execute = new Execute(new LogStreamHandler(this, | ||||
@@ -679,7 +679,7 @@ public class JUnitTask extends Task { | |||||
try { | try { | ||||
retVal = execute.execute(); | retVal = execute.execute(); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
throw new BuildException("Process fork failed.", e, location); | |||||
throw new BuildException("Process fork failed.", e, getLocation()); | |||||
} finally { | } finally { | ||||
if (!propsFile.delete()) { | if (!propsFile.delete()) { | ||||
throw new BuildException("Could not delete temporary " | throw new BuildException("Could not delete temporary " | ||||
@@ -144,7 +144,7 @@ public class Pvcs extends org.apache.tools.ant.Task { | |||||
} catch (java.io.IOException e) { | } catch (java.io.IOException e) { | ||||
String msg = "Failed executing: " + cmd.toString() | String msg = "Failed executing: " + cmd.toString() | ||||
+ ". Exception: " + e.getMessage(); | + ". Exception: " + e.getMessage(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -231,7 +231,7 @@ public class Pvcs extends org.apache.tools.ant.Task { | |||||
if (result != 0 && !ignorerc) { | if (result != 0 && !ignorerc) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
if (!tmp.exists()) { | if (!tmp.exists()) { | ||||
@@ -278,21 +278,21 @@ public class Pvcs extends org.apache.tools.ant.Task { | |||||
if (result != 0 && !ignorerc) { | if (result != 0 && !ignorerc) { | ||||
String msg = "Failed executing: " + commandLine.toString() | String msg = "Failed executing: " + commandLine.toString() | ||||
+ ". Return code was " + result; | + ". Return code was " + result; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} catch (FileNotFoundException e) { | } catch (FileNotFoundException e) { | ||||
String msg = "Failed executing: " + commandLine.toString() | String msg = "Failed executing: " + commandLine.toString() | ||||
+ ". Exception: " + e.getMessage(); | + ". Exception: " + e.getMessage(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} catch (IOException e) { | } catch (IOException e) { | ||||
String msg = "Failed executing: " + commandLine.toString() | String msg = "Failed executing: " + commandLine.toString() | ||||
+ ". Exception: " + e.getMessage(); | + ". Exception: " + e.getMessage(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} catch (ParseException e) { | } catch (ParseException e) { | ||||
String msg = "Failed executing: " + commandLine.toString() | String msg = "Failed executing: " + commandLine.toString() | ||||
+ ". Exception: " + e.getMessage(); | + ". Exception: " + e.getMessage(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} finally { | } finally { | ||||
if (tmp != null) { | if (tmp != null) { | ||||
tmp.delete(); | tmp.delete(); | ||||
@@ -464,7 +464,7 @@ public abstract class SOS extends Task { | |||||
if (!done) { | if (!done) { | ||||
String msg = "Directory " + localPath + " creation was not " + | String msg = "Directory " + localPath + " creation was not " + | ||||
"successful for an unknown reason"; | "successful for an unknown reason"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
getProject().log("Created dir: " + dir.getAbsolutePath()); | getProject().log("Created dir: " + dir.getAbsolutePath()); | ||||
} | } | ||||
@@ -491,7 +491,7 @@ public abstract class SOS extends Task { | |||||
exe.setCommandline(cmd.getCommandline()); | exe.setCommandline(cmd.getCommandline()); | ||||
return exe.execute(); | return exe.execute(); | ||||
} catch (java.io.IOException e) { | } catch (java.io.IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -161,7 +161,7 @@ public class SOSCheckin extends SOS { | |||||
if (result == 255) { | if (result == 255) { | ||||
// This is the exit status | // This is the exit status | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -200,13 +200,13 @@ public class SOSCheckin extends SOS { | |||||
} | } | ||||
// SOS server address is required | // SOS server address is required | ||||
if (getSosServerPath() == null) { | if (getSosServerPath() == null) { | ||||
throw new BuildException("sosserverpath attribute must be set!", location); | |||||
throw new BuildException("sosserverpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER); | commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER); | ||||
commandLine.createArgument().setValue(getSosServerPath()); | commandLine.createArgument().setValue(getSosServerPath()); | ||||
// Login info is required | // Login info is required | ||||
if (getUsername() == null) { | if (getUsername() == null) { | ||||
throw new BuildException("username attribute must be set!", location); | |||||
throw new BuildException("username attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME); | commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME); | ||||
commandLine.createArgument().setValue(getUsername()); | commandLine.createArgument().setValue(getUsername()); | ||||
@@ -216,13 +216,13 @@ public class SOSCheckin extends SOS { | |||||
commandLine.createArgument().setValue(getPassword()); | commandLine.createArgument().setValue(getPassword()); | ||||
// VSS Info is required | // VSS Info is required | ||||
if (getVssServerPath() == null) { | if (getVssServerPath() == null) { | ||||
throw new BuildException("vssserverpath attribute must be set!", location); | |||||
throw new BuildException("vssserverpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER); | commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER); | ||||
commandLine.createArgument().setValue(getVssServerPath()); | commandLine.createArgument().setValue(getVssServerPath()); | ||||
// VSS project is required | // VSS project is required | ||||
if (getProjectPath() == null) { | if (getProjectPath() == null) { | ||||
throw new BuildException("projectpath attribute must be set!", location); | |||||
throw new BuildException("projectpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT); | commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT); | ||||
commandLine.createArgument().setValue(getProjectPath()); | commandLine.createArgument().setValue(getProjectPath()); | ||||
@@ -157,7 +157,7 @@ public class SOSCheckout extends SOS { | |||||
if (result == 255) { | if (result == 255) { | ||||
// This is the exit status | // This is the exit status | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -195,13 +195,13 @@ public class SOSCheckout extends SOS { | |||||
} | } | ||||
// SOS server address is required | // SOS server address is required | ||||
if (getSosServerPath() == null) { | if (getSosServerPath() == null) { | ||||
throw new BuildException("sosserverpath attribute must be set!", location); | |||||
throw new BuildException("sosserverpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER); | commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER); | ||||
commandLine.createArgument().setValue(getSosServerPath()); | commandLine.createArgument().setValue(getSosServerPath()); | ||||
// Login info is required | // Login info is required | ||||
if (getUsername() == null) { | if (getUsername() == null) { | ||||
throw new BuildException("username attribute must be set!", location); | |||||
throw new BuildException("username attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME); | commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME); | ||||
commandLine.createArgument().setValue(getUsername()); | commandLine.createArgument().setValue(getUsername()); | ||||
@@ -211,13 +211,13 @@ public class SOSCheckout extends SOS { | |||||
commandLine.createArgument().setValue(getPassword()); | commandLine.createArgument().setValue(getPassword()); | ||||
// VSS Info is required | // VSS Info is required | ||||
if (getVssServerPath() == null) { | if (getVssServerPath() == null) { | ||||
throw new BuildException("vssserverpath attribute must be set!", location); | |||||
throw new BuildException("vssserverpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER); | commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER); | ||||
commandLine.createArgument().setValue(getVssServerPath()); | commandLine.createArgument().setValue(getVssServerPath()); | ||||
// VSS project is required | // VSS project is required | ||||
if (getProjectPath() == null) { | if (getProjectPath() == null) { | ||||
throw new BuildException("projectpath attribute must be set!", location); | |||||
throw new BuildException("projectpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT); | commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT); | ||||
commandLine.createArgument().setValue(getProjectPath()); | commandLine.createArgument().setValue(getProjectPath()); | ||||
@@ -168,7 +168,7 @@ public class SOSGet extends SOS { | |||||
if (result == 255) { | if (result == 255) { | ||||
// This is the exit status | // This is the exit status | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -217,13 +217,13 @@ public class SOSGet extends SOS { | |||||
} | } | ||||
// SOS server address is required | // SOS server address is required | ||||
if (getSosServerPath() == null) { | if (getSosServerPath() == null) { | ||||
throw new BuildException("sosserverpath attribute must be set!", location); | |||||
throw new BuildException("sosserverpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER); | commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER); | ||||
commandLine.createArgument().setValue(getSosServerPath()); | commandLine.createArgument().setValue(getSosServerPath()); | ||||
// Login info is required | // Login info is required | ||||
if (getUsername() == null) { | if (getUsername() == null) { | ||||
throw new BuildException("username attribute must be set!", location); | |||||
throw new BuildException("username attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME); | commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME); | ||||
commandLine.createArgument().setValue(getUsername()); | commandLine.createArgument().setValue(getUsername()); | ||||
@@ -233,13 +233,13 @@ public class SOSGet extends SOS { | |||||
commandLine.createArgument().setValue(getPassword()); | commandLine.createArgument().setValue(getPassword()); | ||||
// VSS Info is required | // VSS Info is required | ||||
if (getVssServerPath() == null) { | if (getVssServerPath() == null) { | ||||
throw new BuildException("vssserverpath attribute must be set!", location); | |||||
throw new BuildException("vssserverpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER); | commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER); | ||||
commandLine.createArgument().setValue(getVssServerPath()); | commandLine.createArgument().setValue(getVssServerPath()); | ||||
// SS project path is required | // SS project path is required | ||||
if (getProjectPath() == null) { | if (getProjectPath() == null) { | ||||
throw new BuildException("projectpath attribute must be set!", location); | |||||
throw new BuildException("projectpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT); | commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT); | ||||
commandLine.createArgument().setValue(getProjectPath()); | commandLine.createArgument().setValue(getProjectPath()); | ||||
@@ -135,7 +135,7 @@ public class SOSLabel extends SOS { | |||||
if (result == 255) { | if (result == 255) { | ||||
// This is the exit status | // This is the exit status | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -156,13 +156,13 @@ public class SOSLabel extends SOS { | |||||
commandLine.createArgument().setValue(SOSCmd.COMMAND_LABEL); | commandLine.createArgument().setValue(SOSCmd.COMMAND_LABEL); | ||||
// SOS server address is required | // SOS server address is required | ||||
if (getSosServerPath() == null) { | if (getSosServerPath() == null) { | ||||
throw new BuildException("sosserverpath attribute must be set!", location); | |||||
throw new BuildException("sosserverpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER); | commandLine.createArgument().setValue(SOSCmd.FLAG_SOS_SERVER); | ||||
commandLine.createArgument().setValue(getSosServerPath()); | commandLine.createArgument().setValue(getSosServerPath()); | ||||
// Login info is required | // Login info is required | ||||
if (getUsername() == null) { | if (getUsername() == null) { | ||||
throw new BuildException("username attribute must be set!", location); | |||||
throw new BuildException("username attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME); | commandLine.createArgument().setValue(SOSCmd.FLAG_USERNAME); | ||||
commandLine.createArgument().setValue(getUsername()); | commandLine.createArgument().setValue(getUsername()); | ||||
@@ -172,19 +172,19 @@ public class SOSLabel extends SOS { | |||||
commandLine.createArgument().setValue(getPassword()); | commandLine.createArgument().setValue(getPassword()); | ||||
// VSS Info is required | // VSS Info is required | ||||
if (getVssServerPath() == null) { | if (getVssServerPath() == null) { | ||||
throw new BuildException("vssserverpath attribute must be set!", location); | |||||
throw new BuildException("vssserverpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER); | commandLine.createArgument().setValue(SOSCmd.FLAG_VSS_SERVER); | ||||
commandLine.createArgument().setValue(getVssServerPath()); | commandLine.createArgument().setValue(getVssServerPath()); | ||||
// SS project path is required | // SS project path is required | ||||
if (getProjectPath() == null) { | if (getProjectPath() == null) { | ||||
throw new BuildException("projectpath attribute must be set!", location); | |||||
throw new BuildException("projectpath attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT); | commandLine.createArgument().setValue(SOSCmd.FLAG_PROJECT); | ||||
commandLine.createArgument().setValue(getProjectPath()); | commandLine.createArgument().setValue(getProjectPath()); | ||||
// a label is required | // a label is required | ||||
if (getLabel() == null) { | if (getLabel() == null) { | ||||
throw new BuildException("label attribute must be set!", location); | |||||
throw new BuildException("label attribute must be set!", getLocation()); | |||||
} | } | ||||
commandLine.createArgument().setValue(SOSCmd.FLAG_LABEL); | commandLine.createArgument().setValue(SOSCmd.FLAG_LABEL); | ||||
commandLine.createArgument().setValue(getLabel()); | commandLine.createArgument().setValue(getLabel()); | ||||
@@ -192,7 +192,7 @@ public abstract class MSVSS extends Task { | |||||
exe.setCommandline(cmd.getCommandline()); | exe.setCommandline(cmd.getCommandline()); | ||||
return exe.execute(); | return exe.execute(); | ||||
} catch (java.io.IOException e) { | } catch (java.io.IOException e) { | ||||
throw new BuildException(e, location); | |||||
throw new BuildException(e, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -86,7 +86,7 @@ public class MSVSSADD extends MSVSS { | |||||
// first off, make sure that we've got a command and a localPath ... | // first off, make sure that we've got a command and a localPath ... | ||||
if (getLocalPath() == null) { | if (getLocalPath() == null) { | ||||
String msg = "localPath attribute must be set!"; | String msg = "localPath attribute must be set!"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
// now look for illegal combinations of things ... | // now look for illegal combinations of things ... | ||||
@@ -113,7 +113,7 @@ public class MSVSSADD extends MSVSS { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -88,7 +88,7 @@ public class MSVSSCHECKIN extends MSVSS { | |||||
// first off, make sure that we've got a command and a vssdir ... | // first off, make sure that we've got a command and a vssdir ... | ||||
if (getVsspath() == null) { | if (getVsspath() == null) { | ||||
String msg = "vsspath attribute must be set!"; | String msg = "vsspath attribute must be set!"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
// now look for illegal combinations of things ... | // now look for illegal combinations of things ... | ||||
@@ -117,7 +117,7 @@ public class MSVSSCHECKIN extends MSVSS { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -145,7 +145,7 @@ public class MSVSSCHECKIN extends MSVSS { | |||||
String msg = "Directory " + m_LocalPath | String msg = "Directory " + m_LocalPath | ||||
+ " creation was not " | + " creation was not " | ||||
+ "succesful for an unknown reason"; | + "succesful for an unknown reason"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
getProject().log("Created dir: " + dir.getAbsolutePath()); | getProject().log("Created dir: " + dir.getAbsolutePath()); | ||||
} | } | ||||
@@ -90,7 +90,7 @@ public class MSVSSCHECKOUT extends MSVSS { | |||||
// first off, make sure that we've got a command and a vssdir ... | // first off, make sure that we've got a command and a vssdir ... | ||||
if (getVsspath() == null) { | if (getVsspath() == null) { | ||||
String msg = "vsspath attribute must be set!"; | String msg = "vsspath attribute must be set!"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
// now look for illegal combinations of things ... | // now look for illegal combinations of things ... | ||||
@@ -117,7 +117,7 @@ public class MSVSSCHECKOUT extends MSVSS { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -144,7 +144,7 @@ public class MSVSSCHECKOUT extends MSVSS { | |||||
if (!done) { | if (!done) { | ||||
String msg = "Directory " + m_LocalPath + " creation was not " + | String msg = "Directory " + m_LocalPath + " creation was not " + | ||||
"succesful for an unknown reason"; | "succesful for an unknown reason"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
getProject().log("Created dir: " + dir.getAbsolutePath()); | getProject().log("Created dir: " + dir.getAbsolutePath()); | ||||
} | } | ||||
@@ -83,7 +83,7 @@ public class MSVSSCP extends MSVSS { | |||||
// first off, make sure that we've got a command and a vssdir ... | // first off, make sure that we've got a command and a vssdir ... | ||||
if (getVsspath() == null) { | if (getVsspath() == null) { | ||||
String msg = "vsspath attribute must be set!"; | String msg = "vsspath attribute must be set!"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
// now look for illegal combinations of things ... | // now look for illegal combinations of things ... | ||||
@@ -104,7 +104,7 @@ public class MSVSSCP extends MSVSS { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -137,7 +137,7 @@ public class MSVSSCREATE extends MSVSS { | |||||
// first off, make sure that we've got a command and a vssdir... | // first off, make sure that we've got a command and a vssdir... | ||||
if (getVsspath() == null) { | if (getVsspath() == null) { | ||||
String msg = "vsspath attribute must be set!"; | String msg = "vsspath attribute must be set!"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
// now look for illegal combinations of things ... | // now look for illegal combinations of things ... | ||||
@@ -166,7 +166,7 @@ public class MSVSSCREATE extends MSVSS { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0 && m_FailOnError) { | if (result != 0 && m_FailOnError) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -153,7 +153,7 @@ public class MSVSSGET extends MSVSS { | |||||
// first off, make sure that we've got a command and a vssdir ... | // first off, make sure that we've got a command and a vssdir ... | ||||
if (getVsspath() == null) { | if (getVsspath() == null) { | ||||
String msg = "vsspath attribute must be set!"; | String msg = "vsspath attribute must be set!"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
// now look for illegal combinations of things ... | // now look for illegal combinations of things ... | ||||
@@ -184,7 +184,7 @@ public class MSVSSGET extends MSVSS { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -211,7 +211,7 @@ public class MSVSSGET extends MSVSS { | |||||
if (!done) { | if (!done) { | ||||
String msg = "Directory " + m_LocalPath + " creation was not " + | String msg = "Directory " + m_LocalPath + " creation was not " + | ||||
"successful for an unknown reason"; | "successful for an unknown reason"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
getProject().log("Created dir: " + dir.getAbsolutePath()); | getProject().log("Created dir: " + dir.getAbsolutePath()); | ||||
} | } | ||||
@@ -107,7 +107,7 @@ public class MSVSSHISTORY extends MSVSS { | |||||
// first off, make sure that we've got a command and a vssdir and a label ... | // first off, make sure that we've got a command and a vssdir and a label ... | ||||
if (getVsspath() == null) { | if (getVsspath() == null) { | ||||
String msg = "vsspath attribute must be set!"; | String msg = "vsspath attribute must be set!"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
// now look for illegal combinations of things ... | // now look for illegal combinations of things ... | ||||
@@ -150,7 +150,7 @@ public class MSVSSHISTORY extends MSVSS { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||
@@ -252,7 +252,7 @@ public class MSVSSHISTORY extends MSVSS { | |||||
startDate = calcDate(m_ToDate, m_NumDays); | startDate = calcDate(m_ToDate, m_NumDays); | ||||
} catch (ParseException ex) { | } catch (ParseException ex) { | ||||
String msg = "Error parsing date: " + m_ToDate; | String msg = "Error parsing date: " + m_ToDate; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
cmd.createArgument().setValue(FLAG_VERSION_DATE + m_ToDate + VALUE_FROMDATE + startDate); | cmd.createArgument().setValue(FLAG_VERSION_DATE + m_ToDate + VALUE_FROMDATE + startDate); | ||||
} else if (m_FromDate != null && m_NumDays != Integer.MIN_VALUE) { | } else if (m_FromDate != null && m_NumDays != Integer.MIN_VALUE) { | ||||
@@ -261,7 +261,7 @@ public class MSVSSHISTORY extends MSVSS { | |||||
endDate = calcDate(m_FromDate, m_NumDays); | endDate = calcDate(m_FromDate, m_NumDays); | ||||
} catch (ParseException ex) { | } catch (ParseException ex) { | ||||
String msg = "Error parsing date: " + m_FromDate; | String msg = "Error parsing date: " + m_FromDate; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
cmd.createArgument().setValue(FLAG_VERSION_DATE + endDate + VALUE_FROMDATE + m_FromDate); | cmd.createArgument().setValue(FLAG_VERSION_DATE + endDate + VALUE_FROMDATE + m_FromDate); | ||||
} else { | } else { | ||||
@@ -133,11 +133,11 @@ public class MSVSSLABEL extends MSVSS { | |||||
// first off, make sure that we've got a command and a vssdir and a label ... | // first off, make sure that we've got a command and a vssdir and a label ... | ||||
if (getVsspath() == null) { | if (getVsspath() == null) { | ||||
String msg = "vsspath attribute must be set!"; | String msg = "vsspath attribute must be set!"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
if (getLabel() == null) { | if (getLabel() == null) { | ||||
String msg = "label attribute must be set!"; | String msg = "label attribute must be set!"; | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
// now look for illegal combinations of things ... | // now look for illegal combinations of things ... | ||||
@@ -171,7 +171,7 @@ public class MSVSSLABEL extends MSVSS { | |||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | if (result != 0) { | ||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | |||||
throw new BuildException(msg, getLocation()); | |||||
} | } | ||||
} | } | ||||