-
-
Notifications
You must be signed in to change notification settings - Fork 56
/
build.gradle
169 lines (142 loc) · 5.56 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
168
169
plugins {
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'nebula.optional-base' version '5.0.2'
}
allprojects {
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'jacoco'
apply plugin: 'nebula.optional-base'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
}
ext {
springBootVersion = System.getenv("SPRING_BOOT_VERSION")
springVersion = System.getenv("SPRING_VERSION")
springDataVersion = System.getenv("SPRING_DATA_VERSION")
microMeterVersion = System.getenv("MICROMETER_VERSION")
// springBootVersion = '2.1.0.RELEASE'
// springVersion = '5.1.2.RELEASE'
// springDataVersion = '2.1.2.RELEASE'
// microMeterVersion = '1.1.0'
// logging dependencies
lombokVersion = '1.18.10'
logbackVersion = '1.2.3'
sl4jVersion = '1.7.28'
// testing
junitVersion = '4.12'
mockitoVersion = '3.1.0'
hamcrestVersion = '2.2'
powerMockVersion = '2.0.5'
jacocoVersion = '0.8.4'
embeddedRedisVersion = '0.7.2'
h2Version = '1.4.194'
tomcatVersion = '8.0.47'
// utility
lang3Version = '3.9'
jacksonVersion = '2.10.0'
// server
javaxServletVersion = '4.0.1'
twigVersion = '5.87.0.RELEASE'
// database
lettuceVersion = '5.2.0.RELEASE'
javaxAnnotationVersion = '1.3.2'
jpaVersion = '2.2'
hibernateVersion = '5.4.9.Final'
// other dependencies
javaxValidationApiVersion = '2.0.1.Final'
}
subprojects {
group = 'com.github.sonus21'
version = '2.0.4-RELEASE'
dependencies {
// https://mvnrepository.com/artifact/org.springframework/spring-messaging
compile group: 'org.springframework', name: 'spring-messaging', version: "${springVersion}"
// https://mvnrepository.com/artifact/org.springframework.data/spring-data-redis
compile group: 'org.springframework.data', name: 'spring-data-redis', version: "${springDataVersion}"
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompile "org.projectlombok:lombok:${lombokVersion}"
testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
// https://mvnrepository.com/artifact/ch.qos.logback/logback-core
testCompile group: 'ch.qos.logback', name: 'logback-core', version: "${logbackVersion}"
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: "${logbackVersion}"
testCompile group: 'junit', name: 'junit', version: "${junitVersion}"
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testCompile group: 'org.mockito', name: 'mockito-core', version: "${mockitoVersion}"
// https://mvnrepository.com/artifact/org.hamcrest/hamcrest-library
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: "${hamcrestVersion}"
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
testCompile group: 'org.apache.commons', name: 'commons-lang3', version: "${lang3Version}"
testCompile("org.springframework.boot:spring-boot-test:${springBootVersion}")
// https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: "${powerMockVersion}"
// https://mvnrepository.com/artifact/org.powermock/powermock-api-mockito2
testCompile group: 'org.powermock', name: 'powermock-api-mockito2', version: "${powerMockVersion}"
configurations {
all*.exclude module: 'spring-boot-starter-logging'
}
}
}
def publishedProjects = subprojects.findAll({ subproject ->
subproject.pluginManager.hasPlugin('java') && !subproject.name.endsWith("example") && !subproject.name.contains("test")
})
task jacocoMerge(type: JacocoMerge) {
publishedProjects.each { subproject ->
executionData subproject.tasks.withType(Test)
}
doFirst {
executionData = files(executionData.findAll { it.exists() })
}
}
task codeCoverageReport(type: JacocoReport, group: 'verification', description: 'Generate code coverage report') {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
publishedProjects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
xml.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
csv.enabled false
html.enabled true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: [
'com/github/sonus21/rqueue/exception',
'com/github/sonus21/rqueue/models/response',
]
)
}))
}
test.useTestNG()
}
jacoco {
toolVersion = "${jacocoVersion}"
}
clean.doLast {
subprojects.findAll({ subproject ->
def _files = file(subproject.name + '/log').listFiles()
if (_files != null) {
delete _files
}
})
};
codeCoverageReport.dependsOn {
subprojects*.test
}
coveralls {
description = 'Uploads the aggregated coverage report to Coveralls'
sourceDirs = publishedProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}