-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
219 lines (185 loc) · 5.4 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
// Declare external dependencies for the build script itself.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-docker-plugin:2.6.8'
}
}
plugins {
id 'groovy'
id 'idea'
id 'application'
id 'checkstyle'
id 'findbugs'
id 'pmd'
id 'jacoco'
id 'net.researchgate.release' version '2.3.4'
id 'com.jfrog.bintray' version '1.6'
}
apply plugin: 'com.bmuschko.docker-remote-api'
apply from: "$rootDir/gradle/versioning.gradle"
group = 'be.pixxis'
mainClassName = 'be.pixxis.zoufzouf.LogSlurper'
sourceCompatibility = 1.8
configurations {
integrationCompile.extendsFrom testCompile
integrationRuntime.extendsFrom testRuntime
}
task wrapper(type: Wrapper) {
description = 'bootstrap the gradle wrapper'
gradleVersion = '2.12'
}
idea {
project {
languageLevel = '1.8'
}
}
compileJava {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
checkstyle {
toolVersion = '6.17'
showViolations = false
ignoreFailures = false
}
pmd {
toolVersion = '5.4.1'
ignoreFailures = false
}
tasks.withType(Pmd) {
reports {
xml.enabled = false
html.enabled = true
}
}
findbugs {
toolVersion = '3.0.1'
ignoreFailures = false
effort = 'max'
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
sourceSets {
integration {
groovy {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration/groovy')
}
resources.srcDir file('src/integration/resources')
}
}
test {
minHeapSize = '128m'
maxHeapSize = '256m'
forkEvery = 5
def forks = Runtime.runtime.availableProcessors() / 2
maxParallelForks = forks < 1 ? 1 : forks
testLogging {
events 'started', 'passed', 'skipped', 'failed'
exceptionFormat = 'full'
}
reports.html.destination = file("$reports.html.destination/unit")
reports.junitXml.destination = file("$reports.junitXml.destination/unit")
}
task integrationTest(type: Test) {
description = "Run integration tests (located in src/intTest/...)."
testClassesDir = sourceSets.integration.output.classesDir
classpath = sourceSets.integration.runtimeClasspath
outputs.upToDateWhen { false }
reports.html.destination = file("$reports.html.destination/integration")
reports.junitXml.destination = file("$reports.junitXml.destination/integration")
}
check.dependsOn integrationTest
jacoco {
toolVersion = "0.7.6.201602180812"
}
jacocoTestReport {
group = "reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.enabled true
html.enabled true
csv.enabled false
}
}
task createBuildInfoFile << {
def buildInfoFile = new File("$buildDir/build-info.properties")
Properties props = new Properties()
props.setProperty('version', project.version.toString())
props.setProperty('timestamp', project.buildTimestamp)
props.store(buildInfoFile.newWriter(), null)
}
jar {
dependsOn createBuildInfoFile
from(buildDir) {
include 'build-info.properties'
}
manifest {
attributes 'Implementation-Title': 'ZoufZouf, a multithreaded CloudFront log analyzer',
'Implementation-Version': version,
'Main-Class': 'be.pixxis.zoufzouf.LogSlurper'
}
}
processResources {
exclude '**/properties.yml'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile 'org.yaml:snakeyaml:1.17'
// Logging
compile 'ch.qos.logback:logback-classic:1.1.7'
compile 'org.slf4j:slf4j-api:1.7.21'
// jclouds
compile 'org.apache.jclouds.provider:aws-s3:1.9.2'
compile 'org.apache.jclouds.api:filesystem:1.9.2'
// Java Concurrency in Practice
compile 'net.jcip:jcip-annotations:1.0'
// Joda Time
compile 'joda-time:joda-time:2.9.4'
// Java Mail
compile 'javax.mail:mail:1.4.7'
// MongoDB
compile 'org.mongodb:mongo-java-driver:3.3.0'
compile 'org.mongojack:mongojack:2.6.1'
compile "com.google.code.findbugs:findbugs:3.0.1"
// Spock testing depencies
compile 'org.codehaus.groovy:groovy-all:2.4.7'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile "org.hamcrest:hamcrest-core:1.3" // only necessary if Hamcrest matchers are used
testRuntime "cglib:cglib-nodep:3.2.4"
// allows mocking of classes (in addition to interfaces)
testRuntime "org.objenesis:objenesis:2.4"
// allows mocking of classes without default constructor (together with CGLIB)
}
distributions {
version = null
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['archives']
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
pkg {
repo = 'generic'
name = 'zoufzouf'
licenses = ['MIT']
vcsUrl = 'https://github.com/glnds/zoufzouf.git'
desc = 'Multithreaded AWS CloudFront log Analyser '
githubRepo = 'glnds/zoufzouf' //Optional Github repository
githubReleaseNotesFile = 'README.md' //Optional Github readme file
version {
name = project.version //Bintray logical version name
}
}
}