-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
117 lines (98 loc) · 2.73 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
plugins {
id 'java-library'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'jacoco'
id 'maven-publish'
id 'com.palantir.docker' version '0.25.0'
id 'com.palantir.docker-run' version '0.25.0'
}
ext {
springBootVersion = "2.3.5.RELEASE"
containerRegistry = "registry.gitlab.com"
containerImage = "$containerRegistry/exaucet/joblessito/$rootProject.name"
}
allprojects {
group 'com.exaucet.joblessito'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal()
}
}
subprojects {
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java-library'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:$springBootVersion")
}
}
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_10
targetCompatibility = JavaVersion.VERSION_1_10
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
systemProperty 'de.adesso.junitinsights.enabled', 'true'
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/reports/jacoco")
}
}
publishing {
publications {
"$project.name"(MavenPublication) {
from components.java
}
}
repositories {
maven {
url "https://gitlab.com/api/v4/projects/22241402/packages/maven"
name "joblessito"
credentials(HttpHeaderCredentials) {
name = 'Deploy-Token'
value = System.getenv("DeployToken")
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
}
docker {
name = "$containerImage:${version.toString().toLowerCase()}"
tag "version", "${version.toString().toLowerCase()}"
copySpec.from('boot/build').into('boot/build')
}
dockerRun {
name = "$rootProject.name"
image = "$containerImage"
ports "8080:8080"
}
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
xml.destination file("${buildDir}/reports/jacoco/jacoco.xml")
html.enabled true
html.destination file("${buildDir}/reports/jacoco")
csv.enabled false
}
}
codeCoverageReport.dependsOn {
subprojects*.test
}
test {
finalizedBy codeCoverageReport
}