mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Remove Commons IO usages
This commit is contained in:
@@ -17,9 +17,9 @@ import java.util.function.Predicate;
|
||||
|
||||
import dev.architectury.loom.forge.tool.ForgeToolExecutor;
|
||||
import dev.architectury.loom.util.DependencyDownloader;
|
||||
import dev.architectury.loom.util.NullOutputStream;
|
||||
import dev.architectury.loom.util.TempFiles;
|
||||
import dev.architectury.loom.util.ThreadingUtils;
|
||||
import org.apache.commons.io.output.NullOutputStream;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.file.ConfigurableFileCollection;
|
||||
import org.gradle.api.logging.Logger;
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
package dev.architectury.loom.forge.dependency;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.gradle.api.Project;
|
||||
|
||||
import net.fabricmc.loom.configuration.DependencyInfo;
|
||||
@@ -45,7 +45,7 @@ public class ForgeUniversalProvider extends DependencyProvider {
|
||||
|
||||
if (!forge.exists() || refreshDeps()) {
|
||||
File dep = dependency.resolveFile().orElseThrow(() -> new RuntimeException("Could not resolve Forge"));
|
||||
FileUtils.copyFile(dep, forge);
|
||||
Files.copy(dep.toPath(), forge.toPath());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ import java.nio.file.Path;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import dev.architectury.loom.util.NullOutputStream;
|
||||
import dev.architectury.loom.util.Stopwatch;
|
||||
import org.apache.commons.io.output.NullOutputStream;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.logging.LogLevel;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -88,8 +88,8 @@ public class SrgProvider extends DependencyProvider {
|
||||
PrintStream err = System.err;
|
||||
|
||||
if (getProject().getGradle().getStartParameter().getLogLevel().compareTo(LogLevel.LIFECYCLE) >= 0) {
|
||||
System.setOut(new PrintStream(NullOutputStream.NULL_OUTPUT_STREAM));
|
||||
System.setErr(new PrintStream(NullOutputStream.NULL_OUTPUT_STREAM));
|
||||
System.setOut(new PrintStream(NullOutputStream.INSTANCE));
|
||||
System.setErr(new PrintStream(NullOutputStream.INSTANCE));
|
||||
}
|
||||
|
||||
Files.deleteIfExists(mergedMojangRaw);
|
||||
|
||||
@@ -3,7 +3,7 @@ package dev.architectury.loom.forge.tool;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.io.output.NullOutputStream;
|
||||
import dev.architectury.loom.util.NullOutputStream;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.file.ConfigurableFileCollection;
|
||||
import org.gradle.api.logging.LogLevel;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package dev.architectury.loom.util;
|
||||
|
||||
import java.io.OutputStream;
|
||||
|
||||
public final class NullOutputStream extends OutputStream {
|
||||
public static final NullOutputStream INSTANCE = new NullOutputStream();
|
||||
|
||||
private NullOutputStream() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(int b) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b, int off, int len) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user