Skip to content

Conversation

@Jonathing
Copy link
Member

Name entails. This task is largely a copy of SlimeLauncherExec but with the sole purpose to create the launch file that Eclipse will use.

Still a work in progress, including managing the classpath.

@Jonathing Jonathing added this to the 7.0.0-rc.0 milestone Nov 6, 2025
@Jonathing Jonathing requested a review from LexManos November 6, 2025 14:01
@Jonathing Jonathing self-assigned this Nov 6, 2025
@Jonathing
Copy link
Member Author

I am marking this PR as ready for review. The run configurations generate and work well.

However, I must state one big caveat: this run configuration is using the runtime classpath as stated by Gradle. Even though I am defining it all in the run task, that does mean that bin is not the classpath for the compiled mod classes, but rather build/sourceSets/main. I'm looking into how I can hook the Eclipse compiler to output to that directory (hopefully Buildship does that part for me already).

@Jonathing Jonathing marked this pull request as ready for review November 6, 2025 15:34
@LexManos
Copy link
Member

LexManos commented Nov 6, 2025

Is there any particular reason you're specify the classpath at all?
Letting gradle/eclipse manage that seems to be the best option.
The issue arrives with older versions when we need to specify custom module arguments but thats something we can address when the time comes.

@Jonathing
Copy link
Member Author

Slime Launcher is not a part of the runtime classpath, it is added to it as part of its run task.

Aside from that, I don't trust what Buildship thinks the output directories are. Don't forget, we also talked about how Buildship has the tendency to combine the compile and runtime classpaths. I just don't think it's a risk worth taking.

The run configuration simply has all the information the run task would have used.

@LexManos
Copy link
Member

LexManos commented Nov 6, 2025

As long as it works, then im fine with it, Just a bit worried about it using the incorrect directory for the project's path.
Does hot swapping work correctly?

@Jonathing
Copy link
Member Author

Don't know yet. I need to check what the ECJ's output folder is, which I hope Buildship takes care of. If not, I can probably change it through Gradle's Eclipse plugin.

Once I confirm hotswapping works, I will merge this.

@Jonathing
Copy link
Member Author

Alright, I've come up with a workaround to the Eclipse output directory issue for now.

If ForgeGradle is configured to merge source sets (via the property in gradle.properties), it will automatically set the default output directory to the unified source sets directory (build/sourceSets). When ForgeGradle creates the Eclipse run configurations, it will remove the destination directories for the Gradle source set's java and resources and add the Eclipse default destination directory instead. This isn't a perfect solution but I don't expect anyone to manually change the output directory for Eclipse's compiler.

Do note one limitation of this workaround: if you build using Gradle then launch the game, but save a file in Eclipse, the hotswap won't work. So you need to save/build the project in Eclipse before running the game. I think this is a fair drawback, but let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants