-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
40 lines (33 loc) · 1.26 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
plugins {
id 'base'
id 'org.springframework.boot' version '3.2.4' apply false
id 'io.spring.dependency-management' version '1.1.4' apply false
id 'io.freefair.lombok' version '8.6' apply false
id 'com.avast.gradle.docker-compose' version '0.17.6' apply false
id 'com.github.davidmc24.gradle.plugin.avro' version '1.9.1' apply false
id 'org.sonarqube' version '4.4.1.3373'
}
sonar {
properties {
property "sonar.projectKey", "bazzani_kafka-connect-stack"
property("sonar.organization", "bazzani-github")
property "sonar.host.url", "https://sonarcloud.io"
property("sonar.branch.name", getWorkingBranchName())
property("sonar.coverage.jacoco.xmlReportPaths", getJaCoCoXmlReportPath())
}
}
String getWorkingBranchName() {
def workingBranch = "git rev-parse --abbrev-ref HEAD".execute().text.trim()
println "Working branch: " + workingBranch
return workingBranch
}
String getJaCoCoXmlReportPath() {
return this.project("jacoco-report-aggregation").layout.getBuildDirectory()
.file("reports/jacoco/jacocoFullReport/jacocoFullReport.xml").get()
.toString()
}
tasks.named('build') {
if (System.getenv("SONAR_TOKEN") != null) {
dependsOn tasks.named("sonar")
}
}