-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (119 loc) · 4.04 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
configure(allprojects) { project ->
group = 'party.threebody.skean'
ext.versions = [
//lang
java : '1.8',
groovy : '2.4.11',
servlet : '4.0.0',
//apache commons
'commons-lang' : '2.6',
'commons-lang3' : '3.7',
'commons-collections' : '3.2.2',
'commons-collections4': '4.1',
'commons-io' : '2.5',
'commons-logging' : '1.2',
'commons-beanutils' : '1.9.3',
'commons-codec' : '1.10',
'commons-net' : '3.6',
//logging
'log4j' : '1.2.17',
'log4j2' : '2.8.2',
'logback' : '1.2.3',
'slf4j' : '1.7.25',
//spring
'spring' : '5.0.3.RELEASE',
'spring-security' : '5.0.1.RELEASE',
'spring-boot' : '2.0.0.RC1',
//others
'guava' : '21.0',
'jackson' : '2.9.4',
'ehcache' : '3.3.1',
'junit' : '4.12',
//data
'mariadb-java-client' : '2.2.1',
'HikariCP' : '2.7.7',
'h2' : '1.4.196'
]
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://repo.spring.io/milestone/' }
mavenCentral()
jcenter()
}
apply plugin: 'jacoco'
}
configure(subprojects) { project ->
dependencies {
}
apply plugin: 'java'
apply plugin: 'idea'
compileJava {
sourceCompatibility = versions.java
targetCompatibility = versions.java
options.encoding = 'UTF-8'
options.compilerArgs += '-parameters'
}
compileTestJava {
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
sourceCompatibility = versions.java
targetCompatibility = versions.java
options.encoding = 'UTF-8'
options.compilerArgs += "-parameters"
}
apply plugin: 'maven-publish'
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
}
}
}
if (project.plugins.hasPlugin('groovy')) {
compileGroovy {
options.encoding = 'UTF-8'
}
compileTestGroovy {
options.encoding = 'UTF-8'
}
}
jacocoTestReport {
additionalSourceDirs = files(sourceSets.main.allSource.srcDirs)
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
classDirectories = files(sourceSets.main.output)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
}
// see https://gist.github.com/aalmiray/e6f54aa4b3803be0bcac
// see https://docs.gradle.org/current/userguide/jacoco_plugin.html
// see https://docs.gradle.org/current/dsl/org.gradle.testing.jacoco.tasks.JacocoReport.html
task rootJacocoReport(type: JacocoReport) {
dependsOn = subprojects.test
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(subprojects.sourceSets.main.output)
def executionData0 = files(subprojects.jacocoTestReport.executionData)
executionData = files(executionData0.findAll { it.exists()})
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
onlyIf = {
true
}
}
// see: https://goo.gl/gthmv8
task rootTestReport(type: TestReport) {
destinationDir = file("$buildDir/reports/allTests")
reportOn subprojects.collect { it.tasks.withType(Test) }
}