-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
210 lines (179 loc) · 6.38 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
// Inherited to all subprojects
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
jcenter()
}
dependencies {
classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.3"
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
}
}
// Variables used to distinct different subprojects
def useCaseProjects = subprojects.findAll {it -> it.name.matches('uc(.)*')}
def commonProjects = subprojects.findAll {it -> it.name.matches('(.)*commons(.)*')}
// Plugins
allprojects {
apply plugin: 'eclipse'
}
subprojects {
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'com.github.spotbugs'
apply plugin: 'java-library'
}
configure(useCaseProjects){
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
applicationDefaultJvmArgs = ["-Dlog4j.configuration=log4j.properties"]
}
ext {
flinkVersion = '1.11.0'
scalaBinaryVersion = '2.12'
}
// Java version for all subprojects
subprojects {
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
// Check for updates every build
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
// Repositories for all projects
allprojects {
repositories {
jcenter()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
"https://repository.apache.org/content/repositories/snapshots/"
}
mavenCentral()
}
}
// Dependencies for all use cases
configure(useCaseProjects) {
dependencies {
// These dependencies is exported to consumers, that is to say found on their compile classpath.
compile('org.industrial-devops:titan-ccp-common:0.0.4-SNAPSHOT') {
changing = true
}
api 'net.kieker-monitoring:kieker:1.14'//-SNAPSHOT'
api 'net.sourceforge.teetime:teetime:3.0'
// These dependencies are used internally, and not exposed to consumers on their own compile classpath.
implementation 'org.apache.kafka:kafka-clients:2.2.0'
implementation 'com.google.guava:guava:24.1-jre'
implementation 'org.jctools:jctools-core:2.1.1'
implementation 'org.slf4j:slf4j-simple:1.6.1'
compile project(':application-commons')
compile group: 'org.apache.kafka', name: 'kafka-clients', version: "2.2.0"
compile group: 'org.apache.flink', name: 'flink-java', version: "${flinkVersion}"
compile group: 'org.apache.flink', name: "flink-streaming-java_${scalaBinaryVersion}", version:"${flinkVersion}"
compile group: 'org.apache.flink', name: "flink-table-api-java-bridge_${scalaBinaryVersion}", version: "${flinkVersion}"
compile group: 'org.apache.flink', name: "flink-table-planner-blink_${scalaBinaryVersion}", version: "${flinkVersion}"
compile group: 'org.apache.flink', name: "flink-connector-kafka_${scalaBinaryVersion}", version: "${flinkVersion}"
compile group: 'org.industrial-devops', name: 'titan-ccp-common', version: '0.0.3-SNAPSHOT'
compile group: 'org.apache.flink', name: "flink-runtime-web_${scalaBinaryVersion}", version: "${flinkVersion}" // TODO: remove after development
compile group: 'org.apache.flink', name: "flink-statebackend-rocksdb_${scalaBinaryVersion}", version: "${flinkVersion}"
compile group: 'org.apache.flink', name: 'flink-metrics-prometheus_2.12', version: '1.11.1'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
run.classpath = sourceSets.main.runtimeClasspath
jar {
manifest {
attributes 'Built-By': System.getProperty('user.name'),
'Build-Jdk': System.getProperty('java.version')
}
}
shadowJar {
configurations = [project.configurations.compile]
zip64 true
}
}
// Dependencies for all commons
configure(commonProjects) {
dependencies {
// These dependencies is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.kafka:kafka-clients:2.2.0'
// These dependencies are used internally, and not exposed to consumers on their own compile classpath.
implementation 'org.slf4j:slf4j-simple:1.6.1'
implementation('org.industrial-devops:titan-ccp-common:0.0.4-SNAPSHOT') {
changing = true
// exclude group: 'net.kieker-monitoring', module: 'kieker'
}
compile group: 'org.apache.flink', name: "flink-connector-kafka_${scalaBinaryVersion}", version: "${flinkVersion}"
compile group: 'org.apache.flink', name: 'flink-java', version: "${flinkVersion}"
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
}
// Per default XML reports for SpotBugs are generated
// Include this to generate HTML reports
tasks.withType(com.github.spotbugs.SpotBugsTask) {
reports {
// Either HTML or XML reports can be activated
html.enabled true
xml.enabled false
}
}
// Subprojects quality tools tasks
subprojects {
task pmd {
group 'Quality Assurance'
description 'Run PMD'
dependsOn 'pmdMain'
dependsOn 'pmdTest'
}
task checkstyle {
group 'Quality Assurance'
description 'Run Checkstyle'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task spotbugs {
group 'Quality Assurance'
description 'Run SpotBugs'
dependsOn 'spotbugsMain'
dependsOn 'spotbugsTest'
}
}
// Subprojects quality tools configuration
subprojects {
pmd {
ruleSets = [] // Gradle requires to clean the rule sets first
ruleSetFiles = files("$rootProject.projectDir/config/pmd.xml")
ignoreFailures = true
toolVersion = "6.7.0"
}
checkstyle {
configDirectory = file("$rootProject.projectDir/config")
configFile = file("$rootProject.projectDir/config/checkstyle.xml")
maxWarnings = 0
ignoreFailures = true
toolVersion = "8.12"
}
spotbugs {
excludeFilter = file("$rootProject.projectDir/config/spotbugs-exclude-filter.xml")
reportLevel = "low"
effort = "max"
ignoreFailures = true
toolVersion = '3.1.7'
}
}
allprojects {
eclipse {
classpath {
downloadSources=true
downloadJavadoc=true
}
}
}