-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (103 loc) · 3.13 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
plugins {
id 'java'
id "org.springframework.boot" version "2.1.3.RELEASE"
id "org.sonarqube" version "2.7"
id 'com.avast.gradle.docker-compose' version "0.8.14"
id "com.github.spotbugs" version "1.6.10"
id "com.github.ksoichiro.console.reporter" version "0.6.2"
id "com.adarshr.test-logger" version "1.6.0"
id "net.rdrei.android.buildtimetracker" version "0.11.0"
// id "info.solidsoft.pitest" version "1.4.0" not supported by junit5, but passes (see builds pre junit5 implementation)
id 'checkstyle'
id 'jacoco'
id 'pmd'
id 'eclipse'
id 'idea'
id "io.freefair.lombok" version "3.1.0"
id "com.bmuschko.docker-spring-boot-application" version "4.5.0"
}
apply plugin: 'pmd'
apply plugin: 'com.github.spotbugs'
apply plugin: 'io.spring.dependency-management'
apply from: './config/gradle/tasks.gradle'
apply from: './config/gradle/code-quality.gradle'
apply from: './config/gradle/docker-compose.gradle'
apply from: './config/gradle/dependencies.gradle'
group = 'de.propra2'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
idea {
project {
languageLevel = '1.8'
}
}
repositories {
jcenter()
}
gradle.taskGraph.whenReady { graph ->
println("Checking folder structure..")
def proc = "./scripts/init.sh".execute()
proc.waitForProcessOutput(System.out, System.err)
}
Properties localBootRunProperties() {
Properties p = new Properties()
p.load(new FileInputStream(
file(project.projectDir).absolutePath + "/src/main/resources/application-dev.properties"))
return p
}
Properties localTestProperties() {
Properties p = new Properties()
p.load(new FileInputStream(
file(project.projectDir).absolutePath + "/src/main/resources/application-test.properties"))
return p
}
bootRun {
doFirst {
classpath = sourceSets.main.runtimeClasspath + configurations.developmentOnly
bootRun.systemProperties = localBootRunProperties()
}
}
test {
doFirst {
test.systemProperties = localTestProperties()
}
}
javadoc {
source = sourceSets.main.allJava
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
group = "verification"
reports {
xml.enabled = false
html.enabled = true
}
}
sonarqube {
properties {
property "sonar.sourceEncoding", "UTF-8"
}
}
test {
useJUnitPlatform {
// includeEngines 'junit-jupiter', 'junit-vintage'
// excludeEngines 'custom-engine'
// includeTags 'fast'
excludeTags 'slow'
}
testLogging {
events "passed", "skipped", "failed"
}
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
outputs.upToDateWhen { false } // this forces to always rerun all tests, even if task status was
// already successful (and cached) in the past. TODO(quicklink) force-test-rerun-switch
}
test.finalizedBy jacocoTestReport
check.dependsOn('jacocoTestCoverageVerification', 'reportCoverage')