diff --git a/cloud-fabric/build.gradle.kts b/cloud-fabric/build.gradle.kts index 5733e979..b8775070 100644 --- a/cloud-fabric/build.gradle.kts +++ b/cloud-fabric/build.gradle.kts @@ -12,13 +12,18 @@ configurations { force("net.fabricmc:fabric-loader:${libs.versions.fabricLoader.get()}") } } - transitiveInclude { extendsFrom(api.get()) exclude("org.checkerframework") exclude("org.apiguardian") - exclude("cloud.commandframework", "cloud-minecraft-modded-common") + exclude("cloud.commandframework", "cloud-minecraft-modded-common-fabric-repack") + } + runtimeClasspath { + exclude("cloud.commandframework", "cloud-minecraft-modded-common-fabric-repack") + } + compileClasspath { + exclude("cloud.commandframework", "cloud-minecraft-modded-common-fabric-repack") } } @@ -30,8 +35,11 @@ dependencies { api(platform(libs.cloud.bom)) api(libs.cloud.core) api(libs.cloud.brigadier) - api(project(":cloud-minecraft-modded-common", configuration = "namedElements")) - include(project(":cloud-minecraft-modded-common")) + + runtimeOnly(project(":cloud-minecraft-modded-common", configuration = "namedElements")) + compileOnly(project(":cloud-minecraft-modded-common", configuration = "namedElements")) + api(project(":cloud-minecraft-modded-common-fabric-repack", configuration = "namedElements")) + include(project(":cloud-minecraft-modded-common-fabric-repack")) modImplementation(platform(libs.fabricApi.bom)) modImplementation(libs.fabricApi.command.api.v2) diff --git a/cloud-fabric/common-repack/build.gradle.kts b/cloud-fabric/common-repack/build.gradle.kts new file mode 100644 index 00000000..c497e843 --- /dev/null +++ b/cloud-fabric/common-repack/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + id("conventions.base") + id("conventions.publishing") + id("xyz.jpenilla.quiet-architectury-loom") +} + +dependencies { + minecraft(libs.minecraft) + mappings(loom.officialMojangMappings()) + compileOnly(libs.fabricLoader) +} + +tasks { + val common = project(":cloud-minecraft-modded-common") + jar { + from(zipTree(common.tasks.jar.flatMap { it.archiveFile })) + } + sourcesJar { + from(zipTree(common.tasks.sourcesJar.flatMap { it.archiveFile })) + } + javadocJar { + from(zipTree(common.tasks.javadocJar.flatMap { it.archiveFile })) + } +} diff --git a/cloud-minecraft-modded-common/build.gradle.kts b/cloud-minecraft-modded-common/build.gradle.kts index 0f8689d0..142c0650 100644 --- a/cloud-minecraft-modded-common/build.gradle.kts +++ b/cloud-minecraft-modded-common/build.gradle.kts @@ -1,3 +1,5 @@ +import net.fabricmc.loom.task.AbstractRemapJarTask + plugins { id("conventions.base") id("conventions.publishing") @@ -14,8 +16,6 @@ dependencies { compileOnly(libs.cloud.brigadier) } -tasks.jar { - manifest { - attributes("Fabric-Loom-Remap" to true) - } +tasks.withType(AbstractRemapJarTask::class).configureEach { + targetNamespace = "named" } diff --git a/cloud-neoforge/build.gradle.kts b/cloud-neoforge/build.gradle.kts index 7d8dc600..6b89b08c 100644 --- a/cloud-neoforge/build.gradle.kts +++ b/cloud-neoforge/build.gradle.kts @@ -25,7 +25,8 @@ dependencies { api(platform(libs.cloud.bom)) api(libs.cloud.core) api(libs.cloud.brigadier) - compileOnlyApi(project(":cloud-minecraft-modded-common", configuration = "namedElements")) + api(project(":cloud-minecraft-modded-common", configuration = "namedElements")) + include(project(":cloud-minecraft-modded-common")) } tasks { @@ -36,13 +37,6 @@ tasks { expand(props) } } - jar { - from( - zipTree( - project(":cloud-minecraft-modded-common").tasks.named("jar").flatMap { it.archiveFile } - ) - ) - } } loom { diff --git a/settings.gradle.kts b/settings.gradle.kts index 83028b0e..b7e1a29f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -33,4 +33,6 @@ rootProject.name = "cloud-minecraft-modded" include("cloud-minecraft-modded-common") include("cloud-fabric") +include("cloud-fabric/common-repack") +findProject(":cloud-fabric/common-repack")?.name = "cloud-minecraft-modded-common-fabric-repack" include("cloud-neoforge")