Terra/platforms/fabric/build.gradle.kts
2021-03-17 21:17:15 -07:00

50 lines
1.5 KiB
Plaintext

import com.dfsek.terra.configureCommon
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.fabricmc.loom.LoomGradleExtension
import net.fabricmc.loom.task.RemapJarTask
plugins {
`java-library`
id("fabric-loom").version("0.6-SNAPSHOT")
}
configureCommon()
tasks.named<ShadowJar>("shadowJar") {
relocate("org.json", "com.dfsek.terra.lib.json")
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
}
group = "com.dfsek.terra.fabric"
dependencies {
"shadedApi"(project(":common"))
"shadedImplementation"("org.yaml:snakeyaml:1.27")
"shadedImplementation"("com.googlecode.json-simple:json-simple:1.1.1")
"minecraft"("com.mojang:minecraft:21w11a")
"mappings"("net.fabricmc:yarn:21w11a+build.3:v2")
"modImplementation"("net.fabricmc:fabric-loader:0.11.3")
"modImplementation"("net.fabricmc.fabric-api:fabric-api:0.32.4+1.17")
}
tasks.named<ShadowJar>("shadowJar") {
relocate("org.json", "com.dfsek.terra.lib.json")
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
}
configure<LoomGradleExtension> {
accessWidener("src/main/resources/terra.accesswidener")
}
tasks.register<RemapJarTask>("remapShadedJar") {
val shadowJar = tasks.getByName<ShadowJar>("shadowJar")
dependsOn(shadowJar)
input.set(shadowJar.archiveFile)
archiveFileName.set(shadowJar.archiveFileName.get().replace(Regex("-shaded\\.jar$"), "-shaded-mapped.jar"))
addNestedDependencies.set(true)
remapAccessWidener.set(true)
}