-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
177 lines (148 loc) · 5.07 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
plugins {
id 'application'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java'
id 'maven-publish'
id 'com.diffplug.spotless' version '6.25.0'
}
sourceCompatibility=21
targetCompatibility=21
publishing {
publications {
maven(MavenPublication) {
groupId = group
artifactId = 'littlehorse-server'
version = version
from components.java
}
}
}
repositories {
mavenCentral()
maven {
url = uri("https://packages.confluent.io/maven/")
}
}
dependencies {
// Use JUnit Jupiter for testing.
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'org.junit-pioneer:junit-pioneer:2.0.0'
testImplementation 'org.mockito:mockito-core:5.11.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.11.0'
testImplementation 'net.datafaker:datafaker:1.9.0'
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
// Logging
implementation 'org.slf4j:slf4j-api:2.0.7'
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.20.0'
// Stuff for Kafka
implementation "org.apache.kafka:kafka-clients:${kafkaVersion}"
implementation "org.apache.kafka:kafka-streams:${kafkaVersion}"
testImplementation "org.apache.kafka:kafka-streams-test-utils:${kafkaVersion}"
// Auth
implementation 'com.nimbusds:oauth2-oidc-sdk:11.20.1'
// Utils
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'commons-io:commons-io:2.13.0'
implementation 'com.google.guava:guava:32.0.1-jre'
// gRPC and Protobuf now included in lh-sdk
implementation project(':sdk-java')
// Prometheus
implementation 'io.micrometer:micrometer-registry-prometheus:1.11.2'
implementation 'io.javalin:javalin:6.3.0'
// Lombok stuff
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testImplementation project(":test-utils")
// JSON and YAML processing
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.2'
implementation 'com.jayway.jsonpath:json-path:2.9.0'
testImplementation 'org.awaitility:awaitility:4.2.0'
testImplementation 'org.junit.platform:junit-platform-console-standalone:1.11.0-M2'
implementation group: 'com.cronutils', name: 'cron-utils', version: '9.2.1'
}
application {
// Define the main class for the application.
mainClass = 'io.littlehorse.App'
executableDir = 'server'
}
compileJava {
options.compilerArgs << '-parameters'
}
shadowJar {
mergeServiceFiles()
}
test {
useJUnitPlatform()
filter {
includeTestsMatching "io.littlehorse.**"
excludeTestsMatching "e2e.**"
}
testLogging {
events 'passed', 'skipped', 'failed'
exceptionFormat = 'full'
}
jvmArgs = ['--add-opens', 'java.base/java.lang=ALL-UNNAMED', '--add-opens', 'java.base/java.util=ALL-UNNAMED']
}
task e2e(type: Test, dependsOn: compileJava){
useJUnitPlatform()
filter {
includeTestsMatching "e2e.**"
excludeTestsMatching "io.littlehorse.**"
}
testLogging {
events 'passed', 'skipped', 'failed'
exceptionFormat = 'full'
}
jvmArgs = ['--add-opens', 'java.base/java.lang=ALL-UNNAMED', '-Xms8192m', '-Xmx8192m', '-Xss2m', '-XX:+UseParallelGC', '--add-opens', 'java.base/java.util=ALL-UNNAMED']
// // Enables parallelism on the e2e tests
// maxParallelForks = 2
// systemProperty "junit.jupiter.execution.parallel.enabled", "true"
}
spotless {
java {
target('**/*.java')
targetExclude('**/proto/*.java')
palantirJavaFormat()
}
}
task testJar(type: Jar) {
from sourceSets.test.output
archiveClassifier.set('tests')
description = 'Assembles a jar archive containing the test classes.'
group = 'build'
manifest {
attributes(
'Class-Path': configurations.testRuntimeClasspath.files.collect { it.name }.join(' '),
'Main-Class': 'org.junit.platform.console.ConsoleLauncher'
)
}
dependsOn configurations.testRuntimeClasspath
from {
configurations.testRuntimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy(DuplicatesStrategy.INCLUDE)
}
task staticVersion {
doFirst {
def outputDir = file("$buildDir/generated/sources/version");
def versionClass = new File(outputDir, "io/littlehorse/server/ServerVersion.java");
versionClass.parentFile.mkdirs();
versionClass.text = """package io.littlehorse.server;
public class ServerVersion {
public static final String VERSION = "${project.version}";
}
"""
}
}
sourceSets {
main {
java {
srcDir("$buildDir/generated/sources/version")
}
}
}
compileJava.dependsOn staticVersion