Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ jobs:
fi
- name: Publish Release
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
- name: Publish Snapshot
if: ${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: ./gradlew publishToSonatype
run: ./gradlew publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.CENTRAL_PASSWORD }}
- name: Publish core javadoc
if: ${{ runner.os == 'Linux' && env.STATUS == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
uses: cpina/github-action-push-to-another-repository@main
Expand Down
10 changes: 0 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import java.time.format.DateTimeFormatter
import xyz.jpenilla.runpaper.task.RunServer

plugins {
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("xyz.jpenilla.run-paper") version "2.3.1"
}

Expand Down Expand Up @@ -103,12 +102,3 @@ tasks {

}
}

nexusPublishing {
this.repositories {
sonatype {
nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies {
implementation(gradleApi())
implementation("org.ajoberstar.grgit:grgit-gradle:5.3.2")
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.8")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.34.0")
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:2.0.0-SNAPSHOT")
constraints {
val asmVersion = "[9.7,)"
Expand Down
108 changes: 60 additions & 48 deletions buildSrc/src/main/kotlin/LibsConfig.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.ExternalModuleDependency
Expand Down Expand Up @@ -28,7 +29,7 @@ import javax.inject.Inject
fun Project.applyLibrariesConfiguration() {
applyCommonConfiguration()
apply(plugin = "java-base")
apply(plugin = "maven-publish")
apply(plugin = "com.vanniktech.maven.publish")
apply(plugin = "com.gradleup.shadow")
apply(plugin = "signing")

Expand All @@ -41,7 +42,6 @@ fun Project.applyLibrariesConfiguration() {
val relocations = mapOf(
"net.kyori.text" to "com.sk89q.worldedit.util.formatting.text",
"net.kyori.minecraft" to "com.sk89q.worldedit.util.kyori"

)

tasks.register<ShadowJar>("jar") {
Expand Down Expand Up @@ -214,60 +214,72 @@ fun Project.applyLibrariesConfiguration() {
}
}

// the publish plugin does not allow custom platforms as of now and requires the java or java-library plugin to work with
// the builtin platforms. tried a few things, but updating this file to support the new plugin results in quite a few errors.
// -> configure the component for the publication ourselves, and delegate the rest to the extension of the plugin.
// logs an error that "no compatible plugin [can be] found in <module> for publishing" - but at least it works (:
configure<PublishingExtension> {
publications {
register<MavenPublication>("maven") {
create("maven", MavenPublication::class.java) {
from(libsComponent)
}
}
}

group = "com.fastasyncworldedit"
artifactId = "FastAsyncWorldEdit-Libs-${project.name.replaceFirstChar(Char::titlecase)}"
version = version

pom {
name.set("${rootProject.name}-Libs" + " " + project.version)
description.set("Blazingly fast Minecraft world manipulation for artists, builders and everyone else.")
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")

licenses {
license {
name.set("GNU General Public License, Version 3.0")
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
distribution.set("repo")
}
}
configure<MavenPublishBaseExtension> {
coordinates(
groupId = "com.fastasyncworldedit",
artifactId = "FastAsyncWorldEdit-Libs-${project.name.replaceFirstChar(Char::titlecase)}",
version = "$version"
)
pom {
name.set("${rootProject.name}-Libs" + " " + project.version)
description.set("Blazingly fast Minecraft world manipulation for artists, builders and everyone else.")
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")

licenses {
license {
name.set("GNU General Public License, Version 3.0")
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
distribution.set("repo")
}
}

developers {
developer {
id.set("NotMyFault")
name.set("Alexander Brandes")
email.set("contact(at)notmyfault.dev")
organization.set("IntellectualSites")
}
developer {
id.set("SirYwell")
name.set("Hannes Greule")
organization.set("IntellectualSites")
}
developer {
id.set("dordsor21")
name.set("dordsor21")
organization.set("IntellectualSites")
}
}
developers {
developer {
id.set("NotMyFault")
name.set("Alexander Brandes")
email.set("contact(at)notmyfault.dev")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
}
developer {
id.set("SirYwell")
name.set("Hannes Greule")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
}
developer {
id.set("dordsor21")
name.set("dordsor21")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
}
}

scm {
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
connection.set("scm:git:https://github.com/IntellectualSites/FastAsyncWorldEdit.git")
developerConnection.set("scm:git:git@github.com:IntellectualSites/FastAsyncWorldEdit.git")
tag.set("${project.version}")
}
scm {
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
connection.set("scm:git:https://github.com/IntellectualSites/FastAsyncWorldEdit.git")
developerConnection.set("scm:git:git@github.com:IntellectualSites/FastAsyncWorldEdit.git")
tag.set("${project.version}")
}

issueManagement {
system.set("GitHub")
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit/issues")
}
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit/issues")
}

publishToMavenCentral()
}
}

Expand Down
112 changes: 54 additions & 58 deletions buildSrc/src/main/kotlin/PlatformConfig.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import org.gradle.api.Project
import org.gradle.api.component.AdhocComponentWithVariants
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.Jar
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.the
import org.gradle.kotlin.dsl.withType
import org.gradle.plugins.signing.SigningExtension
Expand All @@ -20,7 +19,7 @@ fun Project.applyPlatformAndCoreConfiguration() {
apply(plugin = "java")
apply(plugin = "eclipse")
apply(plugin = "idea")
apply(plugin = "maven-publish")
apply(plugin = "com.vanniktech.maven.publish")
apply(plugin = "com.gradleup.shadow")
apply(plugin = "signing")

Expand Down Expand Up @@ -60,63 +59,60 @@ fun Project.applyPlatformAndCoreConfiguration() {
}
}

configure<PublishingExtension> {
publications {
register<MavenPublication>("maven") {
from(javaComponent)

group = "com.fastasyncworldedit"
artifactId = "${rootProject.name}-${project.description}"
version = version

pom {
name.set("${rootProject.name}-${project.description}" + " " + project.version)
description.set("Blazingly fast Minecraft world manipulation for artists, builders and everyone else.")
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")

licenses {
license {
name.set("GNU General Public License, Version 3.0")
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
distribution.set("repo")
}
}

developers {
developer {
id.set("NotMyFault")
name.set("Alexander Brandes")
email.set("contact(at)notmyfault.dev")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
}
developer {
id.set("SirYwell")
name.set("Hannes Greule")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
}
developer {
id.set("dordsor21")
name.set("dordsor21")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
}
}

scm {
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
connection.set("scm:git:https://github.com/IntellectualSites/FastAsyncWorldEdit.git")
developerConnection.set("scm:git:git@github.com:IntellectualSites/FastAsyncWorldEdit.git")
tag.set("${project.version}")
}

issueManagement{
system.set("GitHub")
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit/issues")
}
configure<MavenPublishBaseExtension> {
coordinates(
groupId = "com.fastasyncworldedit",
artifactId = "${rootProject.name}-${project.description}",
version = "$version"
)
pom {
name.set("${rootProject.name}-${project.description}" + " " + project.version)
description.set("Blazingly fast Minecraft world manipulation for artists, builders and everyone else.")
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")

licenses {
license {
name.set("GNU General Public License, Version 3.0")
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
distribution.set("repo")
}
}

developers {
developer {
id.set("NotMyFault")
name.set("Alexander Brandes")
email.set("contact(at)notmyfault.dev")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
}
developer {
id.set("SirYwell")
name.set("Hannes Greule")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
}
developer {
id.set("dordsor21")
name.set("dordsor21")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
}
}

scm {
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
connection.set("scm:git:https://github.com/IntellectualSites/FastAsyncWorldEdit.git")
developerConnection.set("scm:git:git@github.com:IntellectualSites/FastAsyncWorldEdit.git")
tag.set("${project.version}")
}

issueManagement {
system.set("GitHub")
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit/issues")
}

publishToMavenCentral()
}
}

Expand Down
Loading