|
9 | 9 | import org.gradle.api.Action; |
10 | 10 | import org.gradle.api.file.ConfigurableFileCollection; |
11 | 11 | import org.gradle.api.file.DirectoryProperty; |
| 12 | +import org.gradle.api.file.ProjectLayout; |
12 | 13 | import org.gradle.api.model.ObjectFactory; |
13 | 14 | import org.gradle.api.provider.ListProperty; |
14 | 15 | import org.gradle.api.provider.MapProperty; |
@@ -39,6 +40,8 @@ public abstract class SlimeLauncherOptionsImpl implements SlimeLauncherOptionsIn |
39 | 40 |
|
40 | 41 | private final MapProperty<String, SlimeLauncherOptionsNested> nested = this.getObjects().mapProperty(String.class, SlimeLauncherOptionsNested.class); |
41 | 42 |
|
| 43 | + protected abstract @Inject ProjectLayout getProjectLayout(); |
| 44 | + |
42 | 45 | protected abstract @Inject ObjectFactory getObjects(); |
43 | 46 |
|
44 | 47 | protected abstract @Inject ProviderFactory getProviders(); |
@@ -267,7 +270,7 @@ public SlimeLauncherOptionsInternal inherit(Map<String, RunConfig> configs, Stri |
267 | 270 | target.getMaxHeapSize().convention(this.getMaxHeapSize()); |
268 | 271 | target.getSystemProperties().convention(this.getSystemProperties()); |
269 | 272 | target.getEnvironment().convention(this.getEnvironment()); |
270 | | - target.getWorkingDir().convention(this.getWorkingDir()); |
| 273 | + target.getWorkingDir().convention(this.getWorkingDir().orElse(getProjectLayout().getProjectDirectory().dir("runs/" + sourceSetName + '/' + this.name))); |
271 | 274 | target.getClient().convention(this.getClient()); |
272 | 275 | return this.inherit(target, sourceSetName, configs, name); |
273 | 276 | } |
@@ -317,6 +320,8 @@ private SlimeLauncherOptionsInternal inherit(SlimeLauncherOptionsInternal target |
317 | 320 | target.environment(child.getEnvironment().getOrElse(Map.of())); |
318 | 321 |
|
319 | 322 | target.systemProperties(child.getSystemProperties().getOrElse(Map.of())); |
| 323 | + |
| 324 | + target.getWorkingDir().set(child.getWorkingDir()); |
320 | 325 | } |
321 | 326 |
|
322 | 327 | return target; |
|
0 commit comments