Skip to content

Commit

Permalink
Move loom configuration out of root project
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Aug 18, 2024
1 parent 007a4a8 commit 2ac823f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
24 changes: 0 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import net.fabricmc.loom.task.RunGameTask

plugins {
id 'java'
alias(libs.plugins.eclipseApt)
Expand Down Expand Up @@ -83,26 +81,4 @@ allprojects {
}
}
}

// Loom -- needs to run late to avoid preset config not applying properly
afterEvaluate {
tasks.withType(RunGameTask) {
javaLauncher.set(javaToolchains.launcherFor { languageVersion.set(indra.javaVersions().target().map { v -> JavaLanguageVersion.of(v) })})
}
}

// Loom-specific
plugins.withId('fabric-loom') {
dependencies {
minecraft(libs.minecraft)
mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${libs.versions.parchment.get()}@zip")
})
}

loom {
runtimeOnlyLog4j.set(true)
}
}
}
14 changes: 14 additions & 0 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import net.fabricmc.loom.api.RemapConfigurationSettings
import net.fabricmc.loom.task.GenerateSourcesTask
import net.fabricmc.loom.task.RemapJarTask
import net.fabricmc.loom.task.RunGameTask
import org.gradle.configurationcache.extensions.capitalized

plugins {
Expand All @@ -20,6 +21,11 @@ dependencies {
// Only used for prod test
modCompileOnly(libs.fabric.api.lifecycle)

minecraft(libs.minecraft)
mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${libs.versions.parchment.get()}@zip")
})
modImplementation(libs.fabric.loader)

testImplementation(libs.fabric.loader.junit)
Expand Down Expand Up @@ -161,8 +167,16 @@ loom {
decompilerOptions.named("vineflower") {
options.put("win", "0")
}

runtimeOnlyLog4j.set(true)
}

// Loom -- needs to run late to avoid preset config not applying properly
afterEvaluate {
tasks.withType(RunGameTask::class).configureEach {
javaLauncher.set(javaToolchains.launcherFor { languageVersion.set(indra.javaVersions().target().map { v -> JavaLanguageVersion.of(v) })})
}
}

dependencies {
"testmodRuntimeOnly"(permissionsApiCompat.output)
Expand Down
6 changes: 6 additions & 0 deletions fabric/mod-shared-repack/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ plugins {
}

dependencies {
minecraft(libs.minecraft)
mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${libs.versions.parchment.get()}@zip")
})
compileOnly(libs.fabric.loader)
}

loom {
mixin {
useLegacyMixinAp = false
}
runtimeOnlyLog4j.set(true)
}

tasks {
Expand Down

0 comments on commit 2ac823f

Please sign in to comment.