plugins {
    id 'java'
    id 'com.gradleup.shadow' version "8.3.5"
}

group = 'com.moud'
version = '0.1.0-alpha'

repositories {
    mavenCentral()
    maven {
        url = "https://repo.minestom.com/"
    }
    maven {
        url = "https://repo.smolder.cloud/public/"
    }
}

dependencies {
    implementation project(':api')
    implementation project(':network-engine')

    implementation("fr.ghostrider584:axiom-minestom:0.0.2")

    implementation('net.minestom:minestom-snapshots:f966351cb7') {
        exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j2-impl'
    }
    implementation 'ch.qos.logback:logback-classic:1.4.14'
    implementation 'org.graalvm.polyglot:polyglot:24.1.0'
    implementation 'org.graalvm.polyglot:js:24.1.0'
    implementation 'com.fasterxml.jackson.core:jackson-core:2.17.0'
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.0'
    implementation 'com.fasterxml.jackson.core:jackson-annotations:2.17.0'
    implementation 'org.apache.commons:commons-exec:1.4.0'
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
}

jar {
    manifest {
        attributes["Main-Class"] = "com.moud.App"
    }
}

shadowJar {
    mergeServiceFiles()
    archiveBaseName.set("moud-server")
    archiveClassifier.set("")
    archiveVersion.set("")
    manifest {
        attributes["Main-Class"] = "com.moud.App"
    }
}


build {
    dependsOn(shadowJar)
}