-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
242 lines (214 loc) · 9.19 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/*
* Copyright (C) 2017 ikb4stream team
* ikb4stream is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* ikb4stream is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
plugins {
id "net.saliman.cobertura" version "2.4.0"
}
group 'com.waves.ikb4stream'
version '1.0-SNAPSHOT'
apply plugin: 'java'
/***********************************************************************************************************************
* Gradle build file for IKB4Stream Project
*
* The project is separated in multiple modules, each module have his
* build file. All buildfile are located in /gradle folder. Don't forget
* to add all new modules to "packageAll" & "generateJavadoc" tasks and
* "test" sourceSets.
**********************************************************************************************************************/
// core
apply from: 'gradle/core.gradle'
// communications
apply from: 'gradle/communication_kafka.gradle'
apply from: 'gradle/communication_web.gradle'
// datasource
apply from: 'gradle/datasource_facebook.gradle'
apply from: 'gradle/datasource_facebookmock.gradle'
apply from: 'gradle/datasource_owm.gradle'
apply from: 'gradle/datasource_rss.gradle'
apply from: 'gradle/datasource_rss_mock.gradle'
apply from: 'gradle/datasource_twitter.gradle'
apply from: 'gradle/datasource_twittermock.gradle'
// scoring
apply from: 'gradle/scoring_event.gradle'
apply from: 'gradle/scoring_mock.gradle'
apply from: 'gradle/scoring_owm.gradle'
apply from: 'gradle/scoring_twitter.gradle'
sourceCompatibility = 1.8
sourceSets {
consumer {
java {
srcDirs = ['src/core', 'src/consumer']
compileClasspath += core.compileClasspath + core.output
}
}
producer {
java {
srcDirs = ['src/core', 'src/producer']
compileClasspath += core.compileClasspath + core.output
}
}
test {
java {
srcDirs = ['src/core',
'src/consumer',
'src/producer',
'src/test/',
'src/datasource',
'src/scoring',
'src/communication/web',
'src/datasource/rss',
'src/datasource/rssmock',
'src/communication/kafka',
'src/datasource/twitter',
'src/datasource/twittermock',
'src/datasource/owm',
'src/datasource/facebook',
'src/communication/web',
'src/scoring/twitter',
'src/scoring/owm',
'src/scoring/mock',
'src/scoring/event',
'src/datasource/facebookmock']
compileClasspath +=
core.compileClasspath + core.output +
consumer.compileClasspath + consumer.output +
producer.compileClasspath + producer.output +
communicationKafka.compileClasspath + communicationKafka.output +
datasourceRSS.compileClasspath + datasourceRSS.output +
datasourceRSSmock.compileClasspath + datasourceRSSmock.output +
datasourceTwittermock.compileClasspath + datasourceTwittermock.output +
datasourceFacebookmock.compileClasspath + datasourceFacebookmock.output +
datasourceTwitter.compileClasspath + datasourceTwitter.output +
datasourceFacebook.output + datasourceFacebook.compileClasspath +
datasourceOWM.output + datasourceOWM.compileClasspath +
communicationWeb.output + communicationWeb.compileClasspath +
scoringOWM.compileClasspath + scoringOWM.output +
scoringTwitter.compileClasspath + scoringTwitter.output +
scoringMock.compileClasspath + scoringMock.output
runtimeClasspath = output + compileClasspath + runtimeClasspath
}
}
}
task generateJavadoc(type: Javadoc) {
source += sourceSets.core.allJava +
sourceSets.consumer.allJava +
sourceSets.producer.allJava +
sourceSets.communicationKafka.allJava +
sourceSets.datasourceRSS.allJava +
sourceSets.datasourceRSSmock.allJava +
sourceSets.datasourceTwittermock.allJava +
sourceSets.datasourceFacebookmock.allJava +
sourceSets.datasourceTwitter.allJava +
sourceSets.datasourceFacebook.allJava +
sourceSets.datasourceOWM.allJava +
sourceSets.communicationWeb.allJava +
sourceSets.scoringOWM.allJava +
sourceSets.scoringTwitter.allJava +
sourceSets.scoringMock.allJava +
sourceSets.scoringEvent.allJava
classpath += sourceSets.core.compileClasspath +
sourceSets.consumer.compileClasspath +
sourceSets.producer.compileClasspath +
sourceSets.communicationKafka.compileClasspath +
sourceSets.datasourceRSS.compileClasspath +
sourceSets.datasourceRSSmock.compileClasspath +
sourceSets.datasourceTwittermock.compileClasspath +
sourceSets.datasourceFacebookmock.compileClasspath +
sourceSets.datasourceTwitter.compileClasspath +
sourceSets.datasourceFacebook.compileClasspath +
sourceSets.datasourceOWM.compileClasspath +
sourceSets.communicationWeb.compileClasspath +
sourceSets.scoringOWM.compileClasspath +
sourceSets.scoringTwitter.compileClasspath +
sourceSets.scoringMock.compileClasspath +
sourceSets.scoringEvent.compileClasspath
destinationDir = file("${buildDir}/docs/javadoc")
options.memberLevel = JavadocMemberLevel.PRIVATE
options.author = true
options.version = true
println (title == null? '<null>' : title)
}
task packageConsumerJar(type: Jar, description: 'Package the Consumer Jar') {
archiveName = "ikb4stream-$version-consumer.jar"
manifest {
attributes 'Main-Class': 'com.waves_rsp.ikb4stream.consumer.Main'
}
from 'resources/logback.xml'
from 'resources/logback.properties'
from sourceSets.consumer.output
from { configurations.coreCompile.collect { it.isDirectory() ? it : zipTree(it) } }
from { configurations.consumerCompile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task packageProducerJar(type: Jar, description: 'Package the Producer Jar') {
archiveName = "ikb4stream-$version-producer.jar"
manifest {
attributes 'Main-Class': 'com.waves_rsp.ikb4stream.producer.Main'
}
from 'resources/logback.xml'
from 'resources/logback.properties'
from sourceSets.producer.output
from { configurations.coreCompile.collect { it.isDirectory() ? it : zipTree(it) } }
from { configurations.producerCompile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task copyConfigProperties(type: Copy) {
from 'resources/'
into 'build/libs/resources/'
exclude('**/*.ttl', '**/logback.xml', '**/logback.properties')
}
task zipBuild(type: Zip) {
classifier = 'all'
from 'build/libs'
}
task packageAll(dependsOn: ['copyConfigProperties',
'packageConsumerJar',
'packageProducerJar',
'packageRssJar',
'packageRssmockJar',
'packageKafkaCommunicationJar',
'packageTwitterJar',
'packageFacebookJar',
'packageOwmJar',
'packageCommunicationWebJar',
'packageEventScoringJar',
'packageTwitterScoringJar',
'packageTwitterMockJar',
'packageFacebookMockJar',
'packageOWMScoringJar',
'packageMockScoringJar']) { }
task ci(dependsOn: ['packageAll', 'zipBuild']) {
tasks.findByName('zipBuild').mustRunAfter 'packageAll'
}
task testAll(type: Test) {
testClassesDir = sourceSets.test.output.classesDir
classpath = sourceSets.test.runtimeClasspath
}
cobertura {
coverageDirs = [file("build")]
coverageSourceDirs = [file("src/communication"),file("src/consumer"),file("src/producer"),file("src/core")]
coverageFormats = ['html', 'xml']
}
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.11'
}
configurations.all {
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "log4j", module: "log4j"
}