-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
176 lines (140 loc) · 5.55 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
/*
* Copyright (c) 2023-2024 Joachim Ansorg.
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import gg.jte.ContentType
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
// https://mvnrepository.com/artifact/io.ktor/ktor-client-core-jvm
val ktorVersion: String by project
plugins {
application
id("org.jetbrains.kotlin.jvm") version "2.0.20"
kotlin("plugin.serialization") version "2.0.20"
// https://github.com/johnrengelman/shadow
id("com.github.johnrengelman.shadow") version "8.1.1"
// https://plugins.gradle.org/plugin/gg.jte.gradle
id("gg.jte.gradle") version "3.1.12"
// https://github.com/gmazzo/gradle-buildconfig-plugin
id("com.github.gmazzo.buildconfig") version "5.3.5"
}
allprojects {
repositories {
mavenCentral()
}
apply {
plugin("kotlin")
plugin("org.jetbrains.kotlin.plugin.serialization")
}
kotlin {
jvmToolchain(21)
compilerOptions {
jvmTarget = JvmTarget.JVM_21
freeCompilerArgs.add("-Xdebug")
}
}
tasks {
test {
useJUnitPlatform()
}
}
dependencies {
// https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-datetime-jvm
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
// https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-serialization-json-jvm
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2")
// https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
// https://mvnrepository.com/artifact/it.unimi.dsi/fastutil-core
implementation("it.unimi.dsi:fastutil-core:8.5.14")
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
implementation("ch.qos.logback:logback-classic:1.5.6")
// https://github.com/ajalt/clikt
implementation("com.github.ajalt.clikt:clikt:4.4.0")
// https://mvnrepository.com/artifact/org.javamoney.moneta/moneta-core
implementation("org.javamoney.moneta:moneta-core:1.4.4")
// https://mvnrepository.com/artifact/org.javamoney.moneta/moneta-convert
implementation("org.javamoney.moneta:moneta-convert:1.4.4")
// https://mvnrepository.com/artifact/org.javamoney.moneta/moneta-convert-ecb
implementation("org.javamoney.moneta:moneta-convert-ecb:1.4.4")
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation("com.google.guava:guava:33.3.0-jre")
// https://mvnrepository.com/artifact/com.github.ben-manes.caffeine/caffeine
implementation("com.github.ben-manes.caffeine:caffeine:3.1.8")
// https://mvnrepository.com/artifact/dev.hsbrysk/caffeine-coroutines
implementation("dev.hsbrysk:caffeine-coroutines:1.1.0")
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.3")
}
}
project("marketplace-client") {
dependencies {
api("io.ktor:ktor-client-core:$ktorVersion")
api("io.ktor:ktor-client-java:$ktorVersion")
api("io.ktor:ktor-client-logging:$ktorVersion")
api("io.ktor:ktor-client-resources:$ktorVersion")
api("io.ktor:ktor-client-content-negotiation:$ktorVersion")
api("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
}
}
project(":marketplace-data") {
dependencies {
implementation(project(":marketplace-client"))
}
}
project(":") {
dependencies {
implementation(project(":marketplace-client"))
implementation(project(":marketplace-data"))
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-server-compression:$ktorVersion")
implementation("io.ktor:ktor-server-jte:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
// https://mvnrepository.com/artifact/gg.jte/jte
implementation("gg.jte:jte:3.1.10")
runtimeOnly(provider {
files(tasks.precompileJte.get().targetDirectory)
})
}
jte {
sourceDirectory.set(file("src/main/resources/templates").toPath())
targetDirectory.set(project.layout.buildDirectory.file("jte-classes").get().asFile.toPath())
trimControlStructures.set(true)
contentType.set(ContentType.Html)
precompile()
}
application {
mainClass.set("dev.ja.marketplace.ApplicationKt")
}
buildConfig {
className("BuildConfig")
packageName("dev.ja.marketplace")
useKotlinOutput()
buildConfigField("APP_VERSION", provider { rootDir.resolve("VERSION.txt").readText() })
}
tasks {
precompileJte {
inputs.files(fileTree("src/main/resources/templates"))
}
build {
dependsOn(precompileJte)
}
jar {
dependsOn(precompileJte)
from(fileTree(precompileJte.get().targetDirectory) {
include("**/*.class")
})
}
shadowJar {
dependsOn(precompileJte)
archiveBaseName.set("marketplace-stats-all")
archiveClassifier.set("")
archiveVersion.set("")
}
// task name run conflicts with Kotlin's run
named("run") {
dependsOn("precompileJte")
}
}
}