Package org.jacoco.ant

Examples of org.jacoco.ant.ReportTask$CheckFormatterElement


      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();
  }
View Full Code Here

TOP

Related Classes of org.jacoco.ant.ReportTask$CheckFormatterElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.