-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
258 lines (219 loc) · 8.21 KB
/
Copy pathbuild.gradle
File metadata and controls
258 lines (219 loc) · 8.21 KB
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
buildscript {
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.4'
classpath 'de.undercouch:gradle-download-task:5.5.0'
}
}
plugins {
id 'java'
id 'com.google.protobuf' version '0.9.4'
id 'idea'
id 'maven-publish'
}
def ENV = System.getenv()
repositories {
mavenCentral()
}
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xlint:deprecation', '-Xlint:unchecked']
}
group = 'io.trogonstack'
version = '0.0.1' // x-release-please-version
java {
withSourcesJar()
withJavadocJar()
}
artifacts {
archives javadocJar
archives sourcesJar
}
configurations {
exposedRuntime {
canBeResolved = false
canBeConsumed = true
}
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.reactivestreams:reactive-streams:${reactiveStreamsApiVersion}"
implementation "javax.annotation:javax.annotation-api:${annotationApiVersion}"
implementation "javax.validation:validation-api:${validationApiVersion}"
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
implementation 'com.google.errorprone:error_prone_annotations:2.23.0'
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "com.google.api.grpc:grpc-google-common-protos:2.61.3"
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
implementation "org.slf4j:slf4j-api:2.0.17"
implementation "org.bouncycastle:bcprov-jdk18on:1.80"
implementation "org.bouncycastle:bcpkix-jdk18on:1.80"
implementation platform("io.opentelemetry:opentelemetry-bom:${openTelemetryVersion}")
implementation "io.opentelemetry:opentelemetry-api"
implementation "io.opentelemetry.semconv:opentelemetry-semconv:${openTelemetrySemConvVersion}"
implementation "io.opentelemetry.semconv:opentelemetry-semconv-incubating:${openTelemetrySemConvVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
testImplementation "org.junit.platform:junit-platform-suite:1.10.0"
testImplementation 'org.junit-pioneer:junit-pioneer:1.9.1'
testImplementation 'io.reactivex.rxjava3:rxjava:3.1.8'
testImplementation "org.reactivestreams:reactive-streams-tck:${reactiveStreamsApiVersion}"
testImplementation "org.testcontainers:testcontainers:${testcontainersVersion}"
testImplementation platform("com.fasterxml.jackson:jackson-bom:${jacksonVersion}")
testImplementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
testImplementation "com.github.javafaker:javafaker:1.0.2"
testImplementation 'org.slf4j:slf4j-simple:2.0.17'
testImplementation "io.opentelemetry:opentelemetry-sdk"
testImplementation "io.opentelemetry:opentelemetry-sdk-testing"
testImplementation "io.opentelemetry:opentelemetry-exporter-logging"
testImplementation "io.opentelemetry:opentelemetry-exporter-otlp"
}
tasks.withType(Test).configureEach {
testLogging {
events "PASSED", "SKIPPED", "FAILED"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
showStandardStreams = true
}
}
tasks.register("generateCertificates", Exec) {
description = "Generates SSL certificates to start a secured TrogonEventStore server"
commandLine 'docker', 'compose', '--file', './configure-tls-for-tests.yml', 'up'
}
tasks.register("generateUserCertificates", Exec) {
description = "Generates X.509 certificates for Plugins tests"
commandLine 'docker', 'compose', '--file', './configure-user-certs-for-tests.yml', 'up'
}
tasks.register("startDockerCompose", Exec) {
description = "Starts the TrogonEventStore cluster"
commandLine 'docker', 'compose', '--file', './docker-compose.yml', 'up', '-d'
}
tasks.register("stopDockerCompose", Exec) {
description = "Stops the TrogonEventStore cluster"
commandLine 'docker', 'compose', '--file', './docker-compose.yml', 'down'
}
tasks.register("miscTests", Test) {
useJUnitPlatform {
include("**/MiscTests.class")
}
}
tasks.register("singleNodeTests", Test) {
useJUnitPlatform {
include("**/StreamsTests.class")
include("**/PersistentSubscriptionsTests.class")
include("**/TelemetryTests.class")
include("**/ConnectionShutdownTests.class")
}
}
tasks.register("secureNodeTests", Test) {
dependsOn generateCertificates
environment "SECURE", "true"
useJUnitPlatform {
include("**/StreamsTests.class")
include("**/PersistentSubscriptionsTests.class")
}
}
tasks.register("clusterTests", Test) {
dependsOn startDockerCompose
finalizedBy stopDockerCompose
environment "SECURE", "true"
environment "CLUSTER", "true"
useJUnitPlatform {
include("**/StreamsTests.class")
include("**/PersistentSubscriptionsTests.class")
include("**/ConnectionShutdownTests.class")
}
}
tasks.register("pluginsTests", Test) {
dependsOn generateCertificates
dependsOn generateUserCertificates
environment "SECURE", "true"
useJUnitPlatform {
include("**/PluginsTests.class")
}
}
tasks.register("ci", Test) {
useJUnitPlatform()
}
test {
dependsOn miscTests, singleNodeTests, secureNodeTests, clusterTests
}
protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
plugins {
// Optional: an artifact spec for a protoc plugin, with "grpc" as
// the identifier, which can be referred to in the "plugins"
// container of the "generateProtoTasks" closure.
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
ofSourceSet('main')*.plugins {
// Apply the "grpc" plugin whose spec is defined above, without
// options. Note the braces cannot be omitted, otherwise the
// plugin will not be added. This is because of the implicit way
// NamedDomainObjectContainer binds the methods.
grpc {}
}
}
}
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
failOnError = false
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'io.trogonstack'
artifactId = 'trogon-eventstore-client'
from components.java
pom {
name = 'TrogonEventStore Java Client'
description = 'Java client for TrogonEventStore'
url = 'https://github.com/TrogonStack/TrogonEventStore-Client-Java'
scm {
connection = 'scm:git:https://github.com/TrogonStack/TrogonEventStore-Client-Java.git'
developerConnection = 'scm:git:ssh://git@github.com/TrogonStack/TrogonEventStore-Client-Java.git'
url = 'https://github.com/TrogonStack/TrogonEventStore-Client-Java'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'straw-hat-team'
name = 'Straw Hat, LLC'
}
}
}
}
}
repositories {
maven {
name = 'GitHubPackages'
url = uri('https://maven.pkg.github.com/TrogonStack/TrogonEventStore-Client-Java')
credentials {
username = ENV.GITHUB_ACTOR
password = ENV.GITHUB_TOKEN
}
}
}
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
if (!JavaVersion.current().isJava8Compatible()) {
throw new Exception("Java 8 or newer is required to build TrogonEventStore-Client-Java")
}