-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
170 lines (140 loc) · 4.17 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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id "com.github.spotbugs" version "4.5.1"
}
apply plugin: 'application'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'com.github.spotbugs'
apply plugin: 'eclipse'
sourceCompatibility = "1.11"
targetCompatibility = "1.11"
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
allprojects {
repositories {
jcenter()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url 'https://packages.confluent.io/maven/'
}
}
}
sourceSets {
intTest {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
configurations {
intTestImplementation.extendsFrom implementation
intTestImplementation.canBeResolved = true // enable eclipse to have dependencies at classpath
intTestRuntimeOnly.extendsFrom runtimeOnly
}
dependencies {
implementation('org.industrial-devops:titan-ccp-common:0.1.0-SNAPSHOT') { changing = true }
implementation('org.industrial-devops:titan-ccp-common-kafka:0.1.0-SNAPSHOT') { changing = true }
implementation('org.industrial-devops:titan-ccp-common-cassandra:0.0.2-SNAPSHOT') { changing = true }
implementation 'org.apache.kafka:kafka-streams:2.3.0'
implementation 'com.sparkjava:spark-core:2.7.2'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.guava:guava:23.0'
implementation 'net.jodah:failsafe:1.1.0'
implementation 'org.apache.commons:commons-configuration2:2.2'
implementation 'commons-beanutils:commons-beanutils:1.9.2' // for commons-configuration2
implementation 'org.apache.commons:commons-lang3:3.7'
implementation 'org.slf4j:slf4j-simple:1.7.25'
testImplementation 'junit:junit:4.13'
intTestImplementation 'junit:junit:4.13'
intTestImplementation 'org.testcontainers:cassandra:1.14.3'
}
mainClassName = mainClass
distTar{
archiveFileName = rootProject.name + '.tar'
}
// Replace values in the application.properties file
import org.apache.tools.ant.filters.*
processResources {
filter ReplaceTokens, tokens: [
"application.name": rootProject.name,
"application.version": version
]
}
task integrationTest(type: Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath
shouldRunAfter test
}
check.dependsOn integrationTest
pmd {
ruleSets = [] // Gradle requires to clean the rule sets first
ruleSetFiles = files("config/pmd.xml")
ignoreFailures = false
toolVersion = "6.7.0"
}
checkstyle {
configDirectory = file("config")
configFile = file("config/checkstyle.xml")
maxWarnings = 0
ignoreFailures = false
toolVersion = "8.12"
}
spotbugs {
excludeFilter = file("config/spotbugs-exclude-filter.xml")
reportLevel = "low"
effort = "max"
ignoreFailures = false
toolVersion = '4.1.3'
}
// Allow code flaws in the integration Test
spotbugsIntTest {
ignoreFailures = true
}
// Per default XML reports for SpotBugs are generated
// Include this to generate HTML reports
tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
reports {
// Either HTML or XML reports can be activated
html.enabled true
xml.enabled false
}
}
task checkstyle {
group 'Quality Assurance'
description 'Run Checkstyle'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task pmd {
group 'Quality Assurance'
description 'Run PMD'
dependsOn 'pmdMain'
dependsOn 'pmdTest'
}
task spotbugs {
group 'Quality Assurance'
description 'Run SpotBugs'
dependsOn 'spotbugsMain'
dependsOn 'spotbugsTest'
dependsOn 'spotbugsIntTest'
}
eclipse {
classpath {
downloadSources=true
downloadJavadoc=true
plusConfigurations.add configurations.intTestImplementation
plusConfigurations.add configurations.intTestRuntime
}
}