forked from Netflix/genie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
226 lines (188 loc) · 6.23 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
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
buildscript {
repositories {
jcenter()
maven {
url 'http://repo.spring.io/milestone'
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.7.RELEASE")
classpath("io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.3")
classpath("gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:1.4.11")
}
}
plugins {
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'nebula.netflixoss' version '3.2.3'
id 'nebula.optional-base' version '3.0.3'
id 'nebula.provided-base' version '3.0.3'
}
ext.githubProjectName = rootProject.name
allprojects {
apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'eclipse'
repositories {
jcenter()
maven {
url 'http://repo.spring.io/milestone'
}
}
}
idea {
project {
jdkName = '1.8'
languageLevel = '1.8'
vcs = 'Git'
}
}
subprojects {
apply plugin: 'nebula.netflixoss'
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'nebula.optional-base'
apply plugin: 'nebula.provided-base'
apply plugin: 'com.gorylenko.gradle-git-properties'
apply plugin: 'groovy'
group = "com.netflix.${githubProjectName}"
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:2.0.7.RELEASE'
// mavenBom 'org.springframework.cloud:spring-cloud-starter-parent:Brixton.RC1'
}
}
ext {
generatedSourcesDir = new File("${projectDir}/src/generated")
generatedSourcesJavaDir = new File(generatedSourcesDir, "/java")
}
sourceSets {
main {
java {
srcDir generatedSourcesJavaDir
}
}
}
clean {
delete "${projectDir}/genie-db"
delete "${projectDir}/data"
delete generatedSourcesDir.toString()
}
configurations {
all*.exclude group: "javax.servlet", module: "servlet-api"
}
dependencies {
/*******************************
* Compile Dependencies
*******************************/
/*******************************
* Provided Dependencies
*******************************/
provided("org.projectlombok:lombok")
provided("com.google.code.findbugs:annotations:${findbugs_annotations_version}")
/*******************************
* Runtime Dependencies
*******************************/
/*******************************
* Test Dependencies
*******************************/
testCompile("org.springframework.boot:spring-boot-starter-test")
testRuntime("javax.el:javax.el-api")
testRuntime("org.glassfish:javax.el")
testCompile 'org.spockframework:spock-core'
testCompile 'org.spockframework:spock-spring'
testCompile("cglib:cglib-nodep:${cglib_nodep_version}")
}
task unitTests(type: Test, group: 'verification') {
useJUnit {
includeCategories 'com.netflix.genie.test.categories.UnitTest'
excludeCategories 'com.netflix.genie.test.categories.IntegrationTest'
excludeCategories 'com.netflix.genie.test.categories.DocumentationTest'
}
}
task integrationTests(type: Test, group: 'verification') {
useJUnit {
includeCategories 'com.netflix.genie.test.categories.IntegrationTest'
excludeCategories 'com.netflix.genie.test.categories.UnitTest'
excludeCategories 'com.netflix.genie.test.categories.DocumentationTest'
}
}
task documentationTests(type: Test, group: 'verification') {
useJUnit {
includeCategories 'com.netflix.genie.test.categories.DocumentationTest'
excludeCategories 'com.netflix.genie.test.categories.UnitTest'
excludeCategories 'com.netflix.genie.test.categories.IntegrationTest'
}
}
tasks.withType(Test) { task ->
// set heap size for the test JVM(s)
minHeapSize = "256m"
maxHeapSize = "2g"
// If the project is running on a CI server
if (System.getenv("CI") != null) {
systemProperty "CI", System.getenv("CI")
}
reports.html.destination = file("${reporting.baseDir}/test/${task.name}")
jacocoTestReport.executionData += files("$buildDir/jacoco/${task.name}.exec")
}
license {
excludes(["${projectDir}/src/generated/*"])
}
checkstyle {
toolVersion = '6.11'
configFile = new File(project.parent.projectDir, "codequality/checkstyle/checkstyle.xml")
}
findbugs {
excludeFilter = new File(project.parent.projectDir, "codequality/findbugs/excludeFilter.xml")
}
tasks.withType(Pmd) {
reports.html.enabled true
}
jacocoTestReport {
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
}
task clean(type: Delete) {
delete 'build'
}
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
group = 'Coverage Reports'
dependsOn subprojects.test
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(subprojects.sourceSets.main.output)
executionData = files(subprojects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
}
onlyIf = {
true
}
doFirst {
executionData = files(executionData.findAll {
it.exists()
})
}
}
coveralls {
sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}
tasks.coveralls {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'
dependsOn jacocoRootReport
onlyIf {
System.env.'CI'
}
}