fix IDE generation file paths assuming CWD == project root, close #72

This commit is contained in:
Adrian Siekierka 2019-04-21 11:48:00 +02:00
parent bed0bba2da
commit 07ab36a97d
3 changed files with 4 additions and 4 deletions

View file

@ -58,7 +58,7 @@ public class GenIdeaProjectTask extends DefaultLoomTask {
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
project.getLogger().lifecycle(":Building idea workspace");
File file = new File(project.getName() + ".iws");
File file = project.file(project.getName() + ".iws");
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.parse(file);

View file

@ -46,7 +46,7 @@ public class GenVsCodeProjectTask extends DefaultLoomTask {
@TaskAction
public void genRuns() {
LoomGradleExtension extension = getProject().getExtensions().getByType(LoomGradleExtension.class);
File projectDir = new File(".vscode");
File projectDir = getProject().file(".vscode");
if (!projectDir.exists()) {
projectDir.mkdir();
}

View file

@ -38,7 +38,7 @@ public class SetupIntelijRunConfigs {
public static void setup(Project project) {
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
File projectDir = new File(".idea");
File projectDir = project.file(".idea");
if(!projectDir.exists()){
return;
}
@ -61,7 +61,7 @@ public class SetupIntelijRunConfigs {
MinecraftAssetsProvider.provide(extension.getMinecraftProvider(), project);
}
File projectDir = new File(".idea");
File projectDir = project.file(".idea");
File runConfigsDir = new File(projectDir, "runConfigurations");
File clientRunConfigs = new File(runConfigsDir, "Minecraft_Client.xml");
File serverRunConfigs = new File(runConfigsDir, "Minecraft_Server.xml");