Skip to content

Commit

Permalink
commit progress grails 5 upgrade - switched to jacoco #2782
Browse files Browse the repository at this point in the history
  • Loading branch information
salomon-j committed Jan 16, 2023
1 parent cbf2194 commit 20f3b97
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Build and run clover coverage report with Gradle
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with:
arguments: -PenableClover=true cloverGenerateReport
arguments: -PenableJacoco=true jacocoTestCoverageVerification
env:
GPR_USER: ${{env.GITHUB_ACTOR}}
GPR_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ apply plugin: 'com.craigburke.client-dependencies'
if (Boolean.valueOf(enableClover)) {
apply from: "${project.projectDir}/gradle/clover.gradle"
}

if (Boolean.valueOf(enableJacoco)) {
apply from: "${project.projectDir}/gradle/jacoco.gradle"
}

apply from: "${project.projectDir}/gradle/publish.gradle"

repositories {
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
meritVersion=2.10-SNAPSHOT
grailsVersion=5.2.4
groovyVersion=3.0.9
groovyVersion=3.0.7
gormVersion=7.3.2

grailsWrapperVersion=1.0.0
gradleWrapperVersion=5.0
assetPipelineVersion=3.4.4
mongoDBVersion=7.0
mongoDBVersion=7.3.2
geoToolsVersion=21.5
org.gradle.parallel=true
enableClover=false
enableJacoco=false
inplace=false
org.gradle.jvmargs=-Xmx2048M
8 changes: 4 additions & 4 deletions gradle/clover.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
buildscript {
repositories {
jcenter()
gradlePluginPortal()
}
dependencies {
classpath 'com.bmuschko:gradle-clover-plugin:3.0.1'
classpath 'com.bmuschko:gradle-clover-plugin:3.0.3'
}
}

Expand All @@ -29,8 +29,8 @@ clover {
encoding = 'UTF-8'

// Override the Java Compiler source and target compatibility settings
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = '11'
targetCompatibility = '11'

// used to add debug information for Spring applications
debug = true
Expand Down
42 changes: 42 additions & 0 deletions gradle/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apply plugin:"jacoco"
jacoco {
toolVersion = "0.8.8"
}
test {
jacoco {
excludes = ['**/Application.groovy',
'**/BootStrap.groovy',
'**/UrlMappings.groovy',
'**/*GrailsPlugin.groovy',
'**/*Mock.groovy',
'com.skedgo.converter.*']
}
}
jacocoTestReport {
dependsOn test

afterEvaluate {
getClassDirectories().setFrom(classDirectories.files.collect {
fileTree(dir: it,
exclude: [
'**/TimezoneMapper.class'
]
)
})
}
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/reports/jacocoHtml")
}
}

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

0 comments on commit 20f3b97

Please sign in to comment.