Skip to content

Commit b11da22

Browse files
committed
Upgrade sonar plugin and fix jacoco and new JS coverage location
1 parent ee73a6a commit b11da22

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

build.gradle

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
plugins {
2-
id "jacoco"
3-
id "org.sonarqube" version "3.5.0.2730"
2+
id "org.sonarqube" version "5.0.0.4638"
43
}
54

6-
sonarqube {
7-
properties {
8-
property "sonar.sourceEncoding", "UTF-8"
9-
}
10-
}
11-
12-
tasks {
13-
sonarqube {
14-
dependsOn ":web-ui:yarn_run_coverage", ":server:jacocoTestReport"
15-
}
5+
tasks.named("sonarqube") {
6+
dependsOn ":web-ui:yarn_run_coverage", ":server:jacocoTestReport"
167
}

server/build.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ test {
126126
jacocoTestReport {
127127
dependsOn test // tests are required to run before generating the report
128128
reports {
129-
xml.required.set(true)
129+
xml.required = true
130+
csv.required = false
130131
}
131132
}
132133

@@ -159,7 +160,8 @@ application {
159160

160161
sonarqube {
161162
properties {
162-
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml"
163+
property "sonar.sourceEncoding", "UTF-8"
164+
property "sonar.coverage.jacoco.xmlReportPaths", layout.buildDirectory.file("reports/jacoco/test/jacocoTestReport.xml").get().asFile
163165
property "sonar.cpd.exclusions", "**/*DTO.java"
164166
}
165167
}

web-ui/build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ sourceSets {
6969

7070
sonarqube {
7171
properties {
72+
property "sonar.sourceEncoding", "UTF-8"
7273
property "sonar.sources", "src/"
7374
property "sonar.exclusions", "**/*.stories.js,**/*.test.js,**/*.spec.js,**/*.stories.jsx,**/*.test.jsx,**/*.spec.jsx"
7475
property "sonar.coverage.exclusions", "**/*.stories.js,**/*.test.js,**/*.spec.js,**/*.stories.jsx,**/*.test.jsx,**/*.spec.jsx"
75-
property "sonar.javascript.lcov.reportPaths", "coverage/lcov.info"
76+
property "sonar.javascript.lcov.reportPaths", layout.projectDirectory.file("coverage/coverage-final.json").getAsFile()
7677
}
7778
}
7879

0 commit comments

Comments
 (0)