plugins {
    id "com.github.johnrengelman.shadow"
}

architectury {
    platformSetupLoomIde()
    neoForge()
}

configurations {
    common {
        canBeResolved = true
        canBeConsumed = false
    }
    compileClasspath.extendsFrom common
    runtimeClasspath.extendsFrom common
    developmentNeoForge.extendsFrom common

    // Files in this configuration will be bundled into your mod using the Shadow plugin.
    // Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
    shadowBundle {
        canBeResolved = true
        canBeConsumed = false
    }
}

repositories {
    maven {
        name = "NeoForged"
        url = "https://maven.neoforged.net/releases"
    }
}

dependencies {
    neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}"

    common(project(path: ":xplat", configuration: "namedElements")) { transitive false }
    shadowBundle(project(path: ":xplat", configuration: "transformProductionNeoForge"))

    modCompileOnly "dev.emi:emi-neoforge:${project.emi_version}:api"
    modLocalRuntime "dev.emi:emi-neoforge:${project.emi_version}"
}

processResources {
    filesMatching("META-INF/neoforge.mods.toml") {
        expand project.properties
    }
}

shadowJar {
    configurations = [project.configurations.shadowBundle]
    archiveClassifier = "dev-shadow"
}

remapJar {
    input.set shadowJar.archiveFile
}
