From 5503d779131dd5a34b33398bbbf127a55d314fca Mon Sep 17 00:00:00 2001 From: SizableShrimp Date: Tue, 6 Jun 2023 23:26:07 -0500 Subject: [PATCH] Fix GenIDERunsTask error when output dir doesn't exist Signed-off-by: SizableShrimp --- .../gradle/common/util/runs/GenIDERunsTask.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/java/net/minecraftforge/gradle/common/util/runs/GenIDERunsTask.java b/src/common/java/net/minecraftforge/gradle/common/util/runs/GenIDERunsTask.java index c8164f163..c6fcdafe7 100644 --- a/src/common/java/net/minecraftforge/gradle/common/util/runs/GenIDERunsTask.java +++ b/src/common/java/net/minecraftforge/gradle/common/util/runs/GenIDERunsTask.java @@ -14,7 +14,6 @@ import org.gradle.api.provider.ListProperty; import org.gradle.api.provider.Property; import org.gradle.api.tasks.Input; -import org.gradle.api.tasks.InputDirectory; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.TaskAction; @@ -28,6 +27,7 @@ abstract class GenIDERunsTask extends DefaultTask { public GenIDERunsTask() { this.setGroup(RunConfig.RUNS_GROUP); + this.getRunConfigurationsFolderName().set(this.getRunConfigurationsFolder().map(dir -> dir.getAsFile().getAbsolutePath())); } @TaskAction @@ -48,9 +48,14 @@ public void run() { additionalClientArgs, minecraftArtifacts, runtimeClasspathArtifacts); } - @InputDirectory + @Internal public abstract DirectoryProperty getRunConfigurationsFolder(); + // 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). + // This serves as a workaround to still support up-to-date checking (although this task should always re-run anyways!) + @Input + protected abstract Property getRunConfigurationsFolderName(); + @Internal public abstract Property getRunConfigGenerator();