Skip to content

Commit 85cf8c8

Browse files
committed
added debug tasks
1 parent a5d1572 commit 85cf8c8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/main/java/net/minecraftforge/gradle/user/UserBasePlugin.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,37 @@ private void delayedTasks()
297297

298298
exec.dependsOn(jarTask);
299299
}
300+
301+
exec = makeTask("debugClient", JavaExec.class);
302+
{
303+
exec.classpath(project.getConfigurations().getByName("runtime"));
304+
exec.classpath(jarTask.getArchivePath());
305+
exec.setMain("net.minecraft.launchwrapper.Launch");
306+
exec.jvmArgs("-Xincgc", "-Xmx1024M", "-Xms1024M", "-Dfml.ignoreInvalidMinecraftCertificates=true");
307+
exec.jvmArgs("-Djava.library.path=" + delayedFile(NATIVES_DIR).call().getAbsolutePath());
308+
exec.args("--version 1.7", "--tweakClass", "cpw.mods.fml.common.launcher.FMLTweaker", "--username=ForgeDevName", "--accessToken", "FML");
309+
exec.setWorkingDir(delayedFile("{ASSET_DIR}").call().getParentFile());
310+
exec.setStandardOutput(System.out);
311+
exec.setErrorOutput(System.err);
312+
exec.setDebug(true);
313+
314+
exec.dependsOn(jarTask);
315+
}
316+
317+
exec = makeTask("debugServer", JavaExec.class);
318+
{
319+
exec.classpath(project.getConfigurations().getByName("runtime"));
320+
exec.classpath(jarTask.getArchivePath());
321+
exec.setMain("cpw.mods.fml.relauncher.ServerLaunchWrapper");
322+
exec.jvmArgs("-Xincgc", "-Dfml.ignoreInvalidMinecraftCertificates=true");
323+
exec.setWorkingDir(delayedFile("{ASSET_DIR}").call().getParentFile());
324+
exec.setStandardOutput(System.out);
325+
exec.setStandardInput(System.in);
326+
exec.setErrorOutput(System.err);
327+
exec.setDebug(true);
328+
329+
exec.dependsOn(jarTask);
330+
}
300331
}
301332

302333
protected abstract void doPostDecompTasks(boolean isClean, DelayedFile decompOut);

0 commit comments

Comments
 (0)