libgdx / gdx-liftoff

A modern setup tool for libGDX Gradle projects
Apache License 2.0
524 stars 48 forks source link

Import to Eclipse Fails #162

Closed JojoIce closed 2 months ago

JojoIce commented 2 months ago

After importing a project created with the gdx-liftoff-1.12.1.10, it will fail with an error message:

Project at '.../projname' can't be named 'projname-parent' because it's located directly under the workspace root. If such a project is renamed, Eclipse would move the container directory. To resolve this problem, move the project out of the workspace root or configure it to have the name 'projname'.

In the /build.gradle

There is a line:

eclipse.project.name = 'projname' + '-parent'

If you remove the

This was detected using mac, OpenJDK 17 and Eclipse 2024-03 (4.31.0), but I imagine it goes for any import into Eclipse.

tommyettinger commented 2 months ago

I don't believe I changed anything with Eclipse-related settings... In fact, that same line you mentioned is present in the previous version, as I see in this project generated with 1.12.1.9: eclipse.project.name = 'Rocket' + '-parent'

I don't use Eclipse, but isn't the workspace something you share between projects? Could the issue be that the workspace only contains this project, rather than being an outer folder that can contain more than one?

JojoIce commented 2 months ago

A bit of investigation, and this is confusing. After all the chatter in this repo I was eager to see what you have done. I was waiting for other things and only access to my work laptop, so I tested on that one with the results as above. Now I have tested it on my private game dev machine, and everything works normally. It is the same OS, java, Eclipse and liftoff versions, but the behaviour is different. I tried with v. 1.12.1.8 on work laptop and it was the same strange behaviour. I will try with a fresh version of Eclipse on the machine with the issues and report.

tommyettinger commented 2 months ago

You can try checking your preferences for Liftoff, on MacOS they're a text file in ~/.prefs I believe. I don't know what else could be different... Maybe Eclipse settings?

JojoIce commented 2 months ago

I cannot figure out why this happens. I have installed a fresh Eclipse on both machines and I have the same Java version and only use the Gradle wrapper. The .pref file looks OK, and still I see different behaviour on the two machines. Stack Overflow had some old threads regarding this, but nothing that fixed the issue other than the change that I mentioned in the first post works. And it works without problems on my game dev machine right away. Not sure what to do with this. Probably just as well to close this. The workaround is in the first post just in case someone else has the same problem, so that is maybe it.

tommyettinger commented 2 months ago

Well, that's quite the mystery... I guess I will close this, since even your second machine can't reproduce the issue. It would be nice to know what was going on, but that's not likely with my low experience level debugging Eclipse issues.