-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
58 lines (49 loc) · 1.5 KB
/
build.gradle.kts
File metadata and controls
58 lines (49 loc) · 1.5 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
import com.palantir.gradle.gitversion.VersionDetails
import java.util.Date
plugins {
kotlin("jvm") version "2.3.0"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.palantir.git-version") version "4.2.0"
application
}
group = "io.github.lmfs.box"
version = "1.0.0"
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
implementation(kotlin("reflect"))
implementation("org.fusesource.jansi:jansi:2.4.2")
implementation("com.github.ajalt.clikt:clikt:5.0.3")
implementation("org.jline:jline:3.30.6")
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(21)
}
val versionDetails: groovy.lang.Closure<VersionDetails> by extra
tasks.withType<ProcessResources> {
val resourceTargets = listOf(
"META-INF/lmfsbox.properties",
"META-INF/lmfsbox.license.txt",
"META-INF/lmfsbox.copyright.txt"
)
val replaceProperties = mapOf<String, Any?>(
"gradle" to gradle,
"project" to project,
"date" to Date(),
"building" to "Gradle v${gradle.gradleVersion} (JavaToolchain ${java.toolchain.languageVersion.get()}) ${System.getProperty("os.arch").uppercase()}",
"licenseText" to rootProject.file("LICENSE").readText(),
"copyrightText" to rootProject.file("COPYRIGHT").readText(),
"gitVersion" to versionDetails()
)
filesMatching(resourceTargets) {
expand(replaceProperties)
}
}
application {
mainClass.set("io.github.lmfs.box.LMFSBoxKt")
}