FabricMC / fabric-loom

Gradle build system plugin used to automate the setup of a minecraft mod development environment.
MIT License
241 stars 211 forks source link

IntelliJ run configs don't have the client sourceset of subproject dependencies on the classpath #919

Closed Fuyukai closed 1 year ago

Fuyukai commented 1 year ago
  1. Setup multi-project layout with two projects, Parent and Child. (Both with split source sets).
  2. Put a client initialiser in Parent, and add it to the mod json.
  3. Have Child depend on Parent: implementation(project(":parent-project", configuration = "namedElements"))
  4. Run the client run config in the Client project from IntelliJ.
  5. Cue NoClassDefFound explosion.

Running the :sub-project:runClient gradle task works fine. A nice self-contained repro can be found here.

modmuss50 commented 1 year ago

You will also need to add clientImplementation project(":parent-project").sourceSets.client.output to your dependencies.

Fuyukai commented 1 year ago

It would be appreciated if that was documented somewhere, because as far as I can tell it very much is not.

modmuss50 commented 1 year ago

clientImplementation project(":parent-project").sourceSets.client.output

Good idea, I have added this to the loom wiki page here: https://fabricmc.net/wiki/documentation:fabric_loom