mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 13:37:45 -05:00
Fix client remap classpath.
This commit is contained in:
@@ -37,6 +37,7 @@ import org.gradle.api.tasks.SourceSet;
|
||||
import org.gradle.jvm.tasks.Jar;
|
||||
|
||||
import net.fabricmc.loom.LoomGradleExtension;
|
||||
import net.fabricmc.loom.task.AbstractRemapJarTask;
|
||||
import net.fabricmc.loom.util.Constants;
|
||||
|
||||
public abstract sealed class MinecraftSourceSets permits MinecraftSourceSets.Single, MinecraftSourceSets.Split {
|
||||
@@ -201,6 +202,13 @@ public abstract sealed class MinecraftSourceSets permits MinecraftSourceSets.Sin
|
||||
jar.from(clientOnlySourceSet.getOutput().getResourcesDir());
|
||||
});
|
||||
|
||||
// Remap with the client compile classpath.
|
||||
project.getTasks().withType(AbstractRemapJarTask.class).configureEach(remapJarTask -> {
|
||||
remapJarTask.getClasspath().from(
|
||||
project.getConfigurations().getByName(clientOnlySourceSet.getCompileClasspathConfigurationName())
|
||||
);
|
||||
});
|
||||
|
||||
if (project.getTasks().findByName(mainSourceSet.getSourcesJarTaskName()) == null) {
|
||||
// No sources.
|
||||
return;
|
||||
|
||||
@@ -26,6 +26,7 @@ package net.fabricmc.loom.task.service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -85,7 +86,7 @@ public class TinyRemapperService implements SharedService {
|
||||
return new TinyRemapperService(mappings, !legacyMixin, kotlinClasspathService);
|
||||
});
|
||||
|
||||
service.readClasspath(remapJarTask.getClasspath().getFiles().stream().map(File::toPath).toList());
|
||||
service.readClasspath(remapJarTask.getClasspath().getFiles().stream().map(File::toPath).filter(Files::exists).toList());
|
||||
|
||||
return service;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user