2023-03-17 19:25:47 +01:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
`java-library`
|
|
|
|
`maven-publish`
|
|
|
|
id("com.github.hierynomus.license") version "0.16.1"
|
|
|
|
id("com.github.johnrengelman.shadow") version "8.1.0"
|
|
|
|
}
|
|
|
|
|
|
|
|
group = "me.clip"
|
2023-10-28 15:50:05 +02:00
|
|
|
version = "2.11.6-DEV-${System.getProperty("BUILD_NUMBER")}"
|
2023-03-17 19:25:47 +01:00
|
|
|
|
|
|
|
description = "An awesome placeholder provider!"
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
|
|
|
|
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
|
|
|
|
maven("https://repo.codemc.org/repository/maven-public/")
|
|
|
|
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation("org.bstats:bstats-bukkit:3.0.1")
|
2023-10-28 15:42:18 +02:00
|
|
|
implementation("net.kyori:adventure-platform-bukkit:4.3.1")
|
2023-03-17 19:25:47 +01:00
|
|
|
|
2023-06-10 18:13:10 +02:00
|
|
|
compileOnly("org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT")
|
2023-03-17 19:25:47 +01:00
|
|
|
compileOnlyApi("org.jetbrains:annotations:23.0.0")
|
|
|
|
|
|
|
|
testImplementation("org.openjdk.jmh:jmh-core:1.32")
|
|
|
|
testImplementation("org.openjdk.jmh:jmh-generator-annprocess:1.32")
|
|
|
|
|
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.2")
|
|
|
|
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
|
|
|
|
withJavadocJar()
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
|
|
|
|
license {
|
|
|
|
header = rootProject.file("config/headers/main.txt")
|
|
|
|
|
|
|
|
include("**/*.java")
|
|
|
|
mapping("java", "JAVADOC_STYLE")
|
|
|
|
|
|
|
|
encoding = "UTF-8"
|
|
|
|
|
|
|
|
ext {
|
|
|
|
set("year", 2021)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
val javaComponent: SoftwareComponent = components["java"]
|
|
|
|
|
|
|
|
tasks {
|
|
|
|
processResources {
|
|
|
|
eachFile { expand("version" to project.version) }
|
|
|
|
}
|
|
|
|
|
2023-03-17 20:13:49 +01:00
|
|
|
build {
|
|
|
|
dependsOn(named("shadowJar"))
|
|
|
|
}
|
|
|
|
|
2023-03-17 19:25:47 +01:00
|
|
|
withType<JavaCompile> {
|
|
|
|
options.encoding = "UTF-8"
|
|
|
|
}
|
|
|
|
|
|
|
|
withType<Javadoc> {
|
|
|
|
isFailOnError = false
|
|
|
|
|
|
|
|
with(options as StandardJavadocDocletOptions) {
|
|
|
|
addStringOption("Xdoclint:none", "-quiet")
|
|
|
|
addStringOption("encoding", "UTF-8")
|
|
|
|
addStringOption("charSet", "UTF-8")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
withType<ShadowJar> {
|
|
|
|
archiveClassifier.set("")
|
|
|
|
|
|
|
|
relocate("org.bstats", "me.clip.placeholderapi.metrics")
|
|
|
|
relocate("net.kyori", "me.clip.placeholderapi.libs.kyori")
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
create<MavenPublication>("maven") {
|
|
|
|
artifactId = "placeholderapi"
|
|
|
|
from(javaComponent)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
if ("-DEV" in version.toString()) {
|
|
|
|
url = uri("https://repo.extendedclip.com/content/repositories/dev/")
|
|
|
|
} else {
|
|
|
|
url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
|
|
|
}
|
|
|
|
|
|
|
|
credentials {
|
|
|
|
username = System.getenv("JENKINS_USER")
|
|
|
|
password = System.getenv("JENKINS_PASS")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-17 20:13:49 +01:00
|
|
|
publish.get().setDependsOn(listOf(build.get()))
|
2023-03-17 19:25:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
testImplementation {
|
|
|
|
extendsFrom(compileOnly.get())
|
|
|
|
}
|
|
|
|
}
|