Generate IDE run configurations, prevent circular dependencies. (#369)

- 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.
This commit is contained in:
Ampflower 2024-08-23 01:56:35 -07:00 committed by GitHub
parent 5fbebdc9f0
commit c5dcc31c37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}
}
@ -126,7 +141,7 @@ static void setupRepositories(RepositoryHandler repositories) {
}
subprojects.each {
remapJar.dependsOn("${it.path}:remapJar")
rootProject.remapJar.dependsOn("${it.path}:remapJar")
}
configurations {