Skip to content

Commit

Permalink
Fix GenIDERunsTask error when output dir doesn't exist
Browse files Browse the repository at this point in the history
Signed-off-by: SizableShrimp <[email protected]>
  • Loading branch information
SizableShrimp committed Jun 7, 2023
1 parent a7a61e9 commit 5503d77
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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<String> getRunConfigurationsFolderName();

@Internal
public abstract Property<RunConfigGenerator> getRunConfigGenerator();

Expand Down

0 comments on commit 5503d77

Please sign in to comment.