mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-22 10:36:00 +01:00
4c855e6705
Removes the "archive version" override for the `shadowJar` task in the build file, resulting in a jar-file that contains the current version number in the filename. It's mostly a convenience tradeoff; either we can see the version directly in the filename and avoid assumptions, or we can easily overwrite an existing jar-file with a new one. Also updates the upload step of the build workflow to a glob pattern so we grab the file regardless of the version.
69 lines
1.8 KiB
Plaintext
69 lines
1.8 KiB
Plaintext
plugins {
|
|
id("java-library")
|
|
id("com.github.johnrengelman.shadow") version "8.1.1"
|
|
}
|
|
|
|
group = "com.garbagemule"
|
|
version = "0.107.1-SNAPSHOT"
|
|
|
|
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) }
|
|
}
|