77 lines
2.1 KiB
Kotlin
77 lines
2.1 KiB
Kotlin
plugins {
|
|
id("net.neoforged.moddev") version "2.0.80"
|
|
kotlin("jvm") version "2.0.0"
|
|
kotlin("plugin.serialization") version "2.0.0"
|
|
}
|
|
|
|
version = project.property("mod_version") as String
|
|
group = project.property("mod_group_id") as String
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven {
|
|
name = "Kotlin for Forge"
|
|
url = uri("https://thedarkcolour.github.io/KotlinForForge/")
|
|
}
|
|
}
|
|
|
|
base {
|
|
archivesName.set(project.property("mod_id") as String)
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(21))
|
|
}
|
|
}
|
|
|
|
neoForge {
|
|
version = project.property("neo_version") as String
|
|
|
|
runs {
|
|
create("server") {
|
|
server()
|
|
}
|
|
}
|
|
|
|
mods {
|
|
create(project.property("mod_id") as String) {
|
|
sourceSet(sourceSets.main.get())
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Kotlin for Forge (kotlinx-serialization 포함)
|
|
implementation("thedarkcolour:kotlinforforge-neoforge:${project.property("kotlin_for_forge_version")}")
|
|
// 외부 의존성 없음 - Java 내장 HttpServer 사용
|
|
}
|
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
|
compilerOptions {
|
|
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
|
|
}
|
|
}
|
|
|
|
tasks.withType<JavaCompile>().configureEach {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
tasks.processResources {
|
|
val replaceProperties = mapOf(
|
|
"mod_id" to project.property("mod_id"),
|
|
"mod_name" to project.property("mod_name"),
|
|
"mod_license" to project.property("mod_license"),
|
|
"mod_version" to project.property("mod_version"),
|
|
"mod_authors" to project.property("mod_authors"),
|
|
"mod_description" to "Provides server status via HTTP API",
|
|
"neo_version_range" to project.property("neo_version_range"),
|
|
"loader_version_range" to project.property("loader_version_range"),
|
|
"minecraft_version_range" to project.property("minecraft_version_range")
|
|
)
|
|
inputs.properties(replaceProperties)
|
|
|
|
filesMatching(listOf("META-INF/neoforge.mods.toml")) {
|
|
expand(replaceProperties)
|
|
}
|
|
}
|