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

loom {
    forge {
        mixinConfig "taczjs.mixins.json"
    }
}

architectury {
    platformSetupLoomIde()
    forge()
}

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

dependencies {
    forge "net.minecraftforge:forge:$rootProject.forge_version"

    modImplementation "curse.maven:timeless-and-classics-zero-1028108:$rootProject.tacz_forge_version"
    modImplementation "dev.latvian.mods:kubejs-forge:${rootProject.kubejs_version}"

    // Dev dependencies
    localRuntime("io.github.llamalad7:mixinextras-forge:0.3.6")
    forgeRuntimeLibrary 'org.apache.commons:commons-math3:3.6.1'
    forgeRuntimeLibrary 'com.github.FiguraMC.luaj:luaj-jse:3.0.8-figura'
    forgeRuntimeLibrary 'com.github.FiguraMC.luaj:luaj-core:3.0.8-figura'
    modLocalRuntime 'curse.maven:playeranimator-658587:4587214'
    modLocalRuntime("mezz.jei:jei-$rootProject.minecraft_version-forge:$rootProject.jei_version") { transitive = false }

    common(project(path: ':common', configuration: 'namedElements')) { transitive false }
    shadowBundle project(path: ':common', configuration: 'transformProductionForge')
}

processResources {
    inputs.property 'version', project.version

    filesMatching('META-INF/mods.toml') {
        expand version: project.version
    }
    from(rootProject.file("assets/icon-128x128.png")) {
        rename { "$rootProject.archives_name-icon.png" }
    }
}

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

remapJar {
    input.set shadowJar.archiveFile
}
