@@ -4,21 +4,17 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
44buildscript {
55 repositories {
66 mavenCentral()
7- jcenter()
8- }
9- dependencies {
10- classpath ' org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.3'
117 }
128}
139
1410plugins {
15- id " org.sonarqube" version " 3.1.1"
11+ id " org.sonarqube" version " 3.1.1"
12+ id " com.github.nbaztec.coveralls-jacoco" version " 1.2.12"
1613}
1714
1815repositories {
1916 // https://stackoverflow.com/questions/36029754/force-gradle-to-use-http-instead-of-https
2017 // https://discuss.gradle.org/t/how-to-change-gradle-plugin-portal-from-https-to-http/10847/12
21- jcenter()
2218 mavenLocal()
2319 mavenCentral()
2420}
@@ -32,7 +28,6 @@ ext.log4jVersion = '2.14.1'
3228apply plugin : ' java'
3329apply plugin : ' eclipse'
3430apply plugin : ' application'
35- apply plugin : ' com.github.kt3k.coveralls'
3631
3732// https://stackoverflow.com/questions/46233314/gradle-android-jacoco-and-junit5
3833apply plugin : ' jacoco'
@@ -151,8 +146,16 @@ afterEvaluate {
151146 }
152147
153148 check. dependsOn jacocoJupTestReport
149+
150+ coverallsJacoco {
151+ def jacocoJupTestReportTask = project. tasks. getByName(' jacocoJupTestReport' )
152+ reportPath = " ${ buildDir} /reports/jacoco/report.xml"
153+ reportSourceSets = files(jacocoJupTestReportTask. sourceDirectories. collect{ it. listFiles() }. flatten())
154+ }
154155}
155156
157+ // https://github.com/ben-manes/caffeine/blob/master/build.gradle
158+
156159// https://github.com/codeclimate/test-reporter/issues/243
157160// task jacocoFixForCodeClimate(type: Copy) {
158161// from 'build/reports/jacoco/report.xml'
@@ -163,11 +166,6 @@ afterEvaluate {
163166// filter { line -> line.replaceAll("com/", "webapp/src/main/java/com/") }
164167// }
165168
166- // https://github.com/ben-manes/caffeine/blob/master/build.gradle
167- coveralls {
168- jacocoReportPath = " ${ buildDir} /reports/jacoco/report.xml"
169- }
170-
171169// https://stackoverflow.com/questions/3963708/gradle-how-to-display-test-results-in-the-console-in-real-time
172170tasks. withType(Test ) {
173171 testLogging {
0 commit comments