Run validate access widener task before genSources. Closes #550

dev/0.11
modmuss50 2021-12-04 14:39:12 +00:00
parent 6d65e120e7
commit efddf8f35c
1 changed files with 11 additions and 8 deletions

View File

@ -29,6 +29,7 @@ import java.io.File;
import com.google.common.base.Preconditions;
import org.gradle.api.Project;
import org.gradle.api.tasks.TaskContainer;
import org.gradle.api.tasks.TaskProvider;
import net.fabricmc.loom.LoomGradleExtension;
import net.fabricmc.loom.api.decompilers.LoomDecompiler;
@ -56,12 +57,12 @@ public final class LoomTasks {
tasks.register("downloadAssets", DownloadAssetsTask.class, t -> t.setDescription("Downloads required assets for Fabric."));
tasks.register("remapSourcesJar", RemapSourcesJarTask.class, t -> t.setDescription("Remaps the project sources jar to intermediary names."));
tasks.getByName("check").dependsOn(
tasks.register("validateAccessWidener", ValidateAccessWidenerTask.class, t -> {
TaskProvider<ValidateAccessWidenerTask> validateAccessWidener = tasks.register("validateAccessWidener", ValidateAccessWidenerTask.class, t -> {
t.setDescription("Validate all the rules in the access widener against the Minecraft jar");
t.setGroup("verification");
})
);
});
tasks.named("check").configure(task -> task.dependsOn(validateAccessWidener));
registerIDETasks(tasks);
registerRunTasks(tasks, project);
@ -155,8 +156,10 @@ public final class LoomTasks {
task.getInputJar().set(inputJar);
if (mappingsProvider.hasUnpickDefinitions()) {
task.dependsOn(tasks.getByName("unpickJar"));
task.dependsOn(tasks.named("unpickJar"));
}
task.dependsOn(tasks.named("validateAccessWidener"));
});
}
@ -164,7 +167,7 @@ public final class LoomTasks {
task.setDescription("Decompile minecraft using the default decompiler.");
task.setGroup(Constants.TaskGroup.FABRIC);
task.dependsOn(project.getTasks().getByName("genSourcesWithCfr"));
task.dependsOn(project.getTasks().named("genSourcesWithCfr"));
});
});
}