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

architectury {
    platformSetupLoomIde()
    fabric()
}

configurations {
    common {
        canBeResolved = true
        canBeConsumed = false
    }
    compileClasspath.extendsFrom common
    runtimeClasspath.extendsFrom common
    developmentFabric.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
    }
}

dependencies {
    modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
    modImplementation "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"

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

    modCompileOnly "dev.emi:emi-fabric:${rootProject.emi_version}:api"
    modLocalRuntime "dev.emi:emi-fabric:${rootProject.emi_version}"
}

processResources {
    filesMatching("fabric.mod.json") {
        expand project.properties
    }
}

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

remapJar {
    input.set shadowJar.archiveFile
}
