Update tiny-remapper, misc perf improvements, test fixes. (#1009)

* Only mixin remap/analyse classpath jars that use static mixin remappings.

* More of a mess

* Less of a mess?

* Nope?

* Exclude the none root MC jars from the remap classpath when using MPO

* Improve test a little

* Update TR

* Checkstyle

* Fix DLN test

* Fix possible crash when closing build services
This commit is contained in:
modmuss
2024-01-04 00:39:36 +00:00
committed by GitHub
parent c5d73548e7
commit 872d12ace0
10 changed files with 94 additions and 34 deletions

View File

@@ -26,6 +26,7 @@ package net.fabricmc.loom.task;
import javax.inject.Inject;
import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration;
@@ -70,8 +71,7 @@ public abstract class RemapTaskConfiguration implements Runnable {
return;
}
// Register the default remap jar task - must not be lazy to ensure that the prepare tasks get setup for other projects to depend on.
RemapJarTask remapJarTask = getTasks().create(REMAP_JAR_TASK_NAME, RemapJarTask.class, task -> {
Action<RemapJarTask> remapJarTaskAction = task -> {
final AbstractArchiveTask jarTask = getTasks().named(JavaPlugin.JAR_TASK_NAME, AbstractArchiveTask.class).get();
// Basic task setup
@@ -85,7 +85,14 @@ public abstract class RemapTaskConfiguration implements Runnable {
task.getInputFile().convention(jarTask.getArchiveFile());
task.dependsOn(getTasks().named(JavaPlugin.JAR_TASK_NAME));
task.getIncludesClientOnlyClasses().set(getProject().provider(extension::areEnvironmentSourceSetsSplit));
});
};
if (extension.multiProjectOptimisation()) {
// must not be lazy to ensure that the prepare tasks get setup for other projects to depend on.
getTasks().create(REMAP_JAR_TASK_NAME, RemapJarTask.class, remapJarTaskAction);
} else {
getTasks().register(REMAP_JAR_TASK_NAME, RemapJarTask.class, remapJarTaskAction);
}
// Configure the default jar task
getTasks().named(JavaPlugin.JAR_TASK_NAME, AbstractArchiveTask.class).configure(task -> {
@@ -93,7 +100,7 @@ public abstract class RemapTaskConfiguration implements Runnable {
task.getDestinationDirectory().set(getProject().getLayout().getBuildDirectory().map(directory -> directory.dir("devlibs")));
});
getTasks().named(BasePlugin.ASSEMBLE_TASK_NAME).configure(task -> task.dependsOn(remapJarTask));
getTasks().named(BasePlugin.ASSEMBLE_TASK_NAME).configure(task -> task.dependsOn(getTasks().named(REMAP_JAR_TASK_NAME)));
trySetupSourceRemapping();