FabricMC / fabric-loom

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

Fabric in the subproject is incompatible root project kotlin plugin with Kotlin 2.0.0 #1122

Closed bluegreensea closed 1 month ago

bluegreensea commented 1 month ago

About: https://github.com/FabricMC/fabric/issues/3788

When kotlin plugin is in the fabric subproject is also fine, but failed in this situation

Here is a simple project to test: test.zip

modmuss50 commented 1 month ago

As I said in the first issue you are not applying the plugins correctly as detailed in the gradle docs here: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl

Once I make that change the project you provided works as expected.

build.gradle.kts:

plugins {
    kotlin("jvm") version "2.0.0"
    id("fabric-loom") version "1.6-SNAPSHOT" apply false
}

fabric/build.gradle.kts:

plugins {
    id("fabric-loom")
}

settings.gradle.kts:

pluginManagement {
    repositories {
        mavenCentral()
        maven("https://maven.fabricmc.net") { name = "Fabric" }
    }
}

rootProject.name = "Test"

include("fabric")

You MUST have all the projects defined in the root project, even if they arent applied.