Skip to content

Commit

Permalink
add config
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Sep 3, 2024
1 parent 9831d5a commit 35a7c17
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 1 deletion.
44 changes: 44 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ plugins {
id 'idea'
id 'se.patrikerdes.use-latest-versions' version '0.2.18'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'jacoco'
}

// Add ability to test with upcoming versions of Groovy
Expand Down Expand Up @@ -62,6 +63,7 @@ allprojects {
apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'java-library'
apply plugin: 'jacoco'

java {
toolchain {
Expand All @@ -88,6 +90,48 @@ allprojects {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

test {
useJUnitPlatform()
finalizedBy jacocoTestReport // report is always generated after tests run
}

jacoco {
toolVersion = "0.8.12"
reportsDirectory = layout.buildDirectory.dir('reports/jacoco')
}

jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required = false
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}

jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.5
}
}

rule {
enabled = false
element = 'CLASS'
includes = ['org.gradle.*']

limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 0.3
}
}
}
}


configurations {
// see https://docs.gradle.org/4.1/userguide/dependency_management.html#sub:exclude_transitive_dependencies
all*.exclude group: 'org.codehaus.groovy', module: 'groovy-all'
Expand Down
39 changes: 38 additions & 1 deletion plugins/nf-quilt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ plugins {
id 'idea'
id 'se.patrikerdes.use-latest-versions' version '0.2.18'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'jacoco'
}

useLatestVersions {
// A blacklist of dependencies to update, in the format of group:name
// A blacklist of dependencies to not update, in the format of group:name
updateBlacklist = [
'com.quiltdata:quiltcore',
'org.codehaus.groovy:groovy',
Expand Down Expand Up @@ -113,5 +114,41 @@ dependencies {
// use JUnit 5 platform
test {
useJUnitPlatform()
finalizedBy jacocoTestReport // report is always generated after tests run
}

jacoco {
toolVersion = "0.8.12"
reportsDirectory = layout.buildDirectory.dir('reports/jacoco')
}

jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required = false
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}

jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.5
}
}

rule {
enabled = false
element = 'CLASS'
includes = ['org.gradle.*']

limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 0.3
}
}
}
}

0 comments on commit 35a7c17

Please sign in to comment.