-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
121 lines (97 loc) · 2.61 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
buildscript {
ext {
springBootVersion = '1.3.3.RELEASE'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath('com.github.jengelman.gradle.plugins:shadow:1.2.3')
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
sourceCompatibility = 1.8
allprojects {
group = 'com.nobita'
version = '0.0.1-SNAPSHOT'
apply plugin: 'java'
}
repositories {
mavenCentral()
}
subprojects {
apply plugin: 'maven'
apply plugin: 'findbugs'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
repositories {
mavenCentral()
jcenter()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.powermock:powermock-module-junit4:1.6.4'
testCompile 'org.powermock:powermock-api-mockito:1.6.4'
}
task deps(type: DependencyReportTask) {
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
task testsJar(type: Jar, dependsOn: classes) {
classifier = 'tests'
from sourceSets.test.output
}
artifacts {
archives testsJar
}
findbugs {
effort = 'max'
reportLevel = 'high'
ignoreFailures = true
excludeFilter = file("${rootProject.projectDir}/findbugs-exclude.xml")
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
jacocoTestReport {
// exclude classes generated by Immutables
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/Immutable*'])
})
}
}
// "./gradlew check" runs jacocoTestReport
check.dependsOn('jacocoTestReport')
checkstyle {
configFile = rootProject.file('checkstyle.xml')
toolVersion = '6.14.1'
ignoreFailures = true
}
}
task stage {
dependsOn build
}
task wrapper(type: Wrapper) {
gradleVersion = '2.11'
}
project(':api') {
apply plugin: 'com.github.johnrengelman.shadow'
}
task app(dependsOn: ':api:shadowJar') << {
println "> executable jar is assembled at ${project('api').buildDir}/libs/api-${project.version}-all.jar"
}