-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
195 lines (153 loc) · 7 KB
/
build.gradle.kts
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
plugins {
java
groovy
jacoco
id("org.springframework.boot") version "3.3.5"
id("io.spring.dependency-management") version "1.1.6"
id("com.netflix.dgs.codegen") version "6.3.0"
id("com.google.cloud.tools.jib") version "3.4.4"
id("org.shipkit.shipkit-changelog") version "2.0.1"
id("org.shipkit.shipkit-github-release") version "2.0.1"
id("org.shipkit.shipkit-auto-version") version "2.1.0"
}
group = "com.petrmacek"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
extra["netflixDgsVersion"] = "9.1.2"
extra["springModulithVersion"] = "1.2.4"
extra["spockBomVersion"] = "2.4-M4-groovy-4.0"
extra["axonVersion"] = "4.10.1"
extra["axonReactorVersion"] = "4.10.0"
extra["googleProtobufVersion"] = "4.28.2"
extra["mapstructVersion"] = "1.6.2"
dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-neo4j")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework:spring-aspects")
implementation("com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter")
implementation("com.netflix.graphql.dgs:graphql-dgs-extended-scalars")
implementation("org.springframework.boot:spring-boot-starter-websocket")
implementation("name.nkonev.multipart-spring-graphql:multipart-spring-graphql:1.+")
implementation("com.netflix.graphql.dgs:graphql-dgs-spring-boot-micrometer")
implementation("org.springframework.modulith:spring-modulith-starter-core")
// https://mvnrepository.com/artifact/org.axonframework/axon-spring-boot-starter
implementation("org.axonframework:axon-spring-boot-starter:${property("axonVersion")}")
// https://mvnrepository.com/artifact/org.axonframework.extensions.mongo/axon-mongo
implementation("org.axonframework:axon-tracing-opentelemetry:${property("axonVersion")}")
// https://mvnrepository.com/artifact/org.axonframework.extensions.mongo/axon-mongo
// implementation("org.axonframework.extensions.mongo:axon-mongo:${property("axonVersion")}")
// implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
// https://mvnrepository.com/artifact/org.axonframework/axon-micrometer
implementation("org.axonframework:axon-micrometer:${property("axonVersion")}")
implementation("org.axonframework.extensions.reactor:axon-reactor-spring-boot-starter:${property("axonReactorVersion")}")
// https://mvnrepository.com/artifact/org.mapstruct/mapstruct
implementation("org.mapstruct:mapstruct:${property("mapstructVersion")}")
// https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus
implementation("io.micrometer:micrometer-registry-prometheus:1.14.1")
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
implementation("com.google.protobuf:protobuf-java:3.23.4")
implementation("org.liquibase:liquibase-core")
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
annotationProcessor("org.mapstruct:mapstruct-processor:${property("mapstructVersion")}")
annotationProcessor("org.projectlombok:lombok-mapstruct-binding:0.2.0")
testAnnotationProcessor("org.mapstruct:mapstruct-processor:${property("mapstructVersion")}")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter-test")
testImplementation("org.springframework.modulith:spring-modulith-starter-test")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// https://mvnrepository.com/artifact/org.neo4j.test/neo4j-harness
testImplementation("org.neo4j.test:neo4j-harness:5.25.1")
testImplementation("org.springframework.boot:spring-boot-starter-webflux")
testImplementation("org.testcontainers:spock")
testImplementation("org.spockframework:spock-core")
testImplementation("org.spockframework:spock-spring")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.boot:spring-boot-starter-data-neo4j")
testImplementation("org.testcontainers:testcontainers")
testImplementation("com.squareup.okhttp3:mockwebserver")
testImplementation("com.squareup.okhttp3:okhttp")
testImplementation("org.axonframework:axon-test:${property("axonVersion")}")
testImplementation("ch.qos.logback:logback-classic:1.5.12")
testImplementation("org.slf4j:slf4j-api:2.0.16")
testImplementation("io.projectreactor:reactor-test")
}
dependencyManagement {
imports {
mavenBom("org.springframework.modulith:spring-modulith-bom:${property("springModulithVersion")}")
mavenBom("com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:${property("netflixDgsVersion")}")
mavenBom(("org.spockframework:spock-bom:${property("spockBomVersion")}"))
}
}
tasks.withType<com.netflix.graphql.dgs.codegen.gradle.GenerateJavaTask> {
generateClientv2 = true
packageName = "com.petrmacek.cragdb.generated"
}
tasks.withType<Test> {
useJUnitPlatform()
}
jib {
from {
image = "eclipse-temurin:21" // Use your desired base image
}
to {
image = "petrmac/crag-db:${project.version}" // Target image
auth {
username = System.getenv("DOCKER_REGISTRY_USER") ?: ""
password = System.getenv("DOCKER_REGISTRY_PASSWORD") ?: ""
}
}
container {
jvmFlags = listOf("-Xms512m", "-Xmx1024m")
ports = listOf("3000") // Expose container ports
environment = mapOf("ENV" to "production")
}
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
csv.required.set(false)
html.required.set(true)
}
}
afterEvaluate {
tasks.jacocoTestReport {
classDirectories.setFrom(
fileTree("build/classes/java/main") {
exclude("**/excluded/package/**") // Adjust exclusions as needed
}
)
sourceDirectories.setFrom(files("src/main/java"))
executionData.setFrom(
fileTree(layout.buildDirectory.dir("jacoco")) {
include("**/test.exec")
}
)
}
}
tasks.named("generateChangelog", org.shipkit.changelog.GenerateChangelogTask::class) {
// Load version properties from shipkit-auto-version
previousRevision = project.findProperty("shipkit-auto-version.previous-tag").toString()
githubToken = System.getenv("PERSONAL_GITHUB_TOKEN")
repository = "petrmac/crag-db"
}
tasks.named("githubRelease", org.shipkit.github.release.GithubReleaseTask::class) {
dependsOn("generateChangelog")
newTagRevision = "main"
githubToken = System.getenv("PERSONAL_GITHUB_TOKEN")
repository = "petrmac/crag-db"
changelog = tasks.named("generateChangelog").get().outputs.files.singleFile
}