Skip to content

Commit

Permalink
simplify project structure to fix build on Forge and NeoForge
Browse files Browse the repository at this point in the history
  • Loading branch information
way2muchnoise committed Feb 9, 2025
1 parent d03ec9a commit 768639a
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 77 deletions.
7 changes: 1 addition & 6 deletions Fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,11 @@ dependencies {
implementation(project(":Common", configuration = "namedElements")) { isTransitive = false }
shadowImplementation(project(":Common", configuration = "transformProductionFabric")) { isTransitive = false }

implementation(project(":FabricApi", configuration = "namedElements"))
shadowImplementation(project(":CommonApi")) { isTransitive = false }
shadowImplementation(project(":FabricApi")) { isTransitive = false }


api(project(":CommonApi", configuration = "namedElements"))
}

val apiJar = tasks.register<Jar>("apiJar") {
from(project(":CommonApi").sourceSets.main.get().output)
from(project(":FabricApi").sourceSets.main.get().output)

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("api")
Expand Down
14 changes: 0 additions & 14 deletions FabricApi/build.gradle.kts

This file was deleted.

10 changes: 2 additions & 8 deletions Forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,12 @@ dependencies {
implementation(project(":Common", configuration = "namedElements")) { isTransitive = false }
shadowImplementation(project(":Common", configuration = "transformProductionForge")) { isTransitive = false }

implementation(project(":ForgeApi", configuration = "namedElements"))
shadowImplementation(project(":CommonApi")) { isTransitive = false }
shadowImplementation(project(":ForgeApi")) { isTransitive = false }

// Need to make sure the API packages are loaded while during run in IDE
forgeRuntimeLibrary(project(":CommonApi", configuration = "namedElements"))
forgeRuntimeLibrary(project(":ForgeApi", configuration = "namedElements"))
implementation(project(":CommonApi", configuration = "namedElements")) { isTransitive = false }
shadowImplementation(project(":CommonApi", configuration = "transformProductionNeoForge")) { isTransitive = false }
}

val apiJar = tasks.register<Jar>("apiJar") {
from(project(":CommonApi").sourceSets.main.get().output)
from(project(":ForgeApi").sourceSets.main.get().output)

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("api")
Expand Down
13 changes: 0 additions & 13 deletions ForgeApi/build.gradle.kts

This file was deleted.

1 change: 0 additions & 1 deletion ForgeApi/gradle.properties

This file was deleted.

10 changes: 2 additions & 8 deletions NeoForge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,8 @@ dependencies {
implementation(project(":Common", configuration = "namedElements")) { isTransitive = false }
shadowImplementation(project(":Common", configuration = "transformProductionNeoForge")) { isTransitive = false }

implementation(project(":NeoForgeApi", configuration = "namedElements"))
shadowImplementation(project(":CommonApi")) { isTransitive = false }
shadowImplementation(project(":NeoForgeApi")) { isTransitive = false }

// Need to make sure the API packages are loaded while during run in IDE
forgeRuntimeLibrary(project(":CommonApi", configuration = "namedElements"))
forgeRuntimeLibrary(project(":NeoForgeApi", configuration = "namedElements"))
implementation(project(":CommonApi", configuration = "namedElements")) { isTransitive = false }
shadowImplementation(project(":CommonApi", configuration = "transformProductionNeoForge")) { isTransitive = false }
}

tasks {
Expand All @@ -69,7 +64,6 @@ tasks {

val apiJar = tasks.register<Jar>("apiJar") {
from(project(":CommonApi").sourceSets.main.get().output)
from(project(":NeoForgeApi").sourceSets.main.get().output)

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("api")
Expand Down
17 changes: 0 additions & 17 deletions NeoForgeApi/build.gradle.kts

This file was deleted.

1 change: 0 additions & 1 deletion NeoForgeApi/gradle.properties

This file was deleted.

1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ subprojects {
fun Project.sourceSets() = extensions.getByName<SourceSetContainer>("sourceSets")
sourceSet(sourceSets().getByName("main"))
sourceSet(project(":Common").sourceSets().getByName("main"))
sourceSet(project(":CommonApi").sourceSets().getByName("main"))
}
}

Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ minecraftVersion=1.21.1
minecraftVersionRange=[1.21.1, 1.21.2)

# Forge
forgeVersion=52.0.24
forgeVersion=52.0.47
loaderVersionRange=[52,)
forgeVersionRange=[52.0.24,)

# Fabric
fabricVersion=0.107.0+1.21.1
fabricLoaderVersion=0.16.7
fabricVersion=0.115.0+1.21.1
fabricLoaderVersion=0.16.10

# NeoForge
neoforgeVersion=21.1.73
neoforgeVersion=21.1.117
neoforgeLoaderVersionRange=[4,)
neoforgeVersionRange=[21.1.0,)

Expand All @@ -41,8 +41,8 @@ modMenuVersion=11.0.3

# Mappings
mappingsChannel=parchment
mappingsParchmentMinecraftVersion=1.21
mappingsParchmentVersion=2024.07.28
mappingsParchmentMinecraftVersion=1.21.1
mappingsParchmentVersion=2024.11.17

# Publishing
curseProjectId=240630
Expand Down
4 changes: 1 addition & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ pluginManagement {
rootProject.name = "JustEnoughResources"
include(
"CommonApi", "Common",
"FabricApi", "Fabric",
"ForgeApi", "Forge",
"NeoForgeApi", "NeoForge",
"Fabric", "Forge", "NeoForge",
)

0 comments on commit 768639a

Please sign in to comment.