summaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorPaint_Ninja <PaintNinja@users.noreply.github.com>2023-06-27 12:57:08 +0100
committerGitHub <noreply@github.com>2023-06-27 13:57:08 +0200
commit7e52cbf56aad127bd5e543cda9138041c00bcd04 (patch)
tree58108894c2b2473d7421255a3282d9fa60692b20 /build.gradle
parent3ea735a9018bf94f77f3b82bdd368c6cd1d0c607 (diff)
Demonstrate configureEach in run configs (#9594)
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle49
1 files changed, 10 insertions, 39 deletions
diff --git a/build.gradle b/build.gradle
index c3b2c93..5fa3a32 100644
--- a/build.gradle
+++ b/build.gradle
@@ -58,7 +58,8 @@ minecraft {
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
- client {
+ // applies to all the run configs below
+ configureEach {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
@@ -73,9 +74,6 @@ minecraft {
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
- // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
- property 'forge.enabledGameTestNamespaces', mod_id
-
mods {
"${mod_id}" {
source sourceSets.main
@@ -83,56 +81,29 @@ minecraft {
}
}
- server {
- workingDirectory project.file('run')
-
- property 'forge.logging.markers', 'REGISTRIES'
-
- property 'forge.logging.console.level', 'debug'
-
+ client {
+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', mod_id
+ }
- mods {
- "${mod_id}" {
- source sourceSets.main
- }
- }
+ server {
+ property 'forge.enabledGameTestNamespaces', mod_id
+ args '--nogui'
}
// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
- workingDirectory project.file('run')
-
- property 'forge.logging.markers', 'REGISTRIES'
-
- property 'forge.logging.console.level', 'debug'
-
property 'forge.enabledGameTestNamespaces', mod_id
-
- mods {
- "${mod_id}" {
- source sourceSets.main
- }
- }
}
data {
- workingDirectory project.file('run')
-
- property 'forge.logging.markers', 'REGISTRIES'
-
- property 'forge.logging.console.level', 'debug'
+ // example of overriding the workingDirectory set in configureEach above
+ workingDirectory project.file('run-data')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
-
- mods {
- "${mod_id}" {
- source sourceSets.main
- }
- }
}
}
}