-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
164 lines (136 loc) · 4.85 KB
/
build.gradle.kts
File metadata and controls
164 lines (136 loc) · 4.85 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
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
import io.papermc.paperweight.userdev.ReobfArtifactConfiguration
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.*
plugins {
kotlin("jvm") version "2.3.20"
`java-library`
id("io.papermc.paperweight.userdev") version "2.0.0-beta.19"
id("cc.modlabs.kpaper-gradle") version "2026.3.30.1428+kpaper.2026.3.30.1427"
kotlin("plugin.serialization") version "2.3.20"
id("maven-publish")
}
val pluginVersion: String by project
val dailyVersion = Calendar.getInstance(TimeZone.getTimeZone("Europe/Berlin")).run {
"${get(Calendar.YEAR)}.${get(Calendar.MONTH) + 1}.${get(Calendar.DAY_OF_MONTH)}"
}
group = "cc.modlabs.worldengine"
version = System.getenv("VERSION_OVERRIDE") ?: "$pluginVersion-$dailyVersion"
val minecraftVersion: String by project
val slf4jVersion: String by project
val dotenvKotlinVersion: String by project
val kotlinxCoroutinesCoreVersion: String by project
val kotlinxCollectionsImmutableVersion: String by project
val gsonVersion: String by project
val mcCoroutineVersion: String by project
repositories {
maven("https://repo-api.modlabs.cc/repo/maven/maven-mirror/")
maven("https://papermc.io/repo/repository/maven-public/")
}
paperweight {
reobfArtifactConfiguration = ReobfArtifactConfiguration.MOJANG_PRODUCTION
}
dependencies {
paperweight.paperDevBundle("$minecraftVersion-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.12.2")
}
kpaper {
javaVersion.set(21)
registrationBasePackage.set("cc.modlabs.worldengine")
deliver (
"com.github.shynixn.mccoroutine:mccoroutine-bukkit-api:$mcCoroutineVersion",
"com.github.shynixn.mccoroutine:mccoroutine-bukkit-core:$mcCoroutineVersion",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesCoreVersion",
"org.jetbrains.kotlinx:kotlinx-collections-immutable:$kotlinxCollectionsImmutableVersion",
"com.google.code.gson:gson:$gsonVersion",
"io.github.cdimascio:dotenv-kotlin:$dotenvKotlinVersion", // - .env support
"org.slf4j:slf4j-api:$slf4jVersion",
)
}
tasks.register<Jar>("sourcesJar") {
description = "Generates the sources jar for this project."
group = JavaBasePlugin.DOCUMENTATION_GROUP
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
publishing {
repositories {
maven {
name = "ModLabs"
url = uri("https://repo-api.modlabs.cc/repo/maven/maven-public/")
credentials {
username = System.getenv("NEXUS_USER") ?: "modlabs"
password = System.getenv("REPO_TOKEN")
}
}
mavenLocal()
}
publications {
create<MavenPublication>("maven") {
artifact(tasks.named("reobfJar"))
artifact(tasks.named("sourcesJar"))
pom {
name.set("WorldEngine")
description.set("World management for Paper: worlds, generators, and a small API for other plugins.")
url.set("https://github.com/ModLabsCC/WorldEngine")
licenses {
license {
name.set("MIT")
url.set("https://github.com/ModLabsCC/WorldEngine/blob/main/LICENSE")
}
}
developers {
developer {
id.set("ModLabsCC")
name.set("ModLabsCC")
email.set("contact@modlabs.cc")
}
}
scm {
connection.set("scm:git:git://github.com/ModLabsCC/WorldEngine.git")
developerConnection.set("scm:git:git@github.com:ModLabsCC/WorldEngine.git")
url.set("https://github.com/ModLabsCC/WorldEngine")
}
}
}
}
}
tasks {
withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(21)
}
withType<KotlinCompile>().configureEach {
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
}
withType<ProcessResources> {
dependsOn("generateDependenciesFile")
from(File(layout.buildDirectory.asFile.get(), "generated-resources")) {
include(".dependencies")
}
expand(
"version" to project.version,
"name" to project.name,
)
}
}
configure<SourceSetContainer> {
named("main") {
java.srcDir("src/main/kotlin")
}
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
kotlin {
jvmToolchain(21)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_2)
freeCompilerArgs.addAll(
listOf(
"-opt-in=kotlin.RequiresOptIn"
)
)
}
}