2021-06-30 13:03:47 +02:00
|
|
|
import org.apache.tools.ant.filters.ReplaceTokens
|
|
|
|
|
2020-07-14 18:56:49 +02:00
|
|
|
plugins {
|
2020-08-01 04:52:07 +02:00
|
|
|
id "java"
|
|
|
|
id "maven-publish"
|
2021-11-27 06:44:31 +01:00
|
|
|
id "org.cadixdev.licenser" version "0.6.1"
|
|
|
|
id "com.github.johnrengelman.shadow" version "7.1.0"
|
2020-07-14 18:56:49 +02:00
|
|
|
}
|
|
|
|
|
2020-07-27 09:21:35 +02:00
|
|
|
group "me.clip"
|
2021-12-27 10:33:36 +01:00
|
|
|
version "2.11.2-DEV-${System.getProperty("BUILD_NUMBER")}"
|
2020-07-14 18:56:49 +02:00
|
|
|
|
2020-07-27 09:21:35 +02:00
|
|
|
description "An awesome placeholder provider!"
|
2020-07-14 18:56:49 +02:00
|
|
|
|
|
|
|
repositories {
|
2021-07-09 06:24:36 +02:00
|
|
|
maven({ url = "https://oss.sonatype.org/content/repositories/snapshots/" })
|
|
|
|
|
2020-08-01 04:52:07 +02:00
|
|
|
mavenCentral()
|
2021-07-07 09:37:35 +02:00
|
|
|
mavenLocal()
|
2020-07-31 16:42:24 +02:00
|
|
|
|
2021-12-03 04:52:28 +01:00
|
|
|
maven({ url = "https://repo.codemc.org/repository/maven-public/" })
|
2020-08-01 04:52:07 +02:00
|
|
|
maven({ url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" })
|
2020-07-14 18:56:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2021-07-01 16:21:49 +02:00
|
|
|
implementation "org.bstats:bstats-bukkit:2.2.1"
|
2021-11-27 06:44:31 +01:00
|
|
|
implementation "net.kyori:adventure-platform-bukkit:4.0.1"
|
2020-08-01 04:52:07 +02:00
|
|
|
|
2022-06-16 01:31:33 +02:00
|
|
|
compileOnly "org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT"
|
2021-12-03 04:52:28 +01:00
|
|
|
compileOnly "org.jetbrains:annotations:22.0.0"
|
2020-08-01 04:52:07 +02:00
|
|
|
|
2021-12-03 04:52:28 +01:00
|
|
|
testImplementation "org.openjdk.jmh:jmh-core:1.32"
|
|
|
|
testImplementation "org.openjdk.jmh:jmh-generator-annprocess:1.32"
|
2020-08-01 04:52:07 +02:00
|
|
|
|
2021-12-24 05:32:01 +01:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.8.2"
|
2021-12-03 04:52:28 +01:00
|
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.8.1"
|
2020-07-14 18:56:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
2021-07-01 16:24:01 +02:00
|
|
|
filter ReplaceTokens, tokens: [name: rootProject.name, version: project.version.toString(), description: project.description]
|
2020-07-14 18:56:49 +02:00
|
|
|
}
|
|
|
|
|
2020-08-09 09:22:21 +02:00
|
|
|
java {
|
2020-08-01 04:52:07 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
2020-08-09 09:22:21 +02:00
|
|
|
|
|
|
|
withJavadocJar()
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
options.encoding = "UTF-8"
|
2020-07-24 20:47:30 +02:00
|
|
|
}
|
2020-07-14 18:56:49 +02:00
|
|
|
|
2020-12-14 01:58:55 +01:00
|
|
|
tasks.withType(Javadoc) {
|
|
|
|
failOnError false
|
|
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
options.addStringOption('encoding', 'UTF-8')
|
|
|
|
options.addStringOption('charSet', 'UTF-8')
|
2020-12-14 01:52:46 +01:00
|
|
|
}
|
|
|
|
|
2020-07-14 18:56:49 +02:00
|
|
|
shadowJar {
|
2020-08-01 04:52:07 +02:00
|
|
|
archiveClassifier.set("")
|
2020-07-31 16:46:27 +02:00
|
|
|
|
2020-08-01 04:52:07 +02:00
|
|
|
relocate "org.bstats", "me.clip.placeholderapi.metrics"
|
2021-07-06 18:59:17 +02:00
|
|
|
relocate "net.kyori", "me.clip.placeholderapi.libs.kyori"
|
2020-07-21 02:13:32 +02:00
|
|
|
}
|
|
|
|
|
2020-07-27 09:21:35 +02:00
|
|
|
license {
|
2020-08-01 04:52:07 +02:00
|
|
|
include '**/*.java'
|
2020-08-01 04:37:00 +02:00
|
|
|
|
2020-08-01 04:52:07 +02:00
|
|
|
matching('**/*.java') {
|
2020-08-01 05:04:06 +02:00
|
|
|
header = file('config/headers/main.txt')
|
2020-08-01 04:52:07 +02:00
|
|
|
}
|
2020-07-31 16:42:24 +02:00
|
|
|
|
2020-08-01 04:52:07 +02:00
|
|
|
ext {
|
2021-06-30 13:03:47 +02:00
|
|
|
year = 2021
|
2020-08-01 04:52:07 +02:00
|
|
|
}
|
2020-07-27 09:21:35 +02:00
|
|
|
}
|
|
|
|
|
2020-07-21 02:13:32 +02:00
|
|
|
test {
|
2020-08-01 04:52:07 +02:00
|
|
|
useJUnitPlatform()
|
2020-07-21 02:13:32 +02:00
|
|
|
}
|
|
|
|
|
2021-06-11 08:33:29 +02:00
|
|
|
configurations {
|
|
|
|
testImplementation {
|
|
|
|
extendsFrom(compileOnly)
|
|
|
|
}
|
2020-07-14 18:56:49 +02:00
|
|
|
}
|
2020-07-28 18:58:06 +02:00
|
|
|
|
|
|
|
publishing {
|
2020-08-01 04:52:07 +02:00
|
|
|
repositories {
|
|
|
|
maven {
|
2021-06-30 13:03:47 +02:00
|
|
|
if (version.contains("-DEV")) {
|
2020-08-01 04:52:07 +02:00
|
|
|
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")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
artifactId = "placeholderapi"
|
|
|
|
|
|
|
|
from components.java
|
|
|
|
|
|
|
|
pom.withXml {
|
2020-08-03 16:00:59 +02:00
|
|
|
|
2020-08-06 20:05:33 +02:00
|
|
|
// some are having issues with bstats so we might need to add that to the pom as well
|
|
|
|
|
2020-08-01 04:52:07 +02:00
|
|
|
asNode().appendNode("packaging", "jar")
|
|
|
|
asNode().remove(asNode().get("dependencies"))
|
2020-08-03 16:00:59 +02:00
|
|
|
|
2020-08-03 21:23:48 +02:00
|
|
|
def dependenciesNode = asNode().appendNode("dependencies")
|
2020-08-03 21:38:53 +02:00
|
|
|
// jetbrains annotations
|
|
|
|
def jetbrainsAnnotations = dependenciesNode.appendNode("dependency")
|
|
|
|
jetbrainsAnnotations.appendNode("groupId", "org.jetbrains")
|
|
|
|
jetbrainsAnnotations.appendNode("artifactId", "annotations")
|
|
|
|
jetbrainsAnnotations.appendNode("version", "19.0.0")
|
2020-08-01 04:52:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-07-28 18:58:06 +02:00
|
|
|
}
|
|
|
|
|
2021-01-03 16:35:37 +01:00
|
|
|
publish.dependsOn clean, test, jar
|