Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update JaCoCo reports
  • Loading branch information
MarcusAdriano committed Jun 23, 2020
1 parent ac6f5a7 commit 29ad782
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dist: trusty
jdk: oraclejdk8

script:
- ./gradlew build jacocoTestReport
- ./gradlew build

after_success:
- bash <(curl -s https://codecov.io/bash)
26 changes: 17 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ repositories {
}

test {
exclude 'io/github/marcusadriano/brawlstars/model/**'
exclude 'io/github/marcusadriano/brawlstars/examples/**'

// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
Expand All @@ -28,34 +25,45 @@ test {
useJUnitPlatform()
}

def jacocoExcludes = [
'io/github/marcusadriano/brawlstars/model/**'
]

def jacocoRulesExcludes = [
'io.github.marcusadriano.brawlstars.model.**'
]

jacocoTestCoverageVerification {
violationRules {
rule {
element = 'METHOD'
excludes = jacocoRulesExcludes
limit {
counter = 'BRANCH'
minimum = 0.9
}
}
}
}

jacocoTestReport {
dependsOn test
dependsOn jacocoTestCoverageVerification
reports {
xml.enabled true
csv.enabled false
html.enabled true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'io/github/marcusadriano/brawlstars/examples/**',
'io/github/marcusadriano/brawlstars/model/**'
])
fileTree(dir: it, exclude: jacocoExcludes)
}))
}
}

check {
dependsOn jacocoTestCoverageVerification
dependsOn jacocoTestReport
}

compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions {
Expand Down

0 comments on commit 29ad782

Please sign in to comment.