mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 13:37:45 -05:00
Separate Forge runtime into its own subproject
This commit is contained in:
@@ -136,7 +136,8 @@ public class LaunchProvider extends DependencyProvider {
|
||||
annotationDependency = addDependency(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS, JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME);
|
||||
|
||||
if (getExtension().isForge()) {
|
||||
addDependency(Constants.Dependencies.JAVAX_ANNOTATIONS + Constants.Dependencies.Versions.JAVAX_ANNOTATIONS, "compileOnly");
|
||||
addDependency(Constants.Dependencies.FORGE_RUNTIME + Constants.Dependencies.Versions.FORGE_RUNTIME, JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME);
|
||||
addDependency(Constants.Dependencies.JAVAX_ANNOTATIONS + Constants.Dependencies.Versions.JAVAX_ANNOTATIONS, JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME);
|
||||
}
|
||||
|
||||
postPopulationScheduler.accept(this::writeRemapClassPath);
|
||||
|
||||
@@ -339,25 +339,6 @@ public class MinecraftPatchedProvider extends DependencyProvider {
|
||||
copyAll(getExtension().getForgeUniversalProvider().getForge(), environment.patchedSrgJar.apply(this));
|
||||
copyUserdevFiles(getExtension().getForgeUserdevProvider().getUserdevJar(), environment.patchedSrgJar.apply(this));
|
||||
});
|
||||
|
||||
logger.lifecycle(":injecting loom classes into minecraft");
|
||||
File injection = File.createTempFile("loom-injection", ".jar");
|
||||
|
||||
try (InputStream in = MinecraftProvider.class.getResourceAsStream("/inject/injection.jar")) {
|
||||
FileUtils.copyInputStreamToFile(in, injection);
|
||||
}
|
||||
|
||||
for (Environment environment : Environment.values()) {
|
||||
String side = environment.side();
|
||||
File target = environment.patchedSrgJar.apply(this);
|
||||
walkFileSystems(injection, target, it -> {
|
||||
if (it.getFileName().toString().equals("MANIFEST.MF")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return getExtension().useFabricMixin || !it.getFileName().toString().endsWith("cpw.mods.modlauncher.api.ITransformationService");
|
||||
}, this::copyReplacing);
|
||||
}
|
||||
}
|
||||
|
||||
private void accessTransformForge(Logger logger) throws Exception {
|
||||
|
||||
@@ -91,6 +91,7 @@ public class Constants {
|
||||
public static final String TERMINAL_CONSOLE_APPENDER = "net.minecrell:terminalconsoleappender:";
|
||||
public static final String JETBRAINS_ANNOTATIONS = "org.jetbrains:annotations:";
|
||||
public static final String JAVAX_ANNOTATIONS = "com.google.code.findbugs:jsr305:"; // I hate that I have to add these.
|
||||
public static final String FORGE_RUNTIME = "dev.architectury:architectury-loom-forge-runtime:";
|
||||
|
||||
private Dependencies() {
|
||||
}
|
||||
@@ -104,6 +105,7 @@ public class Constants {
|
||||
public static final String TERMINAL_CONSOLE_APPENDER = "1.2.0";
|
||||
public static final String JETBRAINS_ANNOTATIONS = "19.0.0";
|
||||
public static final String JAVAX_ANNOTATIONS = "3.0.2";
|
||||
public static final String FORGE_RUNTIME = "$LOOM_VERSION"; // replaced with current version at build time
|
||||
|
||||
private Versions() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user