-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
169 lines (143 loc) · 4.77 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id "org.sonarqube" version "2.8"
id "jacoco"
}
apply plugin: 'idea'
apply plugin: "jacoco"
apply plugin: "java"
apply plugin: "org.sonarqube"
ext {
majorVersion = '1'
minorVersion = '0'
patchVersion = '0'
baseVersion = "${majorVersion}.${minorVersion}.${patchVersion}"
}
// import all scripts from ./gradle.d in order of sequence
file('gradle.d').listFiles().sort().each {
if (it =~ /.*\.gradle$/) {
apply from: relativePath(it)
}
}
subprojects {
apply plugin: "idea"
apply plugin: "java"
apply plugin: "org.sonarqube"
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${version_spring_boot}"
classpath "org.asciidoctor:asciidoctor-gradle-plugin:1.5.3"
classpath "org.ajoberstar:gradle-git-publish:2.1.2"
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.26.0"
classpath "com.github.jacobono:gradle-jaxb-plugin:1.3.6"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
}
}
version = project.getBuildVersion(baseVersion)
sourceCompatibility = 11
targetCompatibility = 11
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled true
}
}
dependencies {
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: version_junit
testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: version_mockito_junit
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: version_junit
annotationProcessor("org.projectlombok:lombok:$lombok_version")
compileOnly("org.projectlombok:lombok:$lombok_version")
testCompile group: 'org.jacoco', name: 'org.jacoco.ant', version: '0.8.5'
}
}
idea {
project {
vcs = 'Git'
}
}
sonarqube {
properties {
property "sonar.projectKey", "adessoAG_coderadar"
property "sonar.organization", "adesso-ag"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.sources", "src/main/java, coderadar-ui/src"
property "sonar.tests", "src/test/java"
property "sonar.exclusions", "coderadar-app/workdir"
property 'sonar.core.codeCoveragePlugin', 'jacoco'
property "sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/jacoco/codeCoverageReport/codeCoverageReport.xml"
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
testCompile group: 'org.jacoco', name: 'org.jacoco.ant', version: '0.8.5'
}
}
tasks.register("codeCoverageReport", JacocoReport) {
// If a subproject applies the 'jacoco' plugin, add the result it to the report
subprojects { subproject ->
subproject.plugins.withType(JacocoPlugin).configureEach {
subproject.tasks.matching({ t -> t.extensions.findByType(JacocoTaskExtension) }).configureEach { testTask ->
sourceSets subproject.sourceSets.main
executionData(testTask)
}
// To automatically run `test` every time `./gradlew codeCoverageReport` is called,
// you may want to set up a task dependency between them as shown below.
// Note that this requires the `test` tasks to be resolved eagerly (see `forEach`) which
// may have a negative effect on the configuration time of your build.
subproject.tasks.matching({ t -> t.extensions.findByType(JacocoTaskExtension) }).forEach {
rootProject.tasks.codeCoverageReport.dependsOn(it)
}
}
}
// enable the different report types (html, xml, csv)
reports {
// xml is usually used to integrate code coverage with
// other tools like SonarQube, Coveralls or Codecov
xml.enabled true
// HTML reports can be used to see code coverage
// without any external tools
html.enabled true
}
}