Skip to content

Commit 408aceb

Browse files
ci: try yet another publishing plugin (#3245)
Co-authored-by: Alexander Brandes <[email protected]>
1 parent ffc59ef commit 408aceb

File tree

4 files changed

+120
-115
lines changed

4 files changed

+120
-115
lines changed

build.gradle.kts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import org.ajoberstar.grgit.Grgit
22
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
33
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
4-
import java.net.URI
54
import java.time.format.DateTimeFormatter
65
import xyz.jpenilla.runpaper.task.RunServer
76

87
plugins {
8+
id("com.gradleup.nmcp.aggregation") version "1.0.2"
99
id("xyz.jpenilla.run-paper") version "2.3.1"
1010
}
1111

@@ -102,3 +102,13 @@ tasks {
102102

103103
}
104104
}
105+
106+
nmcpAggregation {
107+
centralPortal {
108+
publishingType = "AUTOMATIC"
109+
username = providers.gradleProperty("mavenCentralUsername")
110+
password = providers.gradleProperty("mavenCentralPassword")
111+
}
112+
113+
publishAllProjectsProbablyBreakingProjectIsolation()
114+
}

buildSrc/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ dependencies {
2424
implementation(gradleApi())
2525
implementation("org.ajoberstar.grgit:grgit-gradle:5.3.2")
2626
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.8")
27-
implementation("com.vanniktech:gradle-maven-publish-plugin:0.34.0")
2827
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:2.0.0-SNAPSHOT")
2928
constraints {
3029
val asmVersion = "[9.7,)"

buildSrc/src/main/kotlin/LibsConfig.kt

Lines changed: 50 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
import com.vanniktech.maven.publish.MavenPublishBaseExtension
32
import org.gradle.api.Plugin
43
import org.gradle.api.Project
54
import org.gradle.api.artifacts.ExternalModuleDependency
@@ -29,7 +28,8 @@ import javax.inject.Inject
2928
fun Project.applyLibrariesConfiguration() {
3029
applyCommonConfiguration()
3130
apply(plugin = "java-base")
32-
apply(plugin = "com.vanniktech.maven.publish")
31+
apply(plugin = "com.gradleup.nmcp.aggregation")
32+
apply(plugin = "maven-publish")
3333
apply(plugin = "com.gradleup.shadow")
3434
apply(plugin = "signing")
3535

@@ -214,72 +214,63 @@ fun Project.applyLibrariesConfiguration() {
214214
}
215215
}
216216

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

229-
configure<MavenPublishBaseExtension> {
230-
coordinates(
231-
groupId = "com.fastasyncworldedit",
232-
artifactId = "FastAsyncWorldEdit-Libs-${project.name.replaceFirstChar(Char::titlecase)}",
222+
group = "com.fastasyncworldedit"
223+
artifactId = "FastAsyncWorldEdit-Libs-${project.name.replaceFirstChar(Char::titlecase)}"
233224
version = "$version"
234-
)
235-
pom {
236-
name.set("${rootProject.name}-Libs" + " " + project.version)
237-
description.set("Blazingly fast Minecraft world manipulation for artists, builders and everyone else.")
238-
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
239-
240-
licenses {
241-
license {
242-
name.set("GNU General Public License, Version 3.0")
243-
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
244-
distribution.set("repo")
245-
}
246-
}
247225

248-
developers {
249-
developer {
250-
id.set("NotMyFault")
251-
name.set("Alexander Brandes")
252-
email.set("contact(at)notmyfault.dev")
253-
organization.set("IntellectualSites")
254-
organizationUrl.set("https://github.com/IntellectualSites")
255-
}
256-
developer {
257-
id.set("SirYwell")
258-
name.set("Hannes Greule")
259-
organization.set("IntellectualSites")
260-
organizationUrl.set("https://github.com/IntellectualSites")
261-
}
262-
developer {
263-
id.set("dordsor21")
264-
name.set("dordsor21")
265-
organization.set("IntellectualSites")
266-
organizationUrl.set("https://github.com/IntellectualSites")
267-
}
268-
}
226+
pom {
227+
name.set("${rootProject.name}-Libs" + " " + project.version)
228+
description.set("Blazingly fast Minecraft world manipulation for artists, builders and everyone else.")
229+
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
230+
231+
licenses {
232+
license {
233+
name.set("GNU General Public License, Version 3.0")
234+
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
235+
distribution.set("repo")
236+
}
237+
}
269238

270-
scm {
271-
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
272-
connection.set("scm:git:https://github.com/IntellectualSites/FastAsyncWorldEdit.git")
273-
developerConnection.set("scm:git:[email protected]:IntellectualSites/FastAsyncWorldEdit.git")
274-
tag.set("${project.version}")
275-
}
239+
developers {
240+
developer {
241+
id.set("NotMyFault")
242+
name.set("Alexander Brandes")
243+
email.set("contact(at)notmyfault.dev")
244+
organization.set("IntellectualSites")
245+
organizationUrl.set("https://github.com/IntellectualSites")
246+
}
247+
developer {
248+
id.set("SirYwell")
249+
name.set("Hannes Greule")
250+
organization.set("IntellectualSites")
251+
organizationUrl.set("https://github.com/IntellectualSites")
252+
}
253+
developer {
254+
id.set("dordsor21")
255+
name.set("dordsor21")
256+
organization.set("IntellectualSites")
257+
organizationUrl.set("https://github.com/IntellectualSites")
258+
}
259+
}
276260

277-
issueManagement {
278-
system.set("GitHub")
279-
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit/issues")
280-
}
261+
scm {
262+
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
263+
connection.set("scm:git:https://github.com/IntellectualSites/FastAsyncWorldEdit.git")
264+
developerConnection.set("scm:git:[email protected]:IntellectualSites/FastAsyncWorldEdit.git")
265+
tag.set("${project.version}")
266+
}
281267

282-
publishToMavenCentral()
268+
issueManagement {
269+
system.set("GitHub")
270+
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit/issues")
271+
}
272+
}
273+
}
283274
}
284275
}
285276

buildSrc/src/main/kotlin/PlatformConfig.kt

Lines changed: 59 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
import com.vanniktech.maven.publish.MavenPublishBaseExtension
32
import org.gradle.api.Project
43
import org.gradle.api.component.AdhocComponentWithVariants
54
import org.gradle.api.plugins.JavaPluginExtension
65
import org.gradle.api.publish.PublishingExtension
6+
import org.gradle.api.publish.maven.MavenPublication
77
import org.gradle.api.tasks.bundling.Jar
88
import org.gradle.kotlin.dsl.apply
99
import org.gradle.kotlin.dsl.configure
1010
import org.gradle.kotlin.dsl.get
1111
import org.gradle.kotlin.dsl.named
1212
import org.gradle.kotlin.dsl.provideDelegate
13+
import org.gradle.kotlin.dsl.register
1314
import org.gradle.kotlin.dsl.the
1415
import org.gradle.kotlin.dsl.withType
1516
import org.gradle.plugins.signing.SigningExtension
@@ -19,7 +20,8 @@ fun Project.applyPlatformAndCoreConfiguration() {
1920
apply(plugin = "java")
2021
apply(plugin = "eclipse")
2122
apply(plugin = "idea")
22-
apply(plugin = "com.vanniktech.maven.publish")
23+
apply(plugin = "com.gradleup.nmcp.aggregation")
24+
apply(plugin = "maven-publish")
2325
apply(plugin = "com.gradleup.shadow")
2426
apply(plugin = "signing")
2527

@@ -59,60 +61,63 @@ fun Project.applyPlatformAndCoreConfiguration() {
5961
}
6062
}
6163

62-
configure<MavenPublishBaseExtension> {
63-
coordinates(
64-
groupId = "com.fastasyncworldedit",
65-
artifactId = "${rootProject.name}-${project.description}",
66-
version = "$version"
67-
)
68-
pom {
69-
name.set("${rootProject.name}-${project.description}" + " " + project.version)
70-
description.set("Blazingly fast Minecraft world manipulation for artists, builders and everyone else.")
71-
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
72-
73-
licenses {
74-
license {
75-
name.set("GNU General Public License, Version 3.0")
76-
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
77-
distribution.set("repo")
78-
}
79-
}
80-
81-
developers {
82-
developer {
83-
id.set("NotMyFault")
84-
name.set("Alexander Brandes")
85-
email.set("contact(at)notmyfault.dev")
86-
organization.set("IntellectualSites")
87-
organizationUrl.set("https://github.com/IntellectualSites")
88-
}
89-
developer {
90-
id.set("SirYwell")
91-
name.set("Hannes Greule")
92-
organization.set("IntellectualSites")
93-
organizationUrl.set("https://github.com/IntellectualSites")
94-
}
95-
developer {
96-
id.set("dordsor21")
97-
name.set("dordsor21")
98-
organization.set("IntellectualSites")
99-
organizationUrl.set("https://github.com/IntellectualSites")
64+
configure<PublishingExtension> {
65+
publications {
66+
register<MavenPublication>("maven") {
67+
from(javaComponent)
68+
69+
group = "com.fastasyncworldedit"
70+
artifactId = "${rootProject.name}-${project.description}"
71+
version = "$version"
72+
73+
pom {
74+
name.set("${rootProject.name}-${project.description}" + " " + project.version)
75+
description.set("Blazingly fast Minecraft world manipulation for artists, builders and everyone else.")
76+
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
77+
78+
licenses {
79+
license {
80+
name.set("GNU General Public License, Version 3.0")
81+
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
82+
distribution.set("repo")
83+
}
84+
}
85+
86+
developers {
87+
developer {
88+
id.set("NotMyFault")
89+
name.set("Alexander Brandes")
90+
email.set("contact(at)notmyfault.dev")
91+
organization.set("IntellectualSites")
92+
organizationUrl.set("https://github.com/IntellectualSites")
93+
}
94+
developer {
95+
id.set("SirYwell")
96+
name.set("Hannes Greule")
97+
organization.set("IntellectualSites")
98+
organizationUrl.set("https://github.com/IntellectualSites")
99+
}
100+
developer {
101+
id.set("dordsor21")
102+
name.set("dordsor21")
103+
organization.set("IntellectualSites")
104+
organizationUrl.set("https://github.com/IntellectualSites")
105+
}
106+
}
107+
108+
scm {
109+
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
110+
connection.set("scm:git:https://github.com/IntellectualSites/FastAsyncWorldEdit.git")
111+
developerConnection.set("scm:git:[email protected]:IntellectualSites/FastAsyncWorldEdit.git")
112+
tag.set("${project.version}")
113+
}
114+
115+
issueManagement {
116+
system.set("GitHub")
117+
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit/issues")
118+
}
100119
}
101120
}
102-
103-
scm {
104-
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit")
105-
connection.set("scm:git:https://github.com/IntellectualSites/FastAsyncWorldEdit.git")
106-
developerConnection.set("scm:git:[email protected]:IntellectualSites/FastAsyncWorldEdit.git")
107-
tag.set("${project.version}")
108-
}
109-
110-
issueManagement {
111-
system.set("GitHub")
112-
url.set("https://github.com/IntellectualSites/FastAsyncWorldEdit/issues")
113-
}
114-
115-
publishToMavenCentral()
116121
}
117122
}
118123

0 commit comments

Comments
 (0)