Skip to content

Commit

Permalink
Generate IDE run configurations, prevent circular dependencies. (#369)
Browse files Browse the repository at this point in the history
- Now able to launch any supported Minecraft version within the IDE and from CLI.
- There are no longer any odd circular or library dependency issues on subprojects.
- Explicitly defines rootProject within the subproject remapJar dependency loop.
  • Loading branch information
Ampflower authored Aug 23, 2024
1 parent 5fbebdc commit c5dcc31
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,23 @@ allprojects {
}

subprojects {
loom {
runs {
named("client") {
client()
ideConfigGenerated(true)
runDir("run")
}
named("server") {
server()
ideConfigGenerated(true)
runDir("run")
}
}
}

dependencies {
implementation(rootProject) {
implementation(project(path: ":", configuration: "namedElements")) {
exclude group: "net.fabricmc", module: "fabric-loader" // prevent duplicate fabric-loader on run
}
}
Expand Down Expand Up @@ -126,7 +141,7 @@ static void setupRepositories(RepositoryHandler repositories) {
}

subprojects.each {
remapJar.dependsOn("${it.path}:remapJar")
rootProject.remapJar.dependsOn("${it.path}:remapJar")
}

configurations {
Expand Down

0 comments on commit c5dcc31

Please sign in to comment.