109 lines
3.5 KiB
Kotlin
109 lines
3.5 KiB
Kotlin
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 {
|
|
mavenCentral()
|
|
}
|
|
|
|
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/libs/lwjgl-util.jar"))
|
|
implementation(files("vendor/libs/minecraft_authenticator-2.0.1.jar"))
|
|
|
|
implementation("org.jetbrains.exposed:exposed-core:0.37.3")
|
|
implementation("org.jetbrains.exposed:exposed-dao:0.37.3")
|
|
implementation("org.jetbrains.exposed:exposed-jdbc:0.37.3")
|
|
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
|
|
|
|
runtimeOnly("org.joml:joml:1.10.4")
|
|
runtimeOnly("org.anarres:jcpp:1.4.14")
|
|
|
|
modImplementation(files("vendor/mods/baritone-unoptimized-fabric-1.8.2.jar"))
|
|
modImplementation(files("vendor/mods/iris-mc1.18.1-1.2.0-pre.jar"))
|
|
modImplementation(files("vendor/mods/sodium-fabric-mc1.18.1-0.4.0-alpha6+build.14.jar"))
|
|
modRuntimeOnly(files("vendor/mods/lazydfu-0.1.2.jar"))
|
|
}
|
|
|
|
loom {
|
|
accessWidenerPath.set(file("src/main/resources/hibiscus.accesswidener"))
|
|
}
|
|
|
|
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()
|
|
}
|
|
}
|