neoforged / NeoGradle

Gradle plugin for NeoForge development
GNU Lesser General Public License v2.1
37 stars 23 forks source link

Run configurations generated with incorrect output directory #103

Open SquidDev opened 6 months ago

SquidDev commented 6 months ago

https://github.com/neoforged/NeoGradle/blob/96d3cf8699f31721b57170eb7f719e6cb64e3ef9/common/src/main/java/net/neoforged/gradle/common/util/run/RunsUtil.java#L92-L96

When getRunWithIdea is enabled in the IDEA run configuration, NG will specify that classes should be loaded from IntelliJ's output directory instead of Gradle's. However, the way classes within that directory are found doesn't appear to be correct when working with a multi-module setup:

Thinking about this more generally, I'm not entirely sure that configuring the output directory (or getRunWithIdea via Gralde) is the correct thing to do. Both those properties are workspace/user specific, and (as far as I know) cannot be controlled by Gradle.

I wonder if a better option would be to read IDEA's config directly - this is what Loom does, and it works pretty reliably.

I'm happy to take a look at a PR for this if that sounds reasonable?

marchermans commented 1 month ago

Yes sure, a PR for this is welcome!