fix IDE generation file paths assuming CWD == project root, close #72
parent
bed0bba2da
commit
07ab36a97d
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue