2024-06-03 21:50:52 +02:00
|
|
|
import net.fabricmc.loom.task.RemapJarTask
|
|
|
|
|
|
|
|
plugins {
|
2024-09-12 17:45:21 +02:00
|
|
|
bluemap.implementation
|
|
|
|
bluemap.modrinth
|
|
|
|
bluemap.curseforge
|
|
|
|
alias ( libs.plugins.loom )
|
2024-06-03 21:50:52 +02:00
|
|
|
}
|
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
val supportedMinecraftVersions = listOf(
|
2024-09-12 22:09:03 +02:00
|
|
|
"1.21", "1.21.1"
|
2024-09-12 17:45:21 +02:00
|
|
|
)
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
val minecraftVersion = supportedMinecraftVersions.first()
|
|
|
|
val yarnMappings = "${minecraftVersion}+build.1"
|
|
|
|
val fabricLoaderVersion = "0.15.11"
|
|
|
|
val fabricApiVersion = "0.100.1+${minecraftVersion}"
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
val shadowInclude: Configuration by configurations.creating
|
|
|
|
configurations.api.get().extendsFrom(shadowInclude)
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
dependencies {
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
shadowInclude ( project( ":common" ) ) {
|
|
|
|
exclude ( group = "com.google.code.gson", module = "gson" )
|
|
|
|
exclude ( group = "com.mojang", module = "brigadier" )
|
|
|
|
}
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
minecraft ("com.mojang:minecraft:${minecraftVersion}")
|
|
|
|
mappings ("net.fabricmc:yarn:${yarnMappings}")
|
|
|
|
modImplementation ("net.fabricmc:fabric-loader:${fabricLoaderVersion}")
|
|
|
|
modImplementation ("net.fabricmc.fabric-api:fabric-api:${fabricApiVersion}")
|
|
|
|
modImplementation( libs.fabric.permissions )
|
|
|
|
|
|
|
|
// jarInJar
|
|
|
|
include ( libs.flow.math )
|
2024-06-03 21:50:52 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
tasks.shadowJar {
|
|
|
|
configurations = listOf(shadowInclude)
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
// exclude jarInJar
|
|
|
|
dependencies {
|
|
|
|
exclude( dependency ( libs.flow.math.get() ) )
|
|
|
|
}
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
// airlift
|
|
|
|
relocate ("io.airlift", "de.bluecolored.shadow.airlift")
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
// bluenbt
|
|
|
|
relocate ("de.bluecolored.bluenbt", "de.bluecolored.shadow.bluenbt")
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
// caffeine
|
|
|
|
relocate ("com.github.benmanes.caffeine", "de.bluecolored.shadow.caffeine")
|
|
|
|
relocate ("org.checkerframework", "de.bluecolored.shadow.checkerframework")
|
|
|
|
relocate ("com.google.errorprone", "de.bluecolored.shadow.errorprone")
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
// dbcp2
|
|
|
|
relocate ("org.apache.commons", "de.bluecolored.shadow.apache.commons")
|
2024-06-03 21:50:52 +02:00
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
// configurate
|
|
|
|
relocate ("org.spongepowered.configurate", "de.bluecolored.shadow.configurate")
|
|
|
|
relocate ("com.typesafe.config", "de.bluecolored.shadow.typesafe.config")
|
|
|
|
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
|
|
|
|
|
|
|
|
// lz4
|
|
|
|
relocate ("net.jpountz", "de.bluecolored.shadow.jpountz")
|
|
|
|
|
|
|
|
// bstats
|
|
|
|
relocate ("org.bstats", "de.bluecolored.shadow.bstats")
|
2024-06-03 21:50:52 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
tasks.withType(ProcessResources::class).configureEach {
|
|
|
|
val replacements = mapOf(
|
|
|
|
"version" to project.version,
|
|
|
|
"fabric_loader_version" to fabricLoaderVersion,
|
|
|
|
"minecraft_version" to minecraftVersion,
|
|
|
|
"java_version" to java.toolchain.languageVersion.get()
|
|
|
|
)
|
|
|
|
inputs.properties(replacements)
|
|
|
|
filesMatching(listOf(
|
|
|
|
"fabric.mod.json",
|
|
|
|
)) { expand(replacements) }
|
2024-06-03 21:50:52 +02:00
|
|
|
}
|
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
val remappedShadowJar = tasks.register("remappedShadowJar", type = RemapJarTask::class) {
|
|
|
|
dependsOn (tasks.shadowJar)
|
|
|
|
archiveFileName = "${project.name}-${project.version}-shadow-remapped.jar"
|
|
|
|
inputFile = tasks.shadowJar.flatMap { it.archiveFile }
|
|
|
|
addNestedDependencies = true
|
2024-06-03 21:50:52 +02:00
|
|
|
}
|
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
tasks.getByName<CopyFileTask>("release") {
|
|
|
|
dependsOn(remappedShadowJar)
|
|
|
|
inputFile = remappedShadowJar.flatMap { it.archiveFile }
|
2024-06-03 21:50:52 +02:00
|
|
|
}
|
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
modrinth {
|
|
|
|
gameVersions.addAll(supportedMinecraftVersions)
|
|
|
|
dependencies { required.project("P7dR8mSH") } // Fabric API
|
2024-06-03 21:50:52 +02:00
|
|
|
}
|
|
|
|
|
2024-09-12 17:45:21 +02:00
|
|
|
curseforgeBlueMap {
|
|
|
|
addGameVersion("Fabric")
|
|
|
|
addGameVersion("Java ${java.toolchain.languageVersion.get()}")
|
|
|
|
supportedMinecraftVersions.forEach {
|
|
|
|
addGameVersion(it)
|
|
|
|
}
|
2024-06-03 21:50:52 +02:00
|
|
|
}
|