diff --git a/build.gradle b/build.gradle index 6c7322061..487674f1e 100644 --- a/build.gradle +++ b/build.gradle @@ -132,6 +132,7 @@ forgix { } removeDuplicate "com.seibel.lod.core" + removeDuplicate "com.seibel.lod.api" } architectury { @@ -141,14 +142,11 @@ architectury { subprojects { p -> // setup Architectury - if (p == project(":core") || p == project(":api")) - { + if (p == project(":core") || p == project(":api")) { apply plugin: "application" apply plugin: "org.spongepowered.gradle.vanilla" // Provides minecraft libraries apply plugin: "com.github.johnrengelman.shadow" - } - else - { + } else { apply plugin: "com.github.johnrengelman.shadow" apply plugin: "dev.architectury.loom" @@ -166,8 +164,7 @@ subprojects { p -> } // Set up the minecraft non-dependency for core sub-projects - if (p == project(":core") || p == project(":api")) - { + if (p == project(":core") || p == project(":api")) { minecraft { version("${rootProject.minecraft_version}") } @@ -219,25 +216,23 @@ subprojects { p -> //==========================// // Minecraft dependent sub-projects - if (p == project(":common") || p == project(":forge") || p == project(":fabric") || p == project(":api")) - { - if (p != project(":api")) - { - // Add Minecraft - minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" - // The following line declares the mojmap mappings & parchment mappings - mappings loom.layered() { - // Mojmap mappings - officialMojangMappings() - // Parchment mappings (it adds parameter mappings & javadoc) - if (rootProject.minecraft_version != "1.19") - parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") - else // As 1.19 doesn't have parchment mappings yet, we use 1.18.2 mapping - parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") - } + if (p == project(":common") || p == project(":forge") || p == project(":fabric")) { + // Add Minecraft + minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" + // The following line declares the mojmap mappings & parchment mappings + mappings loom.layered() { + // Mojmap mappings + officialMojangMappings() + // Parchment mappings (it adds parameter mappings & javadoc) + if (rootProject.minecraft_version != "1.19") + parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:${rootProject.parchment_version}@zip") + else // As 1.19 doesn't have parchment mappings yet, we use 1.18.2 mapping + parchment("org.parchmentmc.data:parchment-1.18.2:${rootProject.parchment_version}@zip") } - - // Add core + } + + // Add core + if (p != project(":core")) { customModule(project(":core")) { // Remove Junit test libraries exclude group: "org.junit.jupiter", module: "junit-jupiter" @@ -245,7 +240,16 @@ subprojects { p -> exclude group: "junit", module: "junit" } } - + + // Add the api + if (p != project(":api") && p != project(":core")) { + customModule(project(":api")) { + // Remove Junit test libraries + exclude group: "org.junit.jupiter", module: "junit-jupiter" + exclude group: "org.junit.jupiter", module: "junit-jupiter-engine" + exclude group: "junit", module: "junit" + } + } } // Allows the jar to run standalone