throw new MoxieException("Unable to extract agent jar", e);
}
}
public static void report(MxTest mxtest) {
ReportTask task = new ReportTask();
task.setTaskName("report");
task.setProject(mxtest.getProject());
task.init();
// execution data
Union executiondata = task.createExecutiondata();
Path jacocodata = new Path(mxtest.getProject());
jacocodata.setPath(mxtest.getJaCoCoData().getAbsolutePath());
executiondata.add(jacocodata);
GroupElement structure = task.createStructure();
structure.setName(mxtest.getProjectTitle());
// classfiles
Union classfiles = structure.createClassfiles();
Path outputpath = new Path(mxtest.getProject());
outputpath.setPath(mxtest.getClassesDir().getAbsolutePath());
classfiles.add(outputpath);
MaxmlMap attributes = mxtest.getBuild().getConfig().getTaskAttributes(mxtest.getTaskName());
if (attributes == null) {
attributes = new MaxmlMap();
}
// source files
SourceFilesElement sourcefiles = structure.createSourcefiles();
sourcefiles.setEncoding(attributes.getString("encoding", null));
Path sourcepath = new Path(mxtest.getProject());
sourcepath.setRefid(new Reference(mxtest.getProject(), Key.compileSourcePath.referenceId()));
sourcefiles.add(sourcepath);
// report output folder
task.createHtml().setDestdir(mxtest.getCoverageReports());
task.execute();
}