Browse Source

A more defensive approach to PR: 14849, keep things as they've been

unless we are using JProbe 4+.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274534 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
8618d4a229
2 changed files with 17 additions and 2 deletions
  1. +7
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovBase.java
  2. +10
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java

+ 7
- 0
src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovBase.java View File

@@ -129,4 +129,11 @@ public abstract class CovBase extends Task {
protected String getParamFileArgument() {
return (!isJProbe4 ? "-jp_" : "") + "paramfile=";
}

/**
* Are we running on a version of JProbe 4.x or higher?
*/
protected boolean isJProbe4Plus() {
return isJProbe4;
}
}

+ 10
- 2
src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java View File

@@ -124,8 +124,11 @@ public class CovMerge extends CovBase {
cmdl.createArgument().setValue(getParamFileArgument()
+ paramfile.getAbsolutePath());

// last argument is the output snapshot
cmdl.createArgument().setValue(tofile.getPath());
if (isJProbe4Plus()) {
// last argument is the output snapshot - JProbe 4.x
// doesn't like it in the parameter file.
cmdl.createArgument().setValue(tofile.getPath());
}

LogStreamHandler handler = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN);
Execute exec = new Execute(handler);
@@ -199,6 +202,11 @@ public class CovMerge extends CovBase {
for (int i = 0; i < snapshots.length; i++) {
pw.println(snapshots[i].getAbsolutePath());
}
if (!isJProbe4Plus()) {
// last file is the output snapshot - JProbe 4.x doesn't
// like it in the parameter file.
pw.println(getProject().resolveFile(tofile.getPath()));
}
pw.flush();
} catch (IOException e) {
throw new BuildException("I/O error while writing to " + file, e);


Loading…
Cancel
Save