101 lines
3.2 KiB
Kotlin
101 lines
3.2 KiB
Kotlin
import org.gradle.kotlin.dsl.accessors.runtime.extensionOf
|
|
import org.quiltmc.quiltmappings.loom.QuiltMappingsOnLoomPlugin
|
|
|
|
plugins {
|
|
id("fabric-loom")
|
|
val kotlinVersion: String by System.getProperties()
|
|
kotlin("jvm").version(kotlinVersion)
|
|
id("org.quiltmc.quilt-mappings-on-loom").version("3.1.1")
|
|
}
|
|
|
|
base {
|
|
val archivesBaseName: String by project
|
|
archivesName.set(archivesBaseName)
|
|
}
|
|
|
|
val modVersion: String by project
|
|
version = modVersion
|
|
val mavenGroup: String by project
|
|
group = mavenGroup
|
|
|
|
minecraft {}
|
|
|
|
repositories {}
|
|
|
|
dependencies {
|
|
val minecraftVersion: String by project
|
|
minecraft("com.mojang:minecraft:$minecraftVersion")
|
|
|
|
val USE_QUILT_MAPPINGS = false
|
|
if (USE_QUILT_MAPPINGS) {
|
|
// Seems to crash on startup right now
|
|
|
|
val quiltMappings: String by project
|
|
mappings(loom.layered {
|
|
officialMojangMappings {
|
|
nameSyntheticMembers = false
|
|
}
|
|
|
|
val qm = extensionOf(project, "quiltMappings") as QuiltMappingsOnLoomPlugin.QuiltMappingsOnLoomExtension
|
|
addLayer(qm.mappings("org.quiltmc:quilt-mappings:${quiltMappings}:v2"))
|
|
})
|
|
} else {
|
|
val yarnMappings: String by project
|
|
mappings("net.fabricmc:yarn:$yarnMappings:v2")
|
|
}
|
|
|
|
val loaderVersion: String by project
|
|
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
|
|
val fabricVersion: String by project
|
|
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricVersion")
|
|
val fabricKotlinVersion: String by project
|
|
modImplementation("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion")
|
|
|
|
val imguiVersion = "1.86.2"
|
|
implementation("io.github.spair:imgui-java-binding:$imguiVersion")
|
|
implementation("io.github.spair:imgui-java-lwjgl3:$imguiVersion") {
|
|
exclude(group = "org.lwjgl")
|
|
}
|
|
implementation("io.github.spair:imgui-java-natives-windows-ft:$imguiVersion")
|
|
|
|
runtimeOnly("org.joml:joml:1.10.2")
|
|
runtimeOnly("org.anarres:jcpp:1.4.14")
|
|
modRuntimeOnly(files("vendor/iris-mc1.18.1-1.2.0-pre.jar"))
|
|
modRuntimeOnly(files("vendor/sodium-fabric-mc1.18.1-0.4.0-alpha6+build.14.jar"))
|
|
}
|
|
|
|
tasks {
|
|
val javaVersion = JavaVersion.VERSION_17
|
|
|
|
withType<JavaCompile> {
|
|
options.encoding = "UTF-8"
|
|
sourceCompatibility = javaVersion.toString()
|
|
targetCompatibility = javaVersion.toString()
|
|
options.release.set(javaVersion.toString().toInt())
|
|
}
|
|
|
|
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
|
kotlinOptions {
|
|
jvmTarget = javaVersion.toString()
|
|
freeCompilerArgs = freeCompilerArgs + listOf("-Xopt-in=kotlin.RequiresOptIn")
|
|
}
|
|
|
|
sourceCompatibility = javaVersion.toString()
|
|
targetCompatibility = javaVersion.toString()
|
|
}
|
|
|
|
jar { from("LICENSE") { rename { "${it}_${base.archivesName}" } } }
|
|
|
|
processResources {
|
|
inputs.property("version", project.version)
|
|
filesMatching("fabric.mod.json") { expand(mutableMapOf("version" to project.version)) }
|
|
}
|
|
|
|
java {
|
|
toolchain { languageVersion.set(JavaLanguageVersion.of(javaVersion.toString())) }
|
|
sourceCompatibility = javaVersion
|
|
targetCompatibility = javaVersion
|
|
withSourcesJar()
|
|
}
|
|
}
|