-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
85 lines (70 loc) · 1.89 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
import java.nio.file.Path
import kotlin.io.path.createDirectories
import kotlin.io.path.writeText
plugins {
kotlin("jvm") version "2.0.21"
kotlin("plugin.serialization") version "2.0.21"
alias(libs.plugins.versions)
alias(libs.plugins.versions.filter)
alias(libs.plugins.versions.update)
application
}
group = "nkiesel.org"
version = "3.0.0"
repositories {
mavenCentral()
}
dependencies {
implementation(libs.clikt)
implementation(libs.clikt.markdown)
implementation(libs.kotlin.serialization)
implementation(libs.http4k.core)
implementation(libs.http4k.client.okhttp)
implementation(libs.mordant)
implementation(libs.google.cloud.secretmanager)
testImplementation(libs.junit.bom)
testImplementation(libs.junit.jupiter)
}
kotlin {
jvmToolchain(21)
}
application {
mainClass = "CertificateHelperKt"
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
tasks.register<Jar>("uberJar") {
archiveClassifier = "uber"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest { attributes(mapOf(
"Main-Class" to application.mainClass,
"Implementation-Version" to version,
)) }
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith(".jar") }.map { zipTree(it) }
}) {
exclude("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA")
}
}
val versionFile: Path = layout.buildDirectory.file("generated/version").get().asFile.toPath()
sourceSets {
main {
kotlin {
output.dir(versionFile.parent)
}
}
}
tasks.register("generateVersionProperties") {
doLast {
with(versionFile) {
parent.createDirectories()
writeText("$version")
}
}
}
tasks.named("processResources") {
dependsOn("generateVersionProperties")
}