plugins {
    id 'java'
    id 'com.gradleup.shadow' version '9.0.0-beta4'
}

repositories {
    mavenCentral()
    maven {
        name = 'Fabric'
        url = 'https://maven.fabricmc.net/'
    }
}

dependencies {
    implementation project(":common")

    // Fabric Loader
    compileOnly "net.fabricmc:fabric-loader:${project.loader_version}"
    // Fabric API
    compileOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}

processResources {
    def props = [version          : version,
                 authors          : author,
                 description      : project.description,
                 minecraft_versions: project.fabric_minecraft_versions,
                 loader_version   : project.loader_version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching("fabric.mod.json") {
        expand props
    }
}


shadowJar {
    manifest {
        attributes('Main-Class': 'me.artificial.autoserver.common.BootListener')
    }

    archiveFileName.set("${rootProject.name}-${project.name}-${version}--shadow.jar")
}
