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:
127
build.gradle.kts
127
build.gradle.kts
@@ -7,17 +7,19 @@ plugins {
|
||||
id("io.github.goooler.shadow") version "8.1.7"
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java-library")
|
||||
apply(plugin = "maven-publish")
|
||||
// apply(plugin = "com.github.hierynomus.license")
|
||||
apply(plugin = "io.github.goooler.shadow")
|
||||
|
||||
group = "me.clip"
|
||||
version = "2.11.8-DEV-${System.getProperty("BUILD_NUMBER")}"
|
||||
|
||||
description = "An awesome placeholder provider!"
|
||||
|
||||
val paper by sourceSets.creating {
|
||||
java.srcDir("src/paper/java")
|
||||
|
||||
// paper can see main code
|
||||
compileClasspath += sourceSets.main.get().output
|
||||
runtimeClasspath += output + compileClasspath
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
|
||||
@@ -30,10 +32,22 @@ subprojects {
|
||||
}
|
||||
|
||||
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
|
||||
@@ -44,20 +58,7 @@ subprojects {
|
||||
disableAutoTargetJvm()
|
||||
}
|
||||
|
||||
// license {
|
||||
// header = rootProject.file("config/headers/main.txt")
|
||||
//
|
||||
// include("**/*.java")
|
||||
// mapping("java", "JAVADOC_STYLE")
|
||||
//
|
||||
// exclude("spigot/src/main/java/me/clip/placeholderapi/scheduler")
|
||||
//
|
||||
// encoding = "UTF-8"
|
||||
//
|
||||
// ext {
|
||||
// set("year", 2026)
|
||||
// }
|
||||
// }
|
||||
val javaComponent: SoftwareComponent = components["java"]
|
||||
|
||||
tasks {
|
||||
processResources {
|
||||
@@ -68,14 +69,36 @@ subprojects {
|
||||
dependsOn(named("shadowJar"))
|
||||
}
|
||||
|
||||
register<JavaCompile>("compilePaper") {
|
||||
source = paper.java
|
||||
classpath = paper.compileClasspath
|
||||
destinationDirectory.set(layout.buildDirectory.dir("classes/java/paper"))
|
||||
options.encoding = "UTF-8"
|
||||
options.release = 8
|
||||
}
|
||||
|
||||
val plainJar by registering(Jar::class) {
|
||||
archiveClassifier.set("plain")
|
||||
from(sourceSets.main.get().output)
|
||||
from(paper.output)
|
||||
}
|
||||
|
||||
val sourcesJar by registering(Jar::class) {
|
||||
archiveClassifier.set("sources")
|
||||
from(sourceSets.main.get().allSource)
|
||||
from(paper.allSource)
|
||||
}
|
||||
|
||||
withType<JavaCompile> {
|
||||
options.encoding = "UTF-8"
|
||||
options.release = 8
|
||||
}
|
||||
|
||||
withType<Javadoc> {
|
||||
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")
|
||||
@@ -83,9 +106,69 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
withType<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
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
artifactId = "placeholderapi"
|
||||
|
||||
artifact(plainJar) {
|
||||
builtBy(plainJar)
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives(sourcesJar)
|
||||
archives(javadocJar)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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()))
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -93,5 +176,3 @@ subprojects {
|
||||
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"
|
||||
|
||||
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;
|
||||
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.expansion.Relational;
|
||||
import me.clip.placeholderapi.replacer.ExactReplacer;
|
||||
import me.clip.placeholderapi.replacer.RelationalExactReplacer;
|
||||
import me.clip.placeholderapi.replacer.Replacer;
|
||||
Reference in New Issue
Block a user