git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274951 13f79535-47bb-0310-9956-ffa450edef68master
@@ -372,7 +372,7 @@ public abstract class AbstractCvsTask extends Task { | |||||
int retCode = exe.execute(); | int retCode = exe.execute(); | ||||
log("retCode=" + retCode, Project.MSG_DEBUG); | log("retCode=" + retCode, Project.MSG_DEBUG); | ||||
/*Throw an exception if cvs exited with error. (Iulian)*/ | /*Throw an exception if cvs exited with error. (Iulian)*/ | ||||
if (failOnError && retCode != 0) { | |||||
if (failOnError && Execute.isFailure(retCode)) { | |||||
throw new BuildException("cvs exited with error code " | throw new BuildException("cvs exited with error code " | ||||
+ retCode | + retCode | ||||
+ StringUtils.LINE_SEP | + StringUtils.LINE_SEP | ||||
@@ -577,7 +577,7 @@ public class Execute { | |||||
exe.setAntRun(task.getProject()); | exe.setAntRun(task.getProject()); | ||||
exe.setCommandline(cmdline); | exe.setCommandline(cmdline); | ||||
int retval = exe.execute(); | int retval = exe.execute(); | ||||
if (retval != 0) { | |||||
if (isFailure(retval)) { | |||||
throw new BuildException(cmdline[0] | throw new BuildException(cmdline[0] | ||||
+ " failed with return code " + retval, task.getLocation()); | + " failed with return code " + retval, task.getLocation()); | ||||
} | } | ||||
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2000-2002 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -66,7 +66,7 @@ import org.apache.tools.ant.util.Watchdog; | |||||
* Execute exec = new Execute(myloghandler, watchdog); | * Execute exec = new Execute(myloghandler, watchdog); | ||||
* exec.setCommandLine(mycmdline); | * exec.setCommandLine(mycmdline); | ||||
* int exitvalue = exec.execute(); | * int exitvalue = exec.execute(); | ||||
* if (exitvalue != SUCCESS && watchdog.killedProcess()) { | |||||
* if (Execute.isFailure(exitvalue) && watchdog.killedProcess()) { | |||||
* // it was killed on purpose by the watchdog | * // it was killed on purpose by the watchdog | ||||
* } | * } | ||||
* </pre> | * </pre> | ||||
@@ -102,7 +102,8 @@ public class Java extends Task { | |||||
int err = -1; | int err = -1; | ||||
try { | try { | ||||
if ((err = executeJava()) != 0) { | |||||
err = executeJava(); | |||||
if (fork && Execute.isFailure(err)) { | |||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException("Java returned: " + err, getLocation()); | throw new BuildException("Java returned: " + err, getLocation()); | ||||
} else { | } else { | ||||
@@ -1984,7 +1984,7 @@ public class Javadoc extends Task { | |||||
try { | try { | ||||
exe.setCommandline(toExecute.getCommandline()); | exe.setCommandline(toExecute.getCommandline()); | ||||
int ret = exe.execute(); | int ret = exe.execute(); | ||||
if (ret != 0 && failOnError) { | |||||
if (Execute.isFailure(ret) && failOnError) { | |||||
throw new BuildException("Javadoc returned " + ret, getLocation()); | throw new BuildException("Javadoc returned " + ret, getLocation()); | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2002 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -286,7 +286,7 @@ public class ChangeLogTask extends Task { | |||||
try { | try { | ||||
final int resultCode = exe.execute(); | final int resultCode = exe.execute(); | ||||
if (0 != resultCode) { | |||||
if (Execute.isFailure(resultCode)) { | |||||
throw new BuildException("Error running cvs log"); | throw new BuildException("Error running cvs log"); | ||||
} | } | ||||
} catch (final IOException ioe) { | } catch (final IOException ioe) { | ||||
@@ -318,7 +318,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 (Execute.isFailure(err)) { | |||||
throw new BuildException("ANTLR returned: " + err, getLocation()); | throw new BuildException("ANTLR returned: " + err, getLocation()); | ||||
} else { | } else { | ||||
String output = bos.toString(); | String output = bos.toString(); | ||||
@@ -303,7 +303,7 @@ public class Cab extends MatchingTask { | |||||
} | } | ||||
// Informative summary message in case of errors | // Informative summary message in case of errors | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
log("Error executing listcab; error code: " + result); | log("Error executing listcab; error code: " + result); | ||||
} | } | ||||
} catch (IOException ex) { | } catch (IOException ex) { | ||||
@@ -60,6 +60,7 @@ import java.util.Vector; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
@@ -197,7 +198,7 @@ public class CCMCheck extends Continuus { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
int result = run(commandLine); | int result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(0)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, getLocation()); | throw new BuildException(msg, getLocation()); | ||||
} | } | ||||
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -62,6 +62,7 @@ import java.io.InputStreamReader; | |||||
import java.io.OutputStream; | import java.io.OutputStream; | ||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.taskdefs.ExecuteStreamHandler; | import org.apache.tools.ant.taskdefs.ExecuteStreamHandler; | ||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
@@ -107,7 +108,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
result = run(commandLine, this); | result = run(commandLine, this); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, getLocation()); | throw new BuildException(msg, getLocation()); | ||||
} | } | ||||
@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs.optional.ccm; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
@@ -94,7 +95,7 @@ public class CCMReconfigure extends Continuus { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, getLocation()); | throw new BuildException(msg, getLocation()); | ||||
} | } | ||||
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2000,2002 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2000,2002-2003 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -56,11 +56,9 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
/** | /** | ||||
* Performs ClearCase checkin. | * Performs ClearCase checkin. | ||||
* | * | ||||
@@ -144,7 +142,7 @@ public class CCCheckin extends ClearCase { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, getLocation()); | throw new BuildException(msg, getLocation()); | ||||
} | } | ||||
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2000,2002 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2000,2002-2003 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
@@ -156,7 +157,7 @@ public class CCCheckout extends ClearCase { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, getLocation()); | throw new BuildException(msg, getLocation()); | ||||
} | } | ||||
@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
@@ -148,7 +149,7 @@ public class CCLock extends ClearCase { | |||||
System.out.println(commandLine.toString()); | System.out.println(commandLine.toString()); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | throw new BuildException(msg, location); | ||||
} | } | ||||
@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
/** | /** | ||||
@@ -145,7 +146,7 @@ public class CCMkbl extends ClearCase { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | throw new BuildException(msg, location); | ||||
} | } | ||||
@@ -393,4 +394,4 @@ public class CCMkbl extends ClearCase { | |||||
public static final String FLAG_NLABEL = "-nlabel"; | public static final String FLAG_NLABEL = "-nlabel"; | ||||
} | |||||
} |
@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
/** | /** | ||||
@@ -151,7 +152,7 @@ public class CCMklabel extends ClearCase { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | throw new BuildException(msg, location); | ||||
} | } | ||||
@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
/** | /** | ||||
@@ -160,7 +161,7 @@ public class CCMklbtype extends ClearCase { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | throw new BuildException(msg, location); | ||||
} | } | ||||
@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
/** | /** | ||||
@@ -153,7 +154,7 @@ public class CCRmtype extends ClearCase { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | throw new BuildException(msg, location); | ||||
} | } | ||||
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2000,2002 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2000,2002-2003 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -56,11 +56,9 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
/** | /** | ||||
* Performs ClearCase UnCheckout command. | * Performs ClearCase UnCheckout command. | ||||
* | * | ||||
@@ -114,7 +112,7 @@ public class CCUnCheckout extends ClearCase { | |||||
checkOptions(commandLine); | checkOptions(commandLine); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, getLocation()); | throw new BuildException(msg, getLocation()); | ||||
} | } | ||||
@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
/** | /** | ||||
@@ -128,7 +129,7 @@ public class CCUnlock extends ClearCase { | |||||
System.out.println(commandLine.toString()); | System.out.println(commandLine.toString()); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, location); | throw new BuildException(msg, location); | ||||
} | } | ||||
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2000,2002 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2000,2002-2003 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -56,12 +56,9 @@ package org.apache.tools.ant.taskdefs.optional.clearcase; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
import org.apache.tools.ant.taskdefs.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
/** | /** | ||||
* Performs a ClearCase Update command. | * Performs a ClearCase Update command. | ||||
* | * | ||||
@@ -151,7 +148,7 @@ public class CCUpdate extends ClearCase { | |||||
System.out.println(commandLine.toString()); | System.out.println(commandLine.toString()); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, getLocation()); | throw new BuildException(msg, getLocation()); | ||||
} | } | ||||
@@ -251,7 +251,7 @@ public class NetCommand { | |||||
} | } | ||||
executable.setCommandline(commandLine.getCommandline()); | executable.setCommandline(commandLine.getCommandline()); | ||||
err = executable.execute(); | err = executable.execute(); | ||||
if (err != 0) { | |||||
if (Execute.isFailure(err)) { | |||||
if (failOnError) { | if (failOnError) { | ||||
throw new BuildException(title + " returned: " + err, owner.getLocation()); | throw new BuildException(title + " returned: " + err, owner.getLocation()); | ||||
} else { | } else { | ||||
@@ -460,7 +460,7 @@ public class BorlandDeploymentTool extends GenericDeploymentTool | |||||
log(commandline.describeCommand(), Project.MSG_DEBUG); | log(commandline.describeCommand(), Project.MSG_DEBUG); | ||||
execTask.setCommandline(commandline.getCommandline()); | execTask.setCommandline(commandline.getCommandline()); | ||||
int result = execTask.execute(); | int result = execTask.execute(); | ||||
if (result != 0) { | |||||
if (Execute.isFailure(result)) { | |||||
String msg = "Failed executing java2iiop (ret code is " | String msg = "Failed executing java2iiop (ret code is " | ||||
+ result + ")"; | + result + ")"; | ||||
throw new BuildException(msg, getTask().getLocation()); | throw new BuildException(msg, getTask().getLocation()); | ||||
@@ -194,7 +194,7 @@ public class JJDoc extends Task { | |||||
process.setCommandline(cmdl.getCommandline()); | process.setCommandline(cmdl.getCommandline()); | ||||
try { | try { | ||||
if (process.execute() != 0) { | |||||
if (Execute.isFailure(process.execute())) { | |||||
throw new BuildException("JJDoc failed."); | throw new BuildException("JJDoc failed."); | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
@@ -290,7 +290,7 @@ public class JJTree extends Task { | |||||
process.setCommandline(cmdl.getCommandline()); | process.setCommandline(cmdl.getCommandline()); | ||||
try { | try { | ||||
if (process.execute() != 0) { | |||||
if (Execute.isFailure(process.execute())) { | |||||
throw new BuildException("JJTree failed."); | throw new BuildException("JJTree failed."); | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
@@ -246,7 +246,7 @@ public abstract class AbstractMetamataTask extends Task { | |||||
log(cmdl.describeCommand(), Project.MSG_VERBOSE); | log(cmdl.describeCommand(), Project.MSG_VERBOSE); | ||||
process.setCommandline(cmdl.getCommandline()); | process.setCommandline(cmdl.getCommandline()); | ||||
try { | try { | ||||
if (process.execute() != 0) { | |||||
if (Execute.isFailure(process.execute())) { | |||||
throw new BuildException("Metamata task failed."); | throw new BuildException("Metamata task failed."); | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
@@ -183,7 +183,7 @@ public class MParse extends AbstractMetamataTask { | |||||
log(cmdl.describeCommand(), Project.MSG_VERBOSE); | log(cmdl.describeCommand(), Project.MSG_VERBOSE); | ||||
process.setCommandline(cmdl.getCommandline()); | process.setCommandline(cmdl.getCommandline()); | ||||
try { | try { | ||||
if (process.execute() != 0) { | |||||
if (Execute.isFailure(process.execute())) { | |||||
throw new BuildException("Metamata task failed."); | throw new BuildException("Metamata task failed."); | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
@@ -236,7 +236,7 @@ public class Pvcs extends org.apache.tools.ant.Task { | |||||
fos.close(); | fos.close(); | ||||
} | } | ||||
if (result != 0 && !ignorerc) { | |||||
if (Execute.isFailure(result) && !ignorerc) { | |||||
String msg = "Failed executing: " + commandLine.toString(); | String msg = "Failed executing: " + commandLine.toString(); | ||||
throw new BuildException(msg, getLocation()); | throw new BuildException(msg, getLocation()); | ||||
} | } | ||||
@@ -139,7 +139,7 @@ public class CovMerge extends CovBase { | |||||
// JProbe process always return 0 so we will not be | // JProbe process always return 0 so we will not be | ||||
// able to check for failure ! :-( | // able to check for failure ! :-( | ||||
int exitValue = exec.execute(); | int exitValue = exec.execute(); | ||||
if (exitValue != 0) { | |||||
if (Execute.isFailure(exitValue)) { | |||||
throw new BuildException("JProbe Coverage Merging failed (" + exitValue + ")"); | throw new BuildException("JProbe Coverage Merging failed (" + exitValue + ")"); | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
@@ -300,7 +300,7 @@ public class CovReport extends CovBase { | |||||
log(cmdl.describeCommand(), Project.MSG_VERBOSE); | log(cmdl.describeCommand(), Project.MSG_VERBOSE); | ||||
exec.setCommandline(cmdl.getCommandline()); | exec.setCommandline(cmdl.getCommandline()); | ||||
int exitValue = exec.execute(); | int exitValue = exec.execute(); | ||||
if (exitValue != 0) { | |||||
if (Execute.isFailure(exitValue)) { | |||||
throw new BuildException("JProbe Coverage Report failed (" | throw new BuildException("JProbe Coverage Report failed (" | ||||
+ exitValue + ")"); | + exitValue + ")"); | ||||
} | } | ||||
@@ -331,7 +331,7 @@ public class Coverage extends CovBase { | |||||
log(cmdl.describeCommand(), Project.MSG_VERBOSE); | log(cmdl.describeCommand(), Project.MSG_VERBOSE); | ||||
exec.setCommandline(cmdl.getCommandline()); | exec.setCommandline(cmdl.getCommandline()); | ||||
int exitValue = exec.execute(); | int exitValue = exec.execute(); | ||||
if (exitValue != 0) { | |||||
if (Execute.isFailure(exitValue)) { | |||||
throw new BuildException("JProbe Coverage failed (" + exitValue + ")"); | throw new BuildException("JProbe Coverage failed (" + exitValue + ")"); | ||||
} | } | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
@@ -222,7 +222,7 @@ public abstract class MSVSS extends Task implements MSVSSConstants { | |||||
int result = 0; | int result = 0; | ||||
Commandline commandLine = buildCmdLine(); | Commandline commandLine = buildCmdLine(); | ||||
result = run(commandLine); | result = run(commandLine); | ||||
if (result != 0 && getFailOnError()) { | |||||
if (Execute.isFailure(result) && getFailOnError()) { | |||||
String msg = "Failed executing: " + formatCommandLine(commandLine) | String msg = "Failed executing: " + formatCommandLine(commandLine) | ||||
+ " With a return code of " + result; | + " With a return code of " + result; | ||||
throw new BuildException(msg, getLocation()); | throw new BuildException(msg, getLocation()); | ||||