aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-12-03 11:27:06 +0200
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-12-03 11:27:06 +0200
commit53790222956045e6c4d684936f61093dedfc77a2 (patch)
treeb573f28f068de1384539be424ad66dbbf85f7624 /src/main
parent064d4051d597598f703453606915ea35b3c7ee3c (diff)
downloadarchitectury-loom-53790222956045e6c4d684936f61093dedfc77a2.tar.gz
architectury-loom-53790222956045e6c4d684936f61093dedfc77a2.tar.bz2
architectury-loom-53790222956045e6c4d684936f61093dedfc77a2.zip
Add the build outputs to the run config as MOD_CLASSES
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/fabricmc/loom/util/RunConfig.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/net/fabricmc/loom/util/RunConfig.java b/src/main/java/net/fabricmc/loom/util/RunConfig.java
index 0a45c884..03829489 100644
--- a/src/main/java/net/fabricmc/loom/util/RunConfig.java
+++ b/src/main/java/net/fabricmc/loom/util/RunConfig.java
@@ -42,6 +42,8 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
+import org.gradle.api.tasks.Copy;
+import org.gradle.api.tasks.compile.JavaCompile;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -130,6 +132,20 @@ public class RunConfig {
runConfig.vmArgs = "-Dfabric.dli.config=" + encodeEscaped(extension.getDevLauncherConfig().getAbsolutePath()) + " -Dfabric.dli.env=" + mode.toLowerCase();
}
+ if (extension.isForge()) {
+ StringBuilder modClasses = new StringBuilder();
+
+ modClasses.append("loom%%");
+ modClasses.append(((Copy) project.getTasks().getByName("processResources")).getDestinationDir().getAbsolutePath());
+ modClasses.append(';');
+ modClasses.append("loom%%");
+ // This *should* include Kotlin as well AFAIK.
+ modClasses.append(((JavaCompile) project.getTasks().getByName("compileJava")).getDestinationDir().getAbsolutePath());
+ modClasses.append(';');
+
+ runConfig.envVariables.put("MOD_CLASSES", modClasses.toString());
+ }
+
if (extension.getLoaderLaunchMethod().equals("launchwrapper")) {
// if installer.json found...
JsonObject installerJson = extension.getInstallerJson();