Fix warnings with task inputs

dev/0.11
modmuss50 2019-06-24 11:20:28 +01:00
parent 3e4ade38a7
commit 583cfc495b
4 changed files with 9 additions and 5 deletions

View File

@ -26,6 +26,7 @@ package net.fabricmc.loom.task;
import org.gradle.api.file.FileCollection; import org.gradle.api.file.FileCollection;
import org.gradle.api.tasks.Input; import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.OutputFile; import org.gradle.api.tasks.OutputFile;
import java.io.File; import java.io.File;
@ -37,10 +38,11 @@ public abstract class AbstractDecompileTask extends AbstractLoomTask {
private Object libraries; private Object libraries;
//@formatter:off //@formatter:off
@Input public File getInput() { return getProject().file(input); } @InputFile
public File getInput() { return getProject().file(input); }
@OutputFile public File getOutput() { return getProject().file(output); } @OutputFile public File getOutput() { return getProject().file(output); }
@OutputFile public File getLineMapFile() { return getProject().file(lineMapFile); } @OutputFile public File getLineMapFile() { return getProject().file(lineMapFile); }
@Input public FileCollection getLibraries() { return getProject().files(libraries); } @InputFile public FileCollection getLibraries() { return getProject().files(libraries); }
public void setInput(Object input) { this.input = input; } public void setInput(Object input) { this.input = input; }
public void setOutput(Object output) { this.output = output; } public void setOutput(Object output) { this.output = output; }
public void setLineMapFile(Object lineMapFile) { this.lineMapFile = lineMapFile; } public void setLineMapFile(Object lineMapFile) { this.lineMapFile = lineMapFile; }

View File

@ -64,7 +64,7 @@ public class RemapLineNumbersTask extends AbstractLoomTask {
} }
//@formatter:off //@formatter:off
@Input public File getInput() { return getProject().file(input); } @InputFile public File getInput() { return getProject().file(input); }
@InputFile public File getLineMapFile() { return getProject().file(lineMapFile); } @InputFile public File getLineMapFile() { return getProject().file(lineMapFile); }
@OutputFile public File getOutput() { return getProject().file(output); } @OutputFile public File getOutput() { return getProject().file(output); }
public void setInput(Object input) { this.input = input; } public void setInput(Object input) { this.input = input; }

View File

@ -26,6 +26,7 @@ package net.fabricmc.loom.task;
import net.fabricmc.loom.util.SourceRemapper; import net.fabricmc.loom.util.SourceRemapper;
import org.gradle.api.tasks.Input; import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.OutputFile; import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.TaskAction;
@ -42,7 +43,8 @@ public class RemapSourcesJarTask extends AbstractLoomTask {
} }
//@formatter:off //@formatter:off
@Input public File getInput() { return getProject().file(input); } @InputFile
public File getInput() { return getProject().file(input); }
@OutputFile public File getOutput() { return getProject().file(output == null ? input : output); } @OutputFile public File getOutput() { return getProject().file(output == null ? input : output); }
@Input public String getTargetNamespace() { return direction; } @Input public String getTargetNamespace() { return direction; }
public void setInput(Object input) { this.input = input; } public void setInput(Object input) { this.input = input; }

View File

@ -134,7 +134,7 @@ public class FernFlowerTask extends AbstractDecompileTask implements ForkingJava
//@formatter:off //@formatter:off
@Input public int getNumThreads() { return numThreads; } @Input public int getNumThreads() { return numThreads; }
public boolean isNoFork() { return noFork; } @Input public boolean isNoFork() { return noFork; }
public void setNoFork(boolean noFork) { this.noFork = noFork; } public void setNoFork(boolean noFork) { this.noFork = noFork; }
public void setNumThreads(int numThreads) { this.numThreads = numThreads; } public void setNumThreads(int numThreads) { this.numThreads = numThreads; }
//@formatter:on //@formatter:on