Skip to content

Commit e39a309

Browse files
committed
Make bundling the Kotlin STD optional. If built without it, https://modrinth.com/plugin/mckotlin will be used as a dependency at runtime
1 parent 28371cf commit e39a309

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

build.gradle.kts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ plugins {
1515

1616
private val VERSION = "1.2.4"
1717
private val RUN_NUMBER = System.getenv("GITHUB_RUN_NUMBER") ?: "DEV"
18+
private val BUNDLE_KOTLIN_STD = if (System.getenv("BUNDLE_KOTLIN_STD") == null) {
19+
true
20+
} else {
21+
System.getenv("BUNDLE_KOTLIN_STD").toBoolean()
22+
}
23+
24+
println(BUNDLE_KOTLIN_STD)
1825
group = "dev.echonine.kite"
19-
version = "$VERSION+$RUN_NUMBER"
26+
version = "$VERSION+$RUN_NUMBER" + if (!BUNDLE_KOTLIN_STD) "-NoSTD" else ""
2027

2128
repositories {
2229
mavenCentral()
@@ -26,7 +33,11 @@ repositories {
2633

2734
dependencies {
2835
// Kotlin Standard Library
29-
paperLibrary(kotlin("stdlib"))
36+
if (BUNDLE_KOTLIN_STD) {
37+
paperLibrary(kotlin("stdlib"))
38+
} else {
39+
compileOnly(kotlin("stdlib"))
40+
}
3041
// Runtime Dependencies
3142
paperLibrary("io.github.revxrsal:zapper.api:1.0.3")
3243
paperLibrary("dev.faststats.metrics:bukkit:0.16.0")
@@ -51,6 +62,13 @@ paper {
5162
description = "A lightweight Kotlin scripting plugin"
5263
website = "https://echonine.dev/kite/"
5364
authors = listOf("Saturn745", "Grabsky")
65+
if (!BUNDLE_KOTLIN_STD) {
66+
serverDependencies {
67+
register("MCKotlin-Paper") {
68+
required = true
69+
}
70+
}
71+
}
5472
}
5573

5674
runPaper.folia.registerTask()

0 commit comments

Comments
 (0)