-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
80 lines (66 loc) · 1.74 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.shadow)
}
val baseVersion = "0.0.1"
val commitHash = System.getenv("COMMIT_HASH")
val snapshotversion = "${baseVersion}-dev.$commitHash"
allprojects {
group = "app.simplecloud.plugin"
version = if (commitHash != null) snapshotversion else baseVersion
repositories {
mavenCentral()
mavenLocal()
maven {
url = uri("https://repo.papermc.io/repository/maven-public/")
}
maven("https://buf.build/gen/maven")
maven("https://repo.simplecloud.app/snapshots")
}
}
subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "com.gradleup.shadow")
dependencies {
testImplementation(rootProject.libs.kotlin.test)
implementation(rootProject.libs.kotlin.jvm)
}
kotlin {
jvmToolchain(21)
}
tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
withType<JavaCompile> {
options.encoding = "UTF-8"
}
named("shadowJar", ShadowJar::class) {
mergeServiceFiles()
archiveFileName.set("${project.name}.jar")
}
processResources {
expand(
"version" to project.version,
"name" to project.name
)
}
}
}
tasks.processResources {
expand(
"version" to project.version,
"name" to project.name
)
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(21)
}