import org.gradle.kotlin.dsl.accessors.runtime.extensionOf import org.quiltmc.quiltmappings.loom.QuiltMappingsOnLoomPlugin plugins { id("fabric-loom") id("org.quiltmc.quilt-mappings-on-loom") val kotlinVersion: String by System.getProperties() kotlin("jvm").version(kotlinVersion) } base { val archivesBaseName: String by project archivesName.set(archivesBaseName) } val modVersion: String by project version = modVersion val mavenGroup: String by project group = mavenGroup repositories {} dependencies { val minecraftVersion: String by project minecraft("com.mojang:minecraft:$minecraftVersion") 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")) }) 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") implementation(files("vendor/lwjgl-util.jar")) 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")) } loom { accessWidenerPath.set(file("src/main/resources/hibiscus.accesswidener")) } tasks { val javaVersion = JavaVersion.VERSION_17 withType { options.encoding = "UTF-8" sourceCompatibility = javaVersion.toString() targetCompatibility = javaVersion.toString() options.release.set(javaVersion.toString().toInt()) } withType { 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() } }