From ab38cdf142fac7911de94814a361e3c526894b57 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 4 Aug 2024 21:47:12 -0700 Subject: [PATCH] coerce the mod into running at dev time (fabric & forge) --- build.gradle | 9 +++++++++ fabric/build.gradle | 11 ++++++++--- neoforge/build.gradle | 11 +++++++++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index dd205f89..295eec68 100644 --- a/build.gradle +++ b/build.gradle @@ -75,3 +75,12 @@ allprojects { } } } + +subprojects { + loom.mods { + main { + sourceSet("main") + sourceSet("main", project.rootProject) + } + } +} diff --git a/fabric/build.gradle b/fabric/build.gradle index df2de204..2bf1a800 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -4,16 +4,21 @@ plugins { id 'io.github.goooler.shadow' } +configurations.create("libs") +configurations.shadow { + extendsFrom(configurations.libs) +} configurations.implementation { - extendsFrom(configurations.shadow) + extendsFrom(configurations.libs) } dependencies { add('shadow', project([path: ":", configuration: "namedElements"])) + runtimeOnly(project(":").sourceSets.main.output) modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - shadow('ca.spottedleaf:concurrentutil:0.0.1-SNAPSHOT') - shadow("org.yaml:snakeyaml:${rootProject.snakeyaml_version}") + libs('ca.spottedleaf:concurrentutil:0.0.1-SNAPSHOT') + libs("org.yaml:snakeyaml:${rootProject.snakeyaml_version}") } processResources { diff --git a/neoforge/build.gradle b/neoforge/build.gradle index b22ebf5f..f275ceec 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -13,6 +13,13 @@ repositories { } } +configurations.create("libs") +configurations.shadow { + extendsFrom(configurations.libs) +} +configurations.forgeExtra { + extendsFrom(configurations.libs) +} configurations.implementation { extendsFrom(configurations.shadow) } @@ -21,8 +28,8 @@ dependencies { add('shadow', project([path: ":", configuration: "namedElements"])) neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}" - shadow('ca.spottedleaf:concurrentutil:0.0.1-SNAPSHOT') - shadow("org.yaml:snakeyaml:${rootProject.snakeyaml_version}") + libs('ca.spottedleaf:concurrentutil:0.0.1-SNAPSHOT') + libs("org.yaml:snakeyaml:${rootProject.snakeyaml_version}") } processResources {