mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 13:37:45 -05:00
downgrade to gradle 4.9, fix tiny-remapper deprecations, restore old dev/noclassifier behaviour for default RemapJarTask settings
This commit is contained in:
@@ -311,13 +311,14 @@ public class AbstractPlugin implements Plugin<Project> {
|
||||
|
||||
assert remapJarTask != null;
|
||||
if (!remapJarTask.getInput().isPresent()) {
|
||||
remapJarTask.getArchiveClassifier().set("remapped");
|
||||
remapJarTask.getInput().set(jarTask.getArchiveFile());
|
||||
jarTask.setClassifier("dev");
|
||||
remapJarTask.setClassifier("");
|
||||
remapJarTask.getInput().set(jarTask.getArchivePath());
|
||||
}
|
||||
|
||||
remapJarTask.getAddNestedDependencies().set(true);
|
||||
|
||||
remapJarTask.doLast(task -> project1.getArtifacts().add("archives", remapJarTask.getArchiveFile()));
|
||||
remapJarTask.doLast(task -> project1.getArtifacts().add("archives", remapJarTask.getArchivePath()));
|
||||
remapJarTask.dependsOn(project1.getTasks().getByName("jar"));
|
||||
project1.getTasks().getByName("build").dependsOn(remapJarTask);
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import net.fabricmc.tinyremapper.OutputConsumerPath;
|
||||
import net.fabricmc.tinyremapper.TinyRemapper;
|
||||
import net.fabricmc.tinyremapper.TinyUtils;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.file.RegularFile;
|
||||
import org.gradle.api.file.RegularFileProperty;
|
||||
import org.gradle.api.provider.Property;
|
||||
import org.gradle.api.tasks.Input;
|
||||
@@ -53,7 +54,7 @@ public class RemapJarTask extends Jar {
|
||||
|
||||
public RemapJarTask() {
|
||||
super();
|
||||
input = getProject().getObjects().fileProperty();
|
||||
input = getProject().getLayout().fileProperty();
|
||||
addNestedDependencies = getProject().getObjects().property(Boolean.class);
|
||||
}
|
||||
|
||||
@@ -62,7 +63,7 @@ public class RemapJarTask extends Jar {
|
||||
Project project = getProject();
|
||||
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
|
||||
Path input = this.getInput().getAsFile().get().toPath();
|
||||
Path output = this.getArchiveFile().get().getAsFile().toPath();
|
||||
Path output = this.getArchivePath().toPath();
|
||||
|
||||
if (!Files.exists(input)) {
|
||||
throw new FileNotFoundException(input.toString());
|
||||
@@ -98,7 +99,7 @@ public class RemapJarTask extends Jar {
|
||||
|
||||
TinyRemapper remapper = remapperBuilder.build();
|
||||
|
||||
try (OutputConsumerPath outputConsumer = new OutputConsumerPath(output)) {
|
||||
try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(output).build()) {
|
||||
outputConsumer.addNonClassFiles(input);
|
||||
remapper.readClassPath(classpath);
|
||||
remapper.readInputs(input);
|
||||
|
||||
@@ -66,7 +66,7 @@ public class MapJarsTiny {
|
||||
.rebuildSourceFilenames(true)
|
||||
.build();
|
||||
|
||||
try (OutputConsumerPath outputConsumer = new OutputConsumerPath(output)) {
|
||||
try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(output).build()) {
|
||||
outputConsumer.addNonClassFiles(input);
|
||||
remapper.readClassPath(classpath);
|
||||
remapper.readInputs(input);
|
||||
|
||||
@@ -167,7 +167,7 @@ public class ModProcessor {
|
||||
.withMappings(TinyRemapperMappingsHelper.create(mappingsProvider.getMappings(), fromM, toM))
|
||||
.build();
|
||||
|
||||
try (OutputConsumerPath outputConsumer = new OutputConsumerPath(Paths.get(output.getAbsolutePath()))) {
|
||||
try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(Paths.get(output.getAbsolutePath())).build()) {
|
||||
outputConsumer.addNonClassFiles(inputPath);
|
||||
remapper.readClassPath(modCompiles.toArray(new Path[0]));
|
||||
remapper.readClassPath(mc);
|
||||
|
||||
@@ -107,7 +107,7 @@ public class NestedJars {
|
||||
|
||||
for (Task task : remapJarTasks.isEmpty() ? jarTasks : remapJarTasks) {
|
||||
if (task instanceof RemapJarTask) {
|
||||
fileList.add(((RemapJarTask) task).getArchiveFile().get().getAsFile());
|
||||
fileList.add(((RemapJarTask) task).getArchivePath());
|
||||
} else if (task instanceof AbstractArchiveTask) {
|
||||
fileList.add(((AbstractArchiveTask) task).getArchivePath());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user