diff --git a/src/main/java/net/fabricmc/loom/extension/LoomFilesProjectImpl.java b/src/main/java/net/fabricmc/loom/extension/LoomFilesProjectImpl.java index 3a5897e5a..4c8811b7c 100644 --- a/src/main/java/net/fabricmc/loom/extension/LoomFilesProjectImpl.java +++ b/src/main/java/net/fabricmc/loom/extension/LoomFilesProjectImpl.java @@ -53,6 +53,6 @@ protected File getProjectDir() { @Override protected File getBuildDir() { - return project.getBuildDir(); + return project.getLayout().getBuildDirectory().getAsFile().get(); } } diff --git a/src/main/java/net/fabricmc/loom/task/RemapTaskConfiguration.java b/src/main/java/net/fabricmc/loom/task/RemapTaskConfiguration.java index cbd3630a2..a6303454e 100644 --- a/src/main/java/net/fabricmc/loom/task/RemapTaskConfiguration.java +++ b/src/main/java/net/fabricmc/loom/task/RemapTaskConfiguration.java @@ -24,8 +24,6 @@ package net.fabricmc.loom.task; -import java.io.File; - import javax.inject.Inject; import org.gradle.api.Project; @@ -92,7 +90,7 @@ public void run() { // Configure the default jar task getTasks().named(JavaPlugin.JAR_TASK_NAME, AbstractArchiveTask.class).configure(task -> { task.getArchiveClassifier().convention("dev"); - task.getDestinationDirectory().set(new File(getProject().getBuildDir(), "devlibs")); + task.getDestinationDirectory().set(getProject().getLayout().getBuildDirectory().map(directory -> directory.dir("devlibs"))); }); getTasks().named(BasePlugin.ASSEMBLE_TASK_NAME).configure(task -> task.dependsOn(remapJarTask)); @@ -139,7 +137,7 @@ private void trySetupSourceRemapping() { } sourcesJarTask.getArchiveClassifier().convention("dev-sources"); - sourcesJarTask.getDestinationDirectory().set(new File(getProject().getBuildDir(), "devlibs")); + sourcesJarTask.getDestinationDirectory().set(getProject().getLayout().getBuildDirectory().map(directory -> directory.dir("devlibs"))); task.getArchiveClassifier().convention("sources"); task.dependsOn(sourcesJarTask);