plugins {
    id 'multiloader-common'
    id 'net.neoforged.moddev'
}

neoForge {
    neoFormVersion = neo_form_version
    // Automatically enable AccessTransformers if the file exists
    def at = project.file('src/main/resources/META-INF/accesstransformer.cfg')
    if (at.exists()) {
        accessTransformers.from(at.absolutePath)
    }
    parchment {
        minecraftVersion = parchment_minecraft
        mappingsVersion = parchment_version
    }
}

dependencies {
    compileOnly 'org.spongepowered:mixin:0.8.5'
    // fabric and neoforge both bundle mixinextras, so it is safe to use it in common
    compileOnly group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'
    annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'

    compileOnly 'org.jetbrains:annotations:24.0.1'
    api "gg.moonflower:molang-compiler:${molang_compiler_version}"
    api "io.github.ocelot:glsl-processor:${glsl_processor_version}"

    api "io.github.spair:imgui-java-binding:$imgui_version"
    api("io.github.spair:imgui-java-lwjgl3:$imgui_version") {
        exclude group: 'org.lwjgl'
        exclude group: 'org.lwjgl.lwjgl'
    }

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
    testRuntimeOnly 'com.mojang:datafixerupper:8.0.16'
    testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j2-impl:2.23.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

test {
    useJUnitPlatform()
}

configurations {
    commonJava {
        canBeResolved = false
        canBeConsumed = true
    }
    commonResources {
        canBeResolved = false
        canBeConsumed = true
    }
}

artifacts {
    commonJava sourceSets.main.java.sourceDirectories.singleFile
    commonResources sourceSets.main.resources.sourceDirectories.singleFile
}