plugins { id("java-library") id("com.github.johnrengelman.shadow") version "8.1.1" } group = "com.garbagemule" version = "0.108" repositories { mavenLocal() maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") maven("https://jitpack.io") maven("https://repo.maven.apache.org/maven2/") } dependencies { compileOnly("org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT") compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") api("org.bstats:bstats-bukkit:2.2.1") testImplementation("junit:junit:4.13.2") testImplementation("org.hamcrest:hamcrest-all:1.3") testImplementation("org.mockito:mockito-core:3.12.4") } java { toolchain { languageVersion.set(JavaLanguageVersion.of(8)) } } sourceSets { test { // This is a bit of a hack. It ensures that the dependencies for the // "main" source set are available to the test suite. Without it, the // dependencies would have to be listed twice, and even that doesn't // seem to work with the currently used version of Mockito. configurations.testImplementation.configure { extendsFrom(configurations.compileOnly.get()) } } } tasks { processResources { filesMatching("plugin.yml") { expand("project" to mapOf( "name" to "MobArena", "version" to version, )) } } shadowJar { minimize() relocate("org.bstats", "com.garbagemule.MobArena.metrics") archiveBaseName = "MobArena" archiveClassifier = "" } // We're using shadowJar, so we can skip the regular jar task. jar { enabled = false } // Let the build task produce the final artifact. build { dependsOn(shadowJar) } }