Refactor Mixin build setup

This commit is contained in:
Zoë
2022-07-06 00:26:42 -07:00
parent 29e1d05c71
commit 36ceabd749
13 changed files with 75 additions and 89 deletions

View File

@@ -6,26 +6,16 @@ plugins {
architectury {
platformSetupLoomIde()
forge()
}
configurations {
val common by creating
compileClasspath.get().extendsFrom(common)
runtimeClasspath.get().extendsFrom(common)
loader("forge")
}
dependencies {
shadedApi(project(":common:implementation:base"))
"forgeRuntimeLibrary"(project(":common:implementation:base"))
"common"(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
implementation(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
"developmentForge"(project(path = ":platforms:mixin-common", configuration = "namedElements")) { isTransitive = false }
shaded(project(path = ":platforms:mixin-common", configuration = "transformProductionForge")) { isTransitive = false }
"developmentForge"(project(path = ":platforms:mixin-common", configuration = "namedElements")) {
isTransitive = false
}
forge(group = "net.minecraftforge", name = "forge", version = Versions.Forge.forge)
@@ -38,12 +28,21 @@ dependencies {
}
loom {
accessWidenerPath.set(project(":platforms:mixin-common").file("terra.accesswidener"))
accessWidenerPath.set(project(":platforms:mixin-common").file("src/main/resources/terra.accesswidener"))
mixin {
defaultRefmapName.set("terra.forge.refmap.json")
}
launches {
named("client") {
property("fabric.log.level", "debug")
}
named("server") {
property("fabric.log.level", "debug")
}
}
forge {
convertAccessWideners.set(true)
mixinConfig("terra.common.mixins.json")
@@ -66,17 +65,9 @@ tasks {
)
}
}
shadowJar {
exclude("fabric.mod.json")
}
remapJar {
inputFile.set(shadowJar.get().archiveFile)
archiveFileName.set("${rootProject.name.capitalize()}-${project.version}.jar")
}
processResources {
from(project(":platforms:mixin-common").file("terra.accesswidener"))
}
}