work on loom stuff

This commit is contained in:
dfsek
2021-03-02 00:30:26 -07:00
parent e4c1a056ae
commit 7828de74aa
6 changed files with 48 additions and 81 deletions
+30 -32
View File
@@ -11,39 +11,18 @@ buildscript {
url = uri("https://maven.fabricmc.net/")
}
}
// dependencies {
// classpath("net.fabricmc:fabric-loom:+")
// }
dependencies {
classpath("net.fabricmc:fabric-loom:0.6-SNAPSHOT")
}
}
plugins {
id("fabric-loom").version("0.5.9")
`java-library`
}
//apply(plugin = "fabric-loom")
apply(plugin = "fabric-loom")
apply(plugin = "java-library")
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"
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)
}
val mixinVersion = "0.8.1+build.21"
val loomVersion = "0.6-SNAPSHOT"
dependencies {
"shadedApi"(project(":common"))
@@ -59,7 +38,26 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
"modImplementation"("net.fabricmc.fabric-api:fabric-api:0.31.0+1.16")
"compileOnly"("net.fabricmc:sponge-mixin:+")
"annotationProcessor"("net.fabricmc:sponge-mixin:+")
"annotationProcessor"("net.fabricmc:fabric-loom:+")
}
"compileOnly"("net.fabricmc:sponge-mixin:${mixinVersion}")
"annotationProcessor"("net.fabricmc:sponge-mixin:${mixinVersion}")
"annotationProcessor"("net.fabricmc:fabric-loom:${loomVersion}")
}
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)
}