-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
113 lines (96 loc) · 3.96 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
113 lines (96 loc) · 3.96 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
import com.github.gradle.node.npm.task.NpmTask
plugins {
id("io.ktor.plugin") version "3.5.2"
id("com.github.node-gradle.node") version "7.1.0"
id("org.jlleitschuh.gradle.ktlint") version "14.2.0"
id("org.jetbrains.kotlin.jvm") version "2.3.21"
id("org.jetbrains.kotlin.plugin.serialization") version "2.3.21"
id("com.github.autostyle") version "4.0.1"
id("com.avast.gradle.docker-compose") version "0.17.21"
}
application {
group = "com.lunatech"
version = "0.0.1"
mainClass = "io.ktor.server.netty.EngineMain"
}
sourceSets {
main {
java.srcDirs("src/main")
}
test {
java.srcDirs("src/test")
// Reuse the local dev Keycloak realm as a test fixture
resources.srcDir("dockerdev/keycloak")
}
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
implementation("ch.qos.logback:logback-classic:1.6.3")
implementation("com.newrelic.logging:logback:3.5.0")
implementation("org.apache.logging.log4j:log4j-core:2.26.1")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.22.1")
implementation("io.github.config4k:config4k:0.7.0")
implementation("org.flywaydb:flyway-core:13.0.0")
implementation("org.flywaydb:flyway-database-postgresql:13.0.0")
implementation("org.ktorm:ktorm-core:4.2.1")
implementation("com.zaxxer:HikariCP:7.1.0")
implementation("org.postgresql:postgresql:42.7.13")
implementation("org.quartz-scheduler:quartz:2.5.2")
implementation("io.ktor:ktor-server-status-pages")
implementation("io.ktor:ktor-server-default-headers")
implementation("io.ktor:ktor-server-cors")
implementation("io.ktor:ktor-server-content-negotiation-jvm")
implementation("io.ktor:ktor-server-netty-jvm")
implementation("io.ktor:ktor-server-core-jvm")
implementation("io.ktor:ktor-server-host-common-jvm")
implementation("io.ktor:ktor-server-auth")
implementation("io.ktor:ktor-server-auth-jwt")
implementation("io.ktor:ktor-server-sessions-jvm")
implementation("io.ktor:ktor-client-apache-jvm")
implementation("io.ktor:ktor-serialization-jackson")
implementation("org.apache.poi:poi-ooxml:5.5.1")
implementation("io.ktor:ktor-client-core-jvm")
implementation("io.ktor:ktor-client-logging-jvm")
implementation("org.simplejavamail:simple-java-mail:9.3.2")
testImplementation("io.ktor:ktor-server-test-host")
testImplementation("io.ktor:ktor-client-content-negotiation")
testImplementation("io.ktor:ktor-client-mock")
testImplementation("org.junit.jupiter:junit-jupiter:6.1.3")
testImplementation("org.testcontainers:testcontainers:2.0.5")
testImplementation("org.testcontainers:testcontainers-junit-jupiter:2.0.5")
testImplementation("org.testcontainers:testcontainers-postgresql:2.0.5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.1.3")
}
tasks.test {
useJUnitPlatform()
// Required for Testcontainers with Colima
environment("TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE", "/var/run/docker.sock")
}
tasks.register("buildAll") {
dependsOn(tasks.assemble, buildFrontApp)
}
// Local development only. Clever Cloud deploys with "gradle run" (see clevercloud/gradle.json),
// so the run task itself must never depend on Docker Compose.
dockerCompose {
// Use the standalone docker-compose binary, which both Docker Desktop and podman setups provide
useDockerComposeV2 = false
}
tasks.register("devRun") {
group = "application"
description = "Starts Postgres and Keycloak via Docker Compose, then runs the application"
dependsOn("composeUp", tasks.named("run"))
}
tasks.named("run") {
mustRunAfter("composeUp")
}
val buildFrontApp by tasks.registering(NpmTask::class) {
dependsOn(installReactApp)
args = listOf("run", "build", "--prefix", "./frontend/")
}
val installReactApp by tasks.registering(NpmTask::class) {
args = listOf("ci", "--prefix", "./frontend/")
}