use of org.jacoco.core.tools.ExecFileLoader in project jacoco by jacoco.
the class MergeTask method execute.
@Override
public void execute() throws BuildException {
if (destfile == null) {
throw new BuildException("Destination file must be supplied", getLocation());
}
final ExecFileLoader loader = new ExecFileLoader();
load(loader);
save(loader);
}
use of org.jacoco.core.tools.ExecFileLoader in project jacoco by jacoco.
the class MergeTest method loadExecFile.
private Set<String> loadExecFile(File file) throws IOException {
ExecFileLoader loader = new ExecFileLoader();
loader.load(file);
Set<String> names = new HashSet<String>();
for (ExecutionData d : loader.getExecutionDataStore().getContents()) {
names.add(d.getName());
}
return names;
}
use of org.jacoco.core.tools.ExecFileLoader in project jacoco by jacoco.
the class Merge method execute.
@Override
public int execute(final PrintWriter out, final PrintWriter err) throws IOException {
final ExecFileLoader loader = loadExecutionData(out);
out.printf("[INFO] Writing execution data to %s.%n", destfile.getAbsolutePath());
loader.save(destfile, true);
return 0;
}
use of org.jacoco.core.tools.ExecFileLoader in project jacoco by jacoco.
the class Report method execute.
@Override
public int execute(final PrintWriter out, final PrintWriter err) throws IOException {
final ExecFileLoader loader = loadExecutionData(out);
final IBundleCoverage bundle = analyze(loader.getExecutionDataStore(), out);
writeReports(bundle, loader, out);
return 0;
}
use of org.jacoco.core.tools.ExecFileLoader in project jacoco by jacoco.
the class Report method loadExecutionData.
private ExecFileLoader loadExecutionData(final PrintWriter out) throws IOException {
final ExecFileLoader loader = new ExecFileLoader();
if (execfiles.isEmpty()) {
out.println("[WARN] No execution data files provided.");
} else {
for (final File file : execfiles) {
out.printf("[INFO] Loading execution data file %s.%n", file.getAbsolutePath());
loader.load(file);
}
}
return loader;
}
Aggregations