"Do not use includes/excludes here; use fileIncludes/fileExcludes"
+ " with Java regexs, not ant patterns");
}
public void execute() throws BuildException {
CommandLineBuilder builder = null;
try {
builder = makeCommandLineBuilder();
builder.addArg( "--source", dir );
builder.addArg( "--dest", targetDir );
if ( isNotBlank( selectorClass ) ) {
builder.addArg( "--selectorClass", selectorClass );
}
if ( isNotBlank( logFile ) ) {
builder.addArg( "--logFile", logFile );
}
if ( isNotBlank( fileIncludes ) ) {
builder.addArg( "--includes", fileIncludes );
}
if ( isNotBlank( fileExcludes ) ) {
builder.addArg( "--excludes", fileExcludes );
}
builder.saveArgs();
} catch (IOException ioe) {
getProject().log("Error creating commands file.", Project.MSG_ERR);
throw new BuildException("Unable to create the commands file.", ioe);
}
getJava().createArg().setValue("--commandsfile");
getJava().createArg().setValue(builder.getCommandLineFile());
getJava().setOutput(new File("purrPackageInstrumenter.out"));
getJava().setError(new File("purrPackageInstrumenter.err"));
if (getJava().executeJava() != 0) {
throw new BuildException(
"Error instrumenting tests. See messages above.");
}
builder.dispose();
}