-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
140 lines (115 loc) · 4.46 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
import org.springframework.boot.gradle.plugin.MainClassConvention
import org.springframework.boot.gradle.tasks.run.BootRun
import java.util.function.Supplier;
plugins {
id 'org.springframework.boot' version '2.2.5.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id 'jacoco'
id 'com.google.cloud.tools.jib' version '2.3.0'
}
group = 'de.coronavirus'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
ext {
set('springCloudVersion', "Hoxton.SR3")
set('mapStructVersion', "1.3.1.Final")
set('springfoxVersion',"2.9.2")
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.cloud:spring-cloud-gcp-starter-storage'
implementation 'com.google.cloud.sql:postgres-socket-factory:1.0.16'
//swagger
implementation "io.springfox:springfox-swagger-ui:${springfoxVersion}"
implementation "io.springfox:springfox-swagger2:${springfoxVersion}"
implementation "io.springfox:springfox-bean-validators:${springfoxVersion}"
implementation("io.springfox:springfox-swagger2:${springfoxVersion}") {
exclude module: 'mapstruct' // necessary in my case to not end up with multiple mapstruct versions
}
implementation "io.springfox:springfox-swagger-ui:${springfoxVersion}"
implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation 'org.apache.commons:commons-lang3:3.9'
implementation 'com.googlecode.perfect-hashes:perfect-hashes:1.0'
implementation 'com.google.guava:guava:28.2-jre'
implementation "org.mapstruct:mapstruct:${mapStructVersion}"
//hibernate etc
implementation 'org.hibernate:hibernate-search-orm:5.11.5.Final'
implementation 'org.hibernate:hibernate-envers:5.4.14.Final'
implementation 'org.postgresql:postgresql:42.2.11'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor "org.mapstruct:mapstruct-processor:${mapStructVersion}"
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation 'com.h2database:h2'
testAnnotationProcessor "org.mapstruct:mapstruct-processor:${mapStructVersion}"
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
jib {
jib.to.image = "eu.gcr.io/onyx-yeti-271818/imis:${System.env.GITHUB_SHA}"
}
bootJar {
archiveFileName = "imis.jar"
mainClassName = 'de.coronavirus.imis.App'
}
task generateTestData(type: Exec) {
setDescription "Generate test data to be loaded by the IMIS backend."
inputs.files fileTree(
dir: 'src/main/resources/sample_data',
includes: ['genPersons.py', 'persons/*'])
outputs.dir 'src/main/resources/sample_data/persons'
commandLine 'python3', 'genPersons.py', '-u'
workingDir 'src/main/resources/sample_data'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.enabled true
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}
compileJava {
options.compilerArgs = [
'-Amapstruct.defaultComponentModel=spring'
]
}
bootRun {}
task buildSwaggerConfig(type: BootRun) {
def swaggerOutPath = "build/resources/swagger.json"
setDescription "Generate a Swagger documentation file in JSON format (`${swaggerOutPath}`)."
outputs.file swaggerOutPath
setClasspath sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath
conventionMapping 'main', new MainClassConvention(project, {
-> sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath
})
args "--spring.profiles.active=swagger-export", '--swagger-only',
"--swagger-export=${swaggerOutPath}"
}
// >>>>> DEPENDENCY MAPPINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
tasks.bootJar.dependsOn('processResources')
tasks.buildSwaggerConfig.dependsOn(tasks.bootRun.getDependsOn())
tasks.processResources.dependsOn('generateTestData')