diff --git a/WHATSNEW b/WHATSNEW index ff72cbf72..6a6f302da 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -15,6 +15,10 @@ Changes that could break older environments: doesn't impact build scripts if their reference to junitlauncher task was merely through the use of the element. + * ClearCase#runS has been augmented by a two arg-version and the + one-arg version will no longer be called. This may affect + subclasses that have overridden runS. + Fixed bugs: ----------- @@ -44,6 +48,9 @@ Fixed bugs: org.apache.tools.ant.Project#getCopyOfReferences. Github Pull Request #81 + * cccheckout would ignore an error of the "ls checkout" command even + if failOnError was set to false. + Bugzilla Report 63071 Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java b/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java index a25109473..6ca7c676d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java @@ -217,7 +217,7 @@ public class CCCheckout extends ClearCase { // viewpath cmdl.createArgument().setValue(getViewPath()); - String result = runS(cmdl); + String result = runS(cmdl, getFailOnErr()); return result != null && !result.isEmpty(); } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java b/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java index 5771a0dd6..98777bcdf 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java @@ -33,9 +33,9 @@ import org.apache.tools.ant.util.FileUtils; /** * A base class for creating tasks for executing commands on ClearCase. *

- * The class extends the 'exec' task as it operates by executing the cleartool program - * supplied with ClearCase. By default the task expects the cleartool executable to be - * in the path, * you can override this be specifying the cleartooldir attribute. + * By default the task expects the cleartool executable to be in the + * path, you can override this be specifying the cleartooldir + * attribute. *

*

* This class provides set and get methods for the 'viewpath' and 'objselect' @@ -205,8 +205,21 @@ public abstract class ClearCase extends Task { * Execute the given command, and return it's output * @param cmdline command line to execute * @return output of the command line + * @deprecated use the two arg version instead */ + @Deprecated protected String runS(Commandline cmdline) { + return runS(cmdline, false); + } + + /** + * Execute the given command, and return it's output + * @param cmdline command line to execute + * @param failOnError whether to fail the build if the command fails + * @return output of the command line + * @since Ant 1.10.6 + */ + protected String runS(Commandline cmdline, boolean failOnError) { String outV = "opts.cc.runS.output" + pcnt++; ExecTask exe = new ExecTask(this); Commandline.Argument arg = exe.createArg(); @@ -214,6 +227,7 @@ public abstract class ClearCase extends Task { exe.setExecutable(cmdline.getExecutable()); arg.setLine(Commandline.toString(cmdline.getArguments())); exe.setOutputproperty(outV); + exe.setFailonerror(failOnError); exe.execute(); return getProject().getProperty(outV);