Update IDEA run configuration generation
parent
c89344527b
commit
00382284fe
|
@ -167,11 +167,12 @@ public class GenIdeaProjectTask extends DefaultTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
IdeaRunConfig ideaClient = new IdeaRunConfig();
|
IdeaRunConfig ideaClient = new IdeaRunConfig();
|
||||||
ideaClient.mainClass = "net.fabricmc.base.launch.FabricClientMain ";
|
ideaClient.mainClass = "net.minecraft.launchwrapper.Launch";
|
||||||
ideaClient.projectName = getProject().getName();
|
ideaClient.projectName = getProject().getName();
|
||||||
ideaClient.configName = "Minecraft Client";
|
ideaClient.configName = "Minecraft Client";
|
||||||
ideaClient.runDir = "file://$PROJECT_DIR$/" + extension.runDir;
|
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));
|
runManager.appendChild(ideaClient.genRuns(runManager));
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,8 @@ public class IdeaRunConfig {
|
||||||
public String projectName;
|
public String projectName;
|
||||||
public String mainClass;
|
public String mainClass;
|
||||||
public String runDir;
|
public String runDir;
|
||||||
public String arguments;
|
public String vmArgs;
|
||||||
|
public String programArgs;
|
||||||
|
|
||||||
public Element genRuns(Element doc) throws IOException, ParserConfigurationException, TransformerException {
|
public Element genRuns(Element doc) throws IOException, ParserConfigurationException, TransformerException {
|
||||||
Element root = this.addXml(doc, "component", ImmutableMap.of("name", "ProjectRunConfigurationManager"));
|
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", "MAIN_CLASS_NAME", "value", mainClass));
|
||||||
this.addXml(root, "option", ImmutableMap.of("name", "WORKING_DIRECTORY", "value", runDir));
|
this.addXml(root, "option", ImmutableMap.of("name", "WORKING_DIRECTORY", "value", runDir));
|
||||||
|
|
||||||
if (!Strings.isNullOrEmpty(arguments)) {
|
if (!Strings.isNullOrEmpty(vmArgs)) {
|
||||||
this.addXml(root, "option", ImmutableMap.of("name", "PROGRAM_PARAMETERS", "value", arguments));
|
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;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue