Skip to content

Commit

Permalink
Publish Mojang mapped artifacts for -common & repack -common for Fabr…
Browse files Browse the repository at this point in the history
…ic, so it gets remapped to intermediary
  • Loading branch information
jpenilla committed Jan 15, 2024
1 parent 4e32f08 commit 4ecbaae
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 19 deletions.
16 changes: 12 additions & 4 deletions cloud-fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand All @@ -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)
Expand Down
24 changes: 24 additions & 0 deletions cloud-fabric/common-repack/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 }))
}
}
8 changes: 4 additions & 4 deletions cloud-minecraft-modded-common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import net.fabricmc.loom.task.AbstractRemapJarTask

plugins {
id("conventions.base")
id("conventions.publishing")
Expand All @@ -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"
}
10 changes: 2 additions & 8 deletions cloud-neoforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -36,13 +37,6 @@ tasks {
expand(props)
}
}
jar {
from(
zipTree(
project(":cloud-minecraft-modded-common").tasks.named<AbstractArchiveTask>("jar").flatMap { it.archiveFile }
)
)
}
}

loom {
Expand Down
8 changes: 5 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ dependencyResolutionManagement {

rootProject.name = "cloud-minecraft-modded"

include(":cloud-minecraft-modded-common")
include(":cloud-fabric")
include(":cloud-neoforge")
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")

0 comments on commit 4ecbaae

Please sign in to comment.