mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2025-12-19 14:59:20 +00:00
Another attempt to make publishing work
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
plugins {
|
plugins {
|
||||||
`kotlin-dsl`
|
`kotlin-dsl`
|
||||||
|
java
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("gradle.plugin.com.github.jengelman.gradle.plugins", "shadow", "7.0.0")
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
plugins {
|
||||||
|
`java-library`
|
||||||
|
`maven-publish`
|
||||||
|
// id("net.ltgt.errorprone")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
processResources {
|
||||||
|
filesMatching(listOf("plugin.yml", "bungee.yml", "velocity-plugin.json")) {
|
||||||
|
expand(
|
||||||
|
"id" to "floodgate",
|
||||||
|
"name" to "floodgate",
|
||||||
|
"version" to project.version,
|
||||||
|
"description" to project.description,
|
||||||
|
"url" to "https://geysermc.org",
|
||||||
|
"author" to "GeyserMC"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileJava {
|
||||||
|
options.encoding = Charsets.UTF_8.name()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
|
withSourcesJar()
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications.create<MavenPublication>("mavenJava") {
|
||||||
|
groupId = rootProject.group as String
|
||||||
|
artifactId = project.name
|
||||||
|
version = rootProject.version as String
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("floodgate.base-conventions")
|
||||||
|
id("com.github.johnrengelman.shadow")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
named<Jar>("jar") {
|
||||||
|
archiveClassifier.set("unshaded")
|
||||||
|
from(project.rootProject.file("LICENSE"))
|
||||||
|
}
|
||||||
|
val shadowJar = named<ShadowJar>("shadowJar") {
|
||||||
|
archiveBaseName.set("floodgate-${project.name}")
|
||||||
|
archiveVersion.set("")
|
||||||
|
archiveClassifier.set("")
|
||||||
|
configureRelocations()
|
||||||
|
}
|
||||||
|
named("build") {
|
||||||
|
dependsOn(shadowJar)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ShadowJar.configureRelocations() {
|
||||||
|
//todo platform-independent relocations
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications.named<MavenPublication>("mavenJava") {
|
||||||
|
artifact(tasks["shadowJar"])
|
||||||
|
artifact(tasks["sourcesJar"])
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
plugins {
|
||||||
|
id("floodgate.base-conventions")
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications.named<MavenPublication>("mavenJava") {
|
||||||
|
from(components["java"])
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,27 +1,24 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`java-library`
|
`java-library`
|
||||||
`maven-publish`
|
|
||||||
id("floodgate.build-logic") apply false
|
id("floodgate.build-logic") apply false
|
||||||
// id("com.github.spotbugs") version "4.8.0" apply false
|
// id("com.github.spotbugs") version "4.8.0" apply false
|
||||||
|
|
||||||
// id("net.kyori.indra")
|
|
||||||
// id("net.kyori.indra.checkstyle")
|
|
||||||
// id("net.kyori.indra.license-header")
|
|
||||||
|
|
||||||
id("com.github.johnrengelman.shadow") version "7.1.0" apply false
|
|
||||||
id("io.freefair.lombok") version "6.3.0" apply false
|
id("io.freefair.lombok") version "6.3.0" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val platforms = setOf(
|
||||||
|
projects.bungee,
|
||||||
|
projects.spigot,
|
||||||
|
projects.velocity
|
||||||
|
).map { it.dependencyProject }
|
||||||
|
|
||||||
|
val api: Project = projects.api.dependencyProject
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
// apply(plugin = "pmd")
|
// apply(plugin = "pmd")
|
||||||
// apply(plugin = "com.github.spotbugs")
|
// apply(plugin = "com.github.spotbugs")
|
||||||
|
|
||||||
apply {
|
apply {
|
||||||
plugin("java-library")
|
plugin("java-library")
|
||||||
plugin("maven-publish")
|
|
||||||
plugin("com.github.johnrengelman.shadow")
|
|
||||||
plugin("io.freefair.lombok")
|
plugin("io.freefair.lombok")
|
||||||
plugin("floodgate.build-logic")
|
plugin("floodgate.build-logic")
|
||||||
}
|
}
|
||||||
@@ -33,35 +30,13 @@ subprojects {
|
|||||||
}
|
}
|
||||||
version = "2.1.1-SNAPSHOT"
|
version = "2.1.1-SNAPSHOT"
|
||||||
|
|
||||||
java {
|
when (this) {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
in platforms -> plugins.apply("floodgate.shadow-conventions")
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
api -> plugins.apply("floodgate.base-conventions")
|
||||||
|
else -> plugins.apply("floodgate.standard-conventions")
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("org.checkerframework", "checker-qual", Versions.checkerQual)
|
compileOnly("org.checkerframework", "checker-qual", Versions.checkerQual)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
|
||||||
val shadowJar = named<ShadowJar>("shadowJar") {
|
|
||||||
archiveBaseName.set("floodgate-${project.name}")
|
|
||||||
archiveVersion.set("")
|
|
||||||
archiveClassifier.set("")
|
|
||||||
}
|
|
||||||
named("build") {
|
|
||||||
dependsOn(shadowJar)
|
|
||||||
}
|
|
||||||
|
|
||||||
compileJava {
|
|
||||||
options.encoding = Charsets.UTF_8.name()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
create<MavenPublication>("maven") {
|
|
||||||
from(components["java"])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ var gsonVersion = "2.8.0";
|
|||||||
var guavaVersion = "21.0";
|
var guavaVersion = "21.0";
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(project(":core", "shadow"))
|
api(project(":core"))
|
||||||
implementation("cloud.commandframework", "cloud-bungee", "1.5.0")
|
implementation("cloud.commandframework", "cloud-bungee", "1.5.0")
|
||||||
implementation("net.kyori", "adventure-text-serializer-gson", Versions.adventureApiVersion)
|
implementation("net.kyori", "adventure-text-serializer-gson", Versions.adventureApiVersion)
|
||||||
implementation("net.kyori", "adventure-text-serializer-bungeecord", Versions.adventurePlatformVersion)
|
implementation("net.kyori", "adventure-text-serializer-bungeecord", Versions.adventurePlatformVersion)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: ${project.parent.name}
|
name: ${name}
|
||||||
description: ${project.description}
|
description: ${description}
|
||||||
version: ${project.version}
|
version: ${version}
|
||||||
author: ${project.organization.name}
|
author: ${author}
|
||||||
main: org.geysermc.floodgate.BungeePlugin
|
main: org.geysermc.floodgate.BungeePlugin
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
dependencies {
|
dependencies {
|
||||||
api(project(":api", "shadow"))
|
api(project(":api"))
|
||||||
api("com.google.inject", "guice", Versions.guiceVersion)
|
api("com.google.inject", "guice", Versions.guiceVersion)
|
||||||
api("com.nukkitx.fastutil", "fastutil-short-object-maps", Versions.fastutilVersion)
|
api("com.nukkitx.fastutil", "fastutil-short-object-maps", Versions.fastutilVersion)
|
||||||
api("com.nukkitx.fastutil", "fastutil-int-object-maps", Versions.fastutilVersion)
|
api("com.nukkitx.fastutil", "fastutil-int-object-maps", Versions.fastutilVersion)
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
|
org.gradle.caching=true
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
@@ -39,14 +39,12 @@ dependencyResolutionManagement {
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
plugins {
|
plugins {
|
||||||
id("net.kyori.blossom") version "1.2.0"
|
id("net.kyori.blossom") version "1.2.0"
|
||||||
id("com.github.johnrengelman.shadow") version "7.1.0"
|
|
||||||
}
|
}
|
||||||
|
includeBuild("build-logic")
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "floodgate-parent"
|
rootProject.name = "floodgate-parent"
|
||||||
|
|
||||||
includeBuild("build-logic")
|
|
||||||
|
|
||||||
include(":api")
|
include(":api")
|
||||||
include(":core")
|
include(":core")
|
||||||
include(":bungee")
|
include(":bungee")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ var guavaVersion = "21.0"
|
|||||||
var gsonVersion = "2.8.5"
|
var gsonVersion = "2.8.5"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(project(":core", "shadow"))
|
api(project(":core"))
|
||||||
|
|
||||||
implementation("com.google.guava", "guava", guavaVersion)
|
implementation("com.google.guava", "guava", guavaVersion)
|
||||||
implementation("cloud.commandframework", "cloud-bukkit", Versions.cloudVersion)
|
implementation("cloud.commandframework", "cloud-bukkit", Versions.cloudVersion)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
name: ${project.parent.name}
|
name: ${name}
|
||||||
description: ${project.description}
|
description: ${description}
|
||||||
version: ${project.version}
|
version: ${version}
|
||||||
author: ${project.organization.name}
|
author: ${author}
|
||||||
website: ${project.url}
|
website: ${url}
|
||||||
main: org.geysermc.floodgate.SpigotPlugin
|
main: org.geysermc.floodgate.SpigotPlugin
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
@@ -1 +1 @@
|
|||||||
{"id": "${project.parent.name}", "name": "${project.parent.name}", "version": "${project.version}", "description": "${project.description}", "url": "${project.url}", "authors": ["${project.organization.name}"], "main": "org.geysermc.floodgate.VelocityPlugin"}
|
{"id": "${id}", "name": "${name}", "version": "${version}", "description": "${description}", "url": "$url}", "authors": ["${author}"], "main": "org.geysermc.floodgate.VelocityPlugin"}
|
||||||
Reference in New Issue
Block a user