libcvrapi/build.gradle
Mark Nellemann d86d3fdd61
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Fix maven publish
2023-01-03 15:12:30 +01:00

94 lines
2.2 KiB
Groovy

apply plugin: "java-library"
apply plugin: "groovy"
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
repositories {
mavenCentral()
}
dependencies {
implementation("org.slf4j:slf4j-api:${slf4jVersion}")
implementation("com.google.code.gson:gson:2.10")
implementation("com.squareup.okhttp3:okhttp:4.10.0")
testImplementation("org.slf4j:slf4j-simple:${slf4jVersion}")
testImplementation("com.squareup.okhttp3:mockwebserver:4.10.0")
testImplementation("org.codehaus.groovy:groovy-all:${groovyVersion}")
testImplementation("org.spockframework:spock-core:${spockVersion}") {
exclude group: "org.codehaus.groovy"
}
testImplementation("com.athaydes:spock-reports:2.3.2-groovy-3.0") {
transitive = false // this avoids affecting your version of Groovy/Spock
}
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'biz.nellemann.libs'
artifactId = 'libpaqle'
from components.java
}
}
repositories {
maven {
name = "gitea"
url = uri("https://git.data.coop/api/packages/$System.env.DRONE_REPO_OWNER/maven")
credentials {
username = "$System.env.DRONE_REPO_OWNER"
password = "$System.env.AUTH_TOKEN"
}
}
mavenLocal()
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
test {
useJUnitPlatform()
}
jacoco {
toolVersion = "0.8.8"
}
jacocoTestReport {
group = "verification"
reports {
xml.required = false
csv.required = false
html.destination file("${buildDir}/reports/coverage")
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: 'biz/nellemann/libcvrapi/pojo/**')
}))
}
}
test.finalizedBy jacocoTestReport
jacocoTestCoverageVerification {
violationRules {
rule {
element = 'CLASS'
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.7
}
excludes = [
'biz.nellemann.libcvrapi.pojo.*'
]
}
}
}
check.dependsOn jacocoTestCoverageVerification