Changeset 19016ed for build.gradle


Ignore:
Timestamp:
Dec 7, 2017 3:50:25 AM (2 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
f9eaf41
Parents:
75e6539
Message:

Gradle: Add code coverage reporting, upload from Travis CI to Codecov

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.gradle

    r75e6539 r19016ed  
    11// Exclude apps/ dir itself, but include its subdirs
    2 configure(subprojects - project(':apps')) {
     2def javaProjects = subprojects - project(':apps')
     3
     4configure(javaProjects) {
    35    apply plugin: 'java'
     6    apply plugin: 'jacoco'
    47    apply plugin: 'eclipse'
    58    apply plugin: 'idea'
     
    3033}
    3134
     35task codeCoverageReport(type: JacocoReport) {
     36    dependsOn(javaProjects.test)
     37
     38    jacocoClasspath = project(':core').configurations.jacocoAnt
     39    additionalSourceDirs = files(javaProjects.sourceSets.main.allSource.srcDirs)
     40    sourceDirectories = files(javaProjects.sourceSets.main.allSource.srcDirs)
     41    classDirectories = files(javaProjects.sourceSets.main.output)
     42    executionData = files(javaProjects.jacocoTestReport.executionData)
     43
     44    doFirst {
     45        executionData = files(executionData.findAll { it.exists() })
     46    }
     47
     48    reports {
     49        xml.enabled true
     50        xml.destination "${buildDir}/reports/jacoco/report.xml"
     51        html.enabled true
     52        html.destination "${buildDir}/reports/jacoco/html"
     53    }
     54}
     55
    3256//apply from: file('gradle/update.gradle')
Note: See TracChangeset for help on using the changeset viewer.