-
-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch deployment to the central repository
- Loading branch information
1 parent
f036980
commit c18b0f9
Showing
1 changed file
with
27 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ plugins { | |
java | ||
`java-library` | ||
`maven-publish` | ||
signing | ||
|
||
alias(libs.plugins.shadow) | ||
alias(libs.plugins.licenser) | ||
|
@@ -21,7 +22,11 @@ val versionsuffix: String? by project | |
if (versionsuffix != null) { | ||
versuffix = "-$versionsuffix" | ||
} | ||
version = ver + versuffix | ||
version = if (!project.hasProperty("release")) { | ||
ver + versuffix | ||
} else { | ||
ver | ||
} | ||
|
||
allprojects { | ||
group = "com.plotsquared" | ||
|
@@ -59,22 +64,11 @@ subprojects { | |
plugin<MavenPublishPlugin>() | ||
plugin<ShadowPlugin>() | ||
plugin<Licenser>() | ||
plugin<SigningPlugin>() | ||
|
||
plugin<EclipsePlugin>() | ||
plugin<IdeaPlugin>() | ||
} | ||
|
||
tasks { | ||
// This is to create the target dir under the root project with all jars. | ||
val assembleTargetDir = create<Copy>("assembleTargetDirectory") { | ||
destinationDir = rootDir.resolve("target") | ||
into(destinationDir) | ||
from(withType<Jar>()) | ||
} | ||
named("build") { | ||
dependsOn(assembleTargetDir) | ||
} | ||
} | ||
} | ||
|
||
val javadocDir = rootDir.resolve("docs").resolve("javadoc").resolve(project.name) | ||
|
@@ -88,7 +82,6 @@ allprojects { | |
plugins.withId("java") { | ||
the<JavaPluginExtension>().toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(16)) | ||
vendor.set(JvmVendorSpec.ADOPTOPENJDK) | ||
} | ||
} | ||
|
||
|
@@ -103,6 +96,13 @@ allprojects { | |
withJavadocJar() | ||
} | ||
|
||
signing { | ||
if (!version.toString().endsWith("-SNAPSHOT")) { | ||
signing.isRequired | ||
sign(publishing.publications) | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
|
@@ -111,6 +111,11 @@ allprojects { | |
from(components["java"]) | ||
|
||
pom { | ||
|
||
name.set(project.name + " " + project.version) | ||
description.set("PlotSquared is a land and world management plugin for Minecraft.") | ||
url.set("https://github.com/IntellectualSites/PlotSquared") | ||
|
||
licenses { | ||
license { | ||
name.set("GNU General Public License, Version 3.0") | ||
|
@@ -143,6 +148,11 @@ allprojects { | |
connection.set("scm:https://[email protected]/IntellectualSites/PlotSquared.git") | ||
developerConnection.set("scm:git://github.com/IntellectualSites/PlotSquared.git") | ||
} | ||
|
||
issueManagement{ | ||
system.set("GitHub") | ||
url.set("https://github.com/IntellectualSites/PlotSquared/issues") | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -158,11 +168,11 @@ allprojects { | |
val nexusPassword: String? by project | ||
if (nexusUsername != null && nexusPassword != null) { | ||
maven { | ||
val repositoryUrl = "https://mvn.intellectualsites.com/content/repositories/releases/" | ||
val snapshotRepositoryUrl = "https://mvn.intellectualsites.com/content/repositories/snapshots/" | ||
val releasesRepositoryUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
val snapshotRepositoryUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" | ||
url = uri( | ||
if (version.toString().endsWith("-SNAPSHOT")) snapshotRepositoryUrl | ||
else repositoryUrl | ||
else releasesRepositoryUrl | ||
) | ||
|
||
credentials { | ||
|
@@ -179,7 +189,6 @@ allprojects { | |
tasks { | ||
named<Delete>("clean") { | ||
doFirst { | ||
rootDir.resolve("target").deleteRecursively() | ||
javadocDir.deleteRecursively() | ||
} | ||
} | ||
|
@@ -201,7 +210,6 @@ allprojects { | |
"implSpec:a:Implementation Requirements:", | ||
"implNote:a:Implementation Note:" | ||
) | ||
opt.destinationDirectory = javadocDir | ||
} | ||
|
||
jar { | ||
|