Skip to content

Commit 340dcac

Browse files
committed
Fix eclipse location with spaces issue, and throw exception if current path contains a ! as it will screw over a lot of java's paths.
1 parent ec4fd41 commit 340dcac

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/net/minecraftforge/gradle/common/BasePlugin.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public final void apply(Project arg)
4848
project.getLogging().addStandardErrorListener(listenner);
4949
project.getGradle().addBuildListener(listenner);
5050

51+
if (project.getBuildDir().getAbsolutePath().contains("!"))
52+
{
53+
project.getLogger().error("Build path has !, This will screw over a lot of java things as ! is used to denote archive paths, REMOVE IT if you want to continue");
54+
throw new RuntimeException("Build path contains !");
55+
}
56+
5157
// extension objects
5258
project.getExtensions().create(Constants.EXT_NAME_MC, getExtensionClass(), project);
5359
project.getExtensions().create(Constants.EXT_NAME_JENKINS, JenkinsExtension.class, project);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,9 @@ public void finalCall()
838838
protected void fixEclipseProject(String path)
839839
{
840840
File f = new File(path);
841-
if (f.exists() && f.length() == 0)
841+
if (f.exists())// && f.length() == 0)
842842
{
843-
String projectDir = "URI//file:/" + project.getProjectDir().getAbsolutePath().replace('\\', '/');
843+
String projectDir = "URI//" + project.getProjectDir().toURI().toString();
844844
try
845845
{
846846
FileOutputStream fos = new FileOutputStream(f);

0 commit comments

Comments
 (0)