Skip to content

Commit 25645cb

Browse files
authored
Separate client/server run directories (#42)
1 parent 0b40ba9 commit 25645cb

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ propertyDefaultIfUnset("forceEnableMixins", false)
6969
propertyDefaultIfUnset("usesShadowedDependencies", false)
7070
propertyDefaultIfUnset("minimizeShadowedDependencies", true)
7171
propertyDefaultIfUnset("relocateShadowedDependencies", true)
72+
propertyDefaultIfUnset("separateRunDirectories", false)
7273
propertyDefaultIfUnsetWithEnvVar("modrinthProjectId", "", "MODRINTH_PROJECT_ID")
7374
propertyDefaultIfUnset("modrinthRelations", "")
7475
propertyDefaultIfUnsetWithEnvVar("curseForgeProjectId", "", "CURSEFORGE_PROJECT_ID")
@@ -592,6 +593,17 @@ jar {
592593
}
593594
}
594595

596+
// Configure default run tasks
597+
if (separateRunDirectories.toBoolean()) {
598+
runClient {
599+
workingDir = file('run/client')
600+
}
601+
602+
runServer {
603+
workingDir = file('run/server')
604+
}
605+
}
606+
595607
// Create API library jar
596608
tasks.register('apiJar', Jar) {
597609
archiveClassifier.set 'api'

gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ minimizeShadowedDependencies = true
8080
# If disabled, won't rename the shadowed classes.
8181
relocateShadowedDependencies = true
8282

83+
# Separate run directories into "run/client" for runClient task, and "run/server" for runServer task.
84+
# Useful for debugging a server and client simultaneously. If not enabled, it will be in the standard location "run/"
85+
separateRunDirectories = false
86+
8387

8488
# Publishing to modrinth requires you to set the MODRINTH_API_KEY environment variable to your current modrinth API token.
8589

0 commit comments

Comments
 (0)