mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2026-02-04 23:53:20 +01:00
back to one jar pls
This commit is contained in:
205
build.gradle.kts
205
build.gradle.kts
@@ -7,91 +7,172 @@ plugins {
|
|||||||
id("io.github.goooler.shadow") version "8.1.7"
|
id("io.github.goooler.shadow") version "8.1.7"
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
group = "me.clip"
|
||||||
apply(plugin = "java-library")
|
version = "2.11.8-DEV-${System.getProperty("BUILD_NUMBER")}"
|
||||||
apply(plugin = "maven-publish")
|
|
||||||
// apply(plugin = "com.github.hierynomus.license")
|
|
||||||
apply(plugin = "io.github.goooler.shadow")
|
|
||||||
|
|
||||||
group = "me.clip"
|
description = "An awesome placeholder provider!"
|
||||||
version = "2.11.8-DEV-${System.getProperty("BUILD_NUMBER")}"
|
|
||||||
|
|
||||||
description = "An awesome placeholder provider!"
|
val paper by sourceSets.creating {
|
||||||
|
java.srcDir("src/paper/java")
|
||||||
|
|
||||||
repositories {
|
// paper can see main code
|
||||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
compileClasspath += sourceSets.main.get().output
|
||||||
|
runtimeClasspath += output + compileClasspath
|
||||||
|
}
|
||||||
|
|
||||||
mavenCentral()
|
repositories {
|
||||||
mavenLocal()
|
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||||
|
|
||||||
maven("https://repo.codemc.org/repository/maven-public/")
|
mavenCentral()
|
||||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
mavenLocal()
|
||||||
maven("https://repo.papermc.io/repository/maven-public/")
|
|
||||||
|
maven("https://repo.codemc.org/repository/maven-public/")
|
||||||
|
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||||
|
maven("https://repo.papermc.io/repository/maven-public/")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("org.bstats:bstats-bukkit:3.0.1")
|
||||||
|
implementation("net.kyori:adventure-platform-bukkit:4.4.1")
|
||||||
|
|
||||||
|
add(paper.compileOnlyConfigurationName, "net.kyori:adventure-platform-bukkit:4.4.1")
|
||||||
|
add(paper.compileOnlyConfigurationName, "dev.folia:folia-api:1.21.11-R0.1-SNAPSHOT")
|
||||||
|
|
||||||
|
compileOnly("dev.folia:folia-api:1.21.11-R0.1-SNAPSHOT")
|
||||||
|
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()
|
||||||
|
|
||||||
|
disableAutoTargetJvm()
|
||||||
|
}
|
||||||
|
|
||||||
|
val javaComponent: SoftwareComponent = components["java"]
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
processResources {
|
||||||
|
eachFile { expand("version" to project.version) }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
build {
|
||||||
compileOnly("dev.folia:folia-api:1.21.11-R0.1-SNAPSHOT")
|
dependsOn(named("shadowJar"))
|
||||||
compileOnlyApi("org.jetbrains:annotations:23.0.0")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
register<JavaCompile>("compilePaper") {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
source = paper.java
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
classpath = paper.compileClasspath
|
||||||
|
destinationDirectory.set(layout.buildDirectory.dir("classes/java/paper"))
|
||||||
withJavadocJar()
|
options.encoding = "UTF-8"
|
||||||
withSourcesJar()
|
options.release = 8
|
||||||
|
|
||||||
disableAutoTargetJvm()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// license {
|
val plainJar by registering(Jar::class) {
|
||||||
// header = rootProject.file("config/headers/main.txt")
|
archiveClassifier.set("plain")
|
||||||
//
|
from(sourceSets.main.get().output)
|
||||||
// include("**/*.java")
|
from(paper.output)
|
||||||
// mapping("java", "JAVADOC_STYLE")
|
}
|
||||||
//
|
|
||||||
// exclude("spigot/src/main/java/me/clip/placeholderapi/scheduler")
|
|
||||||
//
|
|
||||||
// encoding = "UTF-8"
|
|
||||||
//
|
|
||||||
// ext {
|
|
||||||
// set("year", 2026)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
tasks {
|
val sourcesJar by registering(Jar::class) {
|
||||||
processResources {
|
archiveClassifier.set("sources")
|
||||||
eachFile { expand("version" to project.version) }
|
from(sourceSets.main.get().allSource)
|
||||||
|
from(paper.allSource)
|
||||||
|
}
|
||||||
|
|
||||||
|
withType<JavaCompile> {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
options.release = 8
|
||||||
|
}
|
||||||
|
|
||||||
|
val javadocJar = withType<Javadoc> {
|
||||||
|
isFailOnError = false
|
||||||
|
|
||||||
|
source = sourceSets.main.get().allJava + paper.allJava
|
||||||
|
|
||||||
|
with(options as StandardJavadocDocletOptions) {
|
||||||
|
addStringOption("Xdoclint:none", "-quiet")
|
||||||
|
addStringOption("encoding", "UTF-8")
|
||||||
|
addStringOption("charSet", "UTF-8")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
build {
|
withType<ShadowJar> {
|
||||||
dependsOn(named("shadowJar"))
|
configurations = listOf(project.configurations.runtimeClasspath.get())
|
||||||
|
|
||||||
|
from(sourceSets.main.get().output)
|
||||||
|
|
||||||
|
archiveClassifier.set("")
|
||||||
|
|
||||||
|
relocate("org.bstats", "me.clip.placeholderapi.metrics")
|
||||||
|
relocate("net.kyori", "me.clip.placeholderapi.libs.kyori")
|
||||||
|
|
||||||
|
exclude("META-INF/versions/**")
|
||||||
|
|
||||||
|
dependsOn("compilePaper")
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
val paperDir = layout.buildDirectory.dir("classes/java/paper").get().asFile
|
||||||
|
val jarFile = archiveFile.get().asFile
|
||||||
|
|
||||||
|
ant.invokeMethod("zip", mapOf(
|
||||||
|
"destfile" to jarFile,
|
||||||
|
"update" to "true",
|
||||||
|
"basedir" to paperDir
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
withType<JavaCompile> {
|
test {
|
||||||
options.encoding = "UTF-8"
|
useJUnitPlatform()
|
||||||
options.release = 8
|
}
|
||||||
}
|
|
||||||
|
|
||||||
withType<Javadoc> {
|
publishing {
|
||||||
isFailOnError = false
|
publications {
|
||||||
|
create<MavenPublication>("maven") {
|
||||||
|
artifactId = "placeholderapi"
|
||||||
|
|
||||||
with(options as StandardJavadocDocletOptions) {
|
artifact(plainJar) {
|
||||||
addStringOption("Xdoclint:none", "-quiet")
|
builtBy(plainJar)
|
||||||
addStringOption("encoding", "UTF-8")
|
}
|
||||||
addStringOption("charSet", "UTF-8")
|
|
||||||
|
artifacts {
|
||||||
|
archives(sourcesJar)
|
||||||
|
archives(javadocJar)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
repositories {
|
||||||
useJUnitPlatform()
|
maven {
|
||||||
|
if ("-DEV" in version.toString()) {
|
||||||
|
url = uri("https://repo.extendedclip.com/snapshots")
|
||||||
|
} else {
|
||||||
|
url = uri("https://repo.extendedclip.com/releases")
|
||||||
|
}
|
||||||
|
|
||||||
|
credentials {
|
||||||
|
username = System.getenv("JENKINS_USER")
|
||||||
|
password = System.getenv("JENKINS_PASS")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
publish.get().setDependsOn(listOf(build.get()))
|
||||||
testImplementation {
|
}
|
||||||
extendsFrom(compileOnly.get())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
testImplementation {
|
||||||
|
extendsFrom(compileOnly.get())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation(project(":spigot")) {
|
|
||||||
exclude("net.kyori")
|
|
||||||
}
|
|
||||||
compileOnly("net.kyori:adventure-platform-bukkit:4.4.1")
|
|
||||||
}
|
|
||||||
|
|
||||||
val javaComponent: SoftwareComponent = components["java"]
|
|
||||||
|
|
||||||
base {
|
|
||||||
archivesName.set("PlaceholderAPI-Paper")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
withType<ShadowJar> {
|
|
||||||
archiveClassifier.set("")
|
|
||||||
archiveBaseName.set("PlaceholderAPI-Paper")
|
|
||||||
|
|
||||||
relocate("org.bstats", "me.clip.placeholderapi.metrics")
|
|
||||||
|
|
||||||
exclude("META-INF/versions/**")
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
create<MavenPublication>("maven") {
|
|
||||||
artifactId = "placeholderapi-paper"
|
|
||||||
from(javaComponent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
if ("-DEV" in version.toString()) {
|
|
||||||
url = uri("https://repo.extendedclip.com/snapshots")
|
|
||||||
} else {
|
|
||||||
url = uri("https://repo.extendedclip.com/releases")
|
|
||||||
}
|
|
||||||
|
|
||||||
credentials {
|
|
||||||
username = System.getenv("JENKINS_USER")
|
|
||||||
password = System.getenv("JENKINS_PASS")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
publish.get().setDependsOn(listOf(build.get()))
|
|
||||||
}
|
|
||||||
@@ -1,3 +1 @@
|
|||||||
rootProject.name = "PlaceholderAPI"
|
rootProject.name = "PlaceholderAPI"
|
||||||
|
|
||||||
include("spigot", "paper")
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation("org.bstats:bstats-bukkit:3.0.1")
|
|
||||||
implementation("net.kyori:adventure-platform-bukkit:4.4.1")
|
|
||||||
|
|
||||||
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")
|
|
||||||
}
|
|
||||||
|
|
||||||
val javaComponent: SoftwareComponent = components["java"]
|
|
||||||
|
|
||||||
base {
|
|
||||||
archivesName.set("PlaceholderAPI-Spigot")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
withType<ShadowJar> {
|
|
||||||
archiveClassifier.set("")
|
|
||||||
archiveBaseName.set("PlaceholderAPI-Spigot")
|
|
||||||
|
|
||||||
relocate("org.bstats", "me.clip.placeholderapi.metrics")
|
|
||||||
relocate("net.kyori", "me.clip.placeholderapi.libs.kyori")
|
|
||||||
|
|
||||||
exclude("META-INF/versions/**")
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
create<MavenPublication>("maven") {
|
|
||||||
artifactId = "placeholderapi"
|
|
||||||
from(javaComponent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
if ("-DEV" in version.toString()) {
|
|
||||||
url = uri("https://repo.extendedclip.com/snapshots")
|
|
||||||
} else {
|
|
||||||
url = uri("https://repo.extendedclip.com/releases")
|
|
||||||
}
|
|
||||||
|
|
||||||
credentials {
|
|
||||||
username = System.getenv("JENKINS_USER")
|
|
||||||
password = System.getenv("JENKINS_PASS")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
publish.get().setDependsOn(listOf(build.get()))
|
|
||||||
}
|
|
||||||
@@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
package me.clip.placeholderapi;
|
package me.clip.placeholderapi;
|
||||||
|
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
|
||||||
import me.clip.placeholderapi.expansion.Relational;
|
|
||||||
import me.clip.placeholderapi.replacer.ExactReplacer;
|
import me.clip.placeholderapi.replacer.ExactReplacer;
|
||||||
import me.clip.placeholderapi.replacer.RelationalExactReplacer;
|
import me.clip.placeholderapi.replacer.RelationalExactReplacer;
|
||||||
import me.clip.placeholderapi.replacer.Replacer;
|
import me.clip.placeholderapi.replacer.Replacer;
|
||||||
Reference in New Issue
Block a user