Commit c6ba6773 authored by Stephanie Gawroriski's avatar Stephanie Gawroriski
Browse files

Correct single file reference since libraries can now optionally exist such as...

Correct single file reference since libraries can now optionally exist such as when there are no sources.
parent 25d603e3
Pipeline #110359 passed with stages
in 6 minutes and 33 seconds
......@@ -12,6 +12,7 @@ package cc.squirreljme.plugin.util;
import java.nio.file.Path;
import java.util.concurrent.Callable;
import org.gradle.api.Task;
import org.gradle.api.file.FileCollection;
/**
* This takes the output of a task and provides a {@link Callable} so that
......@@ -48,6 +49,11 @@ public class SingleTaskOutputFile
@Override
public Path call()
{
return this.task.getOutputs().getFiles().getSingleFile().toPath();
FileCollection files = this.task.getOutputs().getFiles();
if (files.getFiles().isEmpty())
return null;
return files.getSingleFile().toPath();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment