-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
244 lines (193 loc) · 7.08 KB
/
build.gradle
File metadata and controls
244 lines (193 loc) · 7.08 KB
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
buildscript {
ext {
springBootVersion = "2.2.4.RELEASE"
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
plugins{
id "com.github.johnrengelman.shadow" version "5.0.0"
id 'net.ltgt.apt' version '0.20'
id 'org.unbroken-dome.test-sets' version '2.2.1'
id "org.sonarqube" version "2.8"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'net.ltgt.apt-idea'
apply plugin: 'net.ltgt.apt-eclipse'
group = 'com.evergarden.cms'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven {url 'https://jitpack.io'}
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
sonarqube {
properties {
property 'sonar.coverage.jacoco.xmlReportsPath', './build/reports/jacoco/integ/, ./build/reports/jacoco/'
property 'sonar.junit.reportPaths', './build/test-results/integtest, ./build/test-results/test'
property 'sonar.sources', "src/main/"
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
finalizedBy jacocoTestReport
reports.junitXml.enabled(true)
}
/*
task integrationTestOnly(type: Test) {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
include 'integrationTest/**'
dependsOn compileTestJava
mustRunAfter test
jacoco {
include 'integrationTest/**'
// append = true
}
}
*/
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
reports {
xml.enabled = true
xml.setDestination(new File("${buildDir}/reports/jacoco/report.xml"))
}
getClassDirectories().setFrom(fileTree(dir: 'build/classes/java/main'))
getSourceDirectories().setFrom(fileTree(dir: 'scr/main/java'))
}
jar {
manifest {
attributes "Main-Class": "com.evergarden.cms.CmsApplication"
}
}
// Workaround for https://youtrack.jetbrains.com/issue/IDEA-182577
idea {
module {
sourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
testSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
generatedSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
}
}
dependencies {
// Eureka client
// compile 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
//sdk
implementation 'com.github.GostShell:sdk:v0.0.3.6-alpha'
//rxjava-jdbc
// compile 'com.github.davidmoten:rxjava2-jdbc:0.2.4'
// Reactor Adapter (RxJava2, Akka Actors scheduler and more)
compile "io.projectreactor.addons:reactor-adapter:3.2.0.RELEASE"
//data db
// compile("com.h2database:h2:1.4.197") // or developmentOnly
// jwt lib
compile 'com.auth0:java-jwt:3.6.0'
//zip library to decompress zip archive
compile group: 'net.lingala.zip4j', name: 'zip4j', version: '1.3.3'
//dev devtools
developmentOnly("org.springframework.boot:spring-boot-devtools") //runtimeOnly ??
//reactivedb no sql mongo
compile("org.springframework.boot:spring-boot-starter-data-mongodb-reactive")
//MapStruct mapper
implementation 'org.mapstruct:mapstruct:1.3.0.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.3.0.Final'
// sugar syntax and helper
compileOnly 'org.projectlombok:lombok:1.18.8'
annotationProcessor 'org.projectlombok:lombok:1.18.8'
//spring web-flux
implementation 'org.springframework.boot:spring-boot-starter-webflux'
//implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-security")
testImplementation('org.springframework.boot:spring-boot-starter-test')
//testImplementation('org.springframework.security:spring-security-test')
testImplementation('io.projectreactor:reactor-test')
testCompile('org.junit.jupiter:junit-jupiter:5.4.0')
// testContainer acceptance test
testImplementation(group: 'org.testcontainers', name: 'testcontainers', version: '1.12.4')
testCompile group: 'io.rest-assured', name: 'rest-assured', version: '4.1.2'
testCompile group: 'io.rest-assured', name: 'rest-assured-all', version: '4.1.2'
// caching
implementation 'org.springframework.boot:spring-boot-starter-cache'
compile 'org.ehcache:ehcache:3.8.1'
implementation 'javax.cache:cache-api'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
compile group: 'commons-io', name: 'commons-io', version: '2.6'
// Integrate spring shell or crash
// Use neo4j to manage taxonomy system
// Use elastic search to provide a search system embedded engine https://github.com/allegro/embedded-elasticsearch
// For caching Ehcache JSR-107 “JCache” API or see https://spring.io/guides/gs/caching/
// test integration w<ith flyway https://github.com/flyway/flyway-test-extensions/wiki/Usage-flyway-spring-test
}
sourceSets {
integtest {
compileClasspath += sourceSets.test.compileClasspath
runtimeClasspath += sourceSets.test.runtimeClasspath
java.srcDir "$projectDir/src/integrationTest/java"
resources.srcDir "$projectDir/src/test/resources"
}
}
configurations {
integtestCompile.extendsFrom testCompile
integtestImplementation.extendsFrom(testImplementaion)
integtestRuntime.extendsFrom(testRuntime)
}
task integtest(type: Test) {
useJUnitPlatform()
testClassesDirs = sourceSets.integtest.output.classesDirs
classpath = sourceSets.integtest.runtimeClasspath
dependsOn(compileJava)
jacoco {
destinationFile = file("$buildDir/jacoco/jacocoIntegTest.exec")
}
jacocoTestReport {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/jacocoIntegTest.exec")
reports.xml.enabled(true)
reports.xml.setDestination(new File("${buildDir}/reports/jacoco/integ/report.xml"))
getClassDirectories().setFrom(fileTree(dir: 'build/classes/java/main'))
getSourceDirectories().setFrom(fileTree(dir: 'scr/main/java'))
}
finalizedBy jacocoTestReport
}
check.dependsOn(integtest)
project.tasks["sonarqube"].dependsOn "integtest"
/*testSets {
integrationTest
}
tasks.withType(Test) {
useJUnitPlatform()
}
check.dependsOn integrationTest*/
// from spring initializr
// runtimeOnly('org.springframework.boot:spring-boot-devtools')
//dependencyManagement {
// imports {
// mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Finchley.SR2'
// }
//}