-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
182 lines (150 loc) · 6.27 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
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building an application
id 'application'
// Add the errorprone Gradle plugin so the checks are run during compile
id("net.ltgt.errorprone") version "0.6"
// jacoco provides coverage checks
id 'jacoco'
id "net.java.openjdk.shinyafox.jshell.gradle.plugin" version "1.0.4"
}
// Set up source set for integration testing
sourceSets {
integrationTest {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
acceptanceTest {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
configurations {
integrationTestImplementation.extendsFrom implementation
integrationTestRuntimeOnly.extendsFrom runtimeOnly
acceptanceTestImplementation.extendsFrom implementation
acceptanceTestRuntimeOnly.extendsFrom runtimeOnly
}
// Targeting Java 11
sourceCompatibility = 11
targetCompatibility = 11
// Define the main class for the application (other entry points are defined below)
mainClassName = 'net.jackw.olep.application.App'
dependencies {
// Guava for lots of utilities
compile 'com.google.guava:guava:27.0.1-jre'
// Kafka is split into several parts
compile group: 'org.apache.kafka', name: 'kafka_2.12', version: '2.1.1'
compile group: 'org.apache.kafka', name: 'kafka-streams', version: '2.1.1'
compile group: 'org.apache.kafka', name: 'kafka-clients', version: '2.1.1'
testCompile group: 'org.apache.kafka', name: 'kafka-streams-test-utils', version: '2.1.1'
// JSON/etc library
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8'
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-guava', version: '2.9.8'
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.8'
// Log4j for logging
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.11.2'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26'
compile group: 'org.slf4j', name: 'slf4j-ext', version: '1.7.26'
// Akka for the application
compile group: 'com.typesafe.akka', name: 'akka-actor_2.12', version: '2.5.21'
testCompile group: 'com.typesafe.akka', name: 'akka-testkit_2.12', version: '2.5.21'
// Chronicle map for storing data that may exceed the available memory
compile group: 'net.openhft', name: 'chronicle-map', version: '3.17.0'
// MySQL connector for comparison
compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.15'
// Expose the errorprone client library to the application
compile group: 'com.google.errorprone', name: 'error_prone_core', version: '2.3.2'
errorprone("com.google.errorprone:error_prone_core:2.3.2")
// Use JUnit test framework
testCompile 'junit:junit:4.12'
// And mockito for mocking and spying on stuff
testCompile "org.mockito:mockito-core:2.+"
// Hamcrest matchers
testCompile 'org.hamcrest:hamcrest:2.1'
testCompile 'org.hamcrest:hamcrest-junit:2.0.0.0'
// Need JUnit and hamcrest for integration tests too
integrationTestCompile 'junit:junit:4.12'
integrationTestCompile 'org.hamcrest:hamcrest:2.1'
integrationTestCompile 'org.hamcrest:hamcrest-junit:2.0.0.0'
// and acceptance tests
acceptanceTestCompile 'junit:junit:4.12'
acceptanceTestCompile 'org.hamcrest:hamcrest:2.1'
acceptanceTestCompile 'org.hamcrest:hamcrest-junit:2.0.0.0'
}
def databaseHeapSize = "7G"
jacocoTestReport {
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/olep/utils/**'
])
})
}
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
task runVerifier(type: JavaExec, dependsOn: 'classes') {
classpath = sourceSets.main.runtimeClasspath
main = "net.jackw.olep.verifier.VerifierApp"
maxHeapSize = databaseHeapSize
}
task runApplication(type: JavaExec, dependsOn: 'classes') {
classpath = sourceSets.main.runtimeClasspath
main = "net.jackw.olep.application.App"
}
task runWorker(type: JavaExec, dependsOn: 'classes') {
classpath = sourceSets.main.runtimeClasspath
main = "net.jackw.olep.worker.WorkerApp"
maxHeapSize = databaseHeapSize
}
task reset(type: JavaExec, dependsOn: 'classes') {
classpath = sourceSets.main.runtimeClasspath
main = "net.jackw.olep.utils.Resetter"
}
task runDatabase(type: JavaExec, dependsOn: 'classes') {
classpath = sourceSets.main.runtimeClasspath
main = "net.jackw.olep.utils.RunDatabase"
mustRunAfter reset
maxHeapSize = databaseHeapSize
}
task runView(type: JavaExec, dependsOn: 'classes') {
classpath = sourceSets.main.runtimeClasspath
main = "net.jackw.olep.view.ViewApp"
mustRunAfter reset
maxHeapSize = databaseHeapSize
}
task runRegistry(type: JavaExec, dependsOn: 'classes') {
classpath = sourceSets.main.runtimeClasspath
main = "net.jackw.olep.view.StandaloneRegistry"
}
task lruSetPerformanceTest(type: JavaExec, dependsOn: 'classes') {
classpath = sourceSets.main.runtimeClasspath
main = "net.jackw.olep.utils.LRUSetPerformanceTest"
}
// Integration tests task configuration
task integrationTest(type: Test) {
description = 'Runs integration tests'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
shouldRunAfter test
}
check.dependsOn integrationTest
// Acceptance tests task configuration
task acceptanceTest(type: Test) {
description = 'Runs acceptance tests'
group = 'verification'
testClassesDirs = sourceSets.acceptanceTest.output.classesDirs
classpath = sourceSets.acceptanceTest.runtimeClasspath
shouldRunAfter test, integrationTest
}
check.dependsOn acceptanceTest