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

allprojects {
    group = "${group}"
    version = "${version}"

    repositories {
        mavenCentral()
        maven {
            name = "papermc-repo"
            url = "https://repo.papermc.io/repository/maven-public/"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/groups/public/"
        }
        maven { url 'https://velocitypowered.com/maven/' }
    }
}

subprojects {
    tasks.withType(Jar).tap {
        configureEach {
            archiveBaseName.set("${rootProject.name}-${project.name}")
        }
    }
}



// Build fat jar with everything in it using shadowJar

dependencies {
    implementation project(":common")
    implementation project(":papermc")
    implementation project(":velocity")
    implementation project(":fabric")
}

shadowJar {
    manifest {
        attributes(
                'Main-Class': 'me.artificial.autoserver.common.BootListener'
        )
    }
    archiveFileName.set("${rootProject.name}-${version}-all--shadow.jar")
}