MinecraftForge / ForgeGradle

Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
508 stars 436 forks source link

Multiple subproject `minecraft` configurations are not supported #844

Open mezz opened 2 years ago

mezz commented 2 years ago

Issue Source

from https://github.com/MinecraftForge/ForgeGradle/commit/17da7eb1b648283217512ec21868b19995ed0be1

Seems gradle/Artifactual only supports ONE custom repo at a time. So everything is now added to a single wrapper repo.

Bug Description

When I tried setting up a gradle multi-project with subprojects Forge and ForgeApi, I had the same Minecraft version and mappings, but the Forge one was configured with ATs and the ForgeApi one was not. This led to a failure:

Execution failed for task ':ForgeApi:compileJava'.
> Could not resolve all files for configuration ':ForgeApi:compileClasspath'.
   > Could not find net.minecraftforge:forge:1.18.2-40.0.18_mapped_official_1.18.2.
     Required by:
         project :ForgeApi

Workaround

This issue is unlikely to be fixed because it's difficult and there is a known workaround.

The workaround is to apply the same ATs so that both minecraft configurations are identical. That way it still works even when ForgeGradle is using the "wrong" minecraft resource for the ForgeApi subproject.

heipiao233 commented 2 years ago

You can try to use multi sourceSets.