Update IDEA run configuration generation

dev/0.11
Shadowfacts 2016-08-17 10:45:04 -04:00
parent c89344527b
commit 00382284fe
No known key found for this signature in database
GPG Key ID: F802198A7D7F309D
2 changed files with 11 additions and 5 deletions

View File

@ -167,11 +167,12 @@ public class GenIdeaProjectTask extends DefaultTask {
}
IdeaRunConfig ideaClient = new IdeaRunConfig();
ideaClient.mainClass = "net.fabricmc.base.launch.FabricClientMain ";
ideaClient.mainClass = "net.minecraft.launchwrapper.Launch";
ideaClient.projectName = getProject().getName();
ideaClient.configName = "Minecraft Client";
ideaClient.runDir = "file://$PROJECT_DIR$/" + extension.runDir;
ideaClient.arguments = "--assetIndex " + version.assetIndex.id + " --assetsDir " + new File(Constants.CACHE_FILES, "assets").getAbsolutePath();
ideaClient.vmArgs = "-Djava.library.path=../.gradle/minecraft/natives/ -Dfabric.development=true";
ideaClient.programArgs = "--tweakClass net.fabricmc.base.launch.FabricClientTweaker --assetIndex " + version.assetIndex.id + " --assetsDir " + new File(Constants.CACHE_FILES, "assets").getAbsolutePath();
runManager.appendChild(ideaClient.genRuns(runManager));

View File

@ -40,7 +40,8 @@ public class IdeaRunConfig {
public String projectName;
public String mainClass;
public String runDir;
public String arguments;
public String vmArgs;
public String programArgs;
public Element genRuns(Element doc) throws IOException, ParserConfigurationException, TransformerException {
Element root = this.addXml(doc, "component", ImmutableMap.of("name", "ProjectRunConfigurationManager"));
@ -50,8 +51,12 @@ public class IdeaRunConfig {
this.addXml(root, "option", ImmutableMap.of("name", "MAIN_CLASS_NAME", "value", mainClass));
this.addXml(root, "option", ImmutableMap.of("name", "WORKING_DIRECTORY", "value", runDir));
if (!Strings.isNullOrEmpty(arguments)) {
this.addXml(root, "option", ImmutableMap.of("name", "PROGRAM_PARAMETERS", "value", arguments));
if (!Strings.isNullOrEmpty(vmArgs)) {
this.addXml(root, "option", ImmutableMap.of("name", "VM_PARAMETERS", "value", vmArgs));
}
if (!Strings.isNullOrEmpty(programArgs)) {
this.addXml(root, "option", ImmutableMap.of("name", "PROGRAM_PARAMETERS", "value", programArgs));
}
return root;
}