Skip to content

Commit 5503d77

Browse files
committed
Fix GenIDERunsTask error when output dir doesn't exist
Signed-off-by: SizableShrimp <[email protected]>
1 parent a7a61e9 commit 5503d77

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/common/java/net/minecraftforge/gradle/common/util/runs/GenIDERunsTask.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.gradle.api.provider.ListProperty;
1515
import org.gradle.api.provider.Property;
1616
import org.gradle.api.tasks.Input;
17-
import org.gradle.api.tasks.InputDirectory;
1817
import org.gradle.api.tasks.InputFiles;
1918
import org.gradle.api.tasks.Internal;
2019
import org.gradle.api.tasks.TaskAction;
@@ -28,6 +27,7 @@
2827
abstract class GenIDERunsTask extends DefaultTask {
2928
public GenIDERunsTask() {
3029
this.setGroup(RunConfig.RUNS_GROUP);
30+
this.getRunConfigurationsFolderName().set(this.getRunConfigurationsFolder().map(dir -> dir.getAsFile().getAbsolutePath()));
3131
}
3232

3333
@TaskAction
@@ -48,9 +48,14 @@ public void run() {
4848
additionalClientArgs, minecraftArtifacts, runtimeClasspathArtifacts);
4949
}
5050

51-
@InputDirectory
51+
@Internal
5252
public abstract DirectoryProperty getRunConfigurationsFolder();
5353

54+
// Gradle doesn't seem to have a good way to declare an input on the location of a path without caring about its contents (or whether it exists).
55+
// This serves as a workaround to still support up-to-date checking (although this task should always re-run anyways!)
56+
@Input
57+
protected abstract Property<String> getRunConfigurationsFolderName();
58+
5459
@Internal
5560
public abstract Property<RunConfigGenerator> getRunConfigGenerator();
5661

0 commit comments

Comments
 (0)