diff --git a/build.gradle.kts b/build.gradle.kts index 0ba097db5..a51f39d94 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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() plugin() plugin() + plugin() plugin() plugin() } - - tasks { - // This is to create the target dir under the root project with all jars. - val assembleTargetDir = create("assembleTargetDirectory") { - destinationDir = rootDir.resolve("target") - into(destinationDir) - from(withType()) - } - named("build") { - dependsOn(assembleTargetDir) - } - } } val javadocDir = rootDir.resolve("docs").resolve("javadoc").resolve(project.name) @@ -88,7 +82,6 @@ allprojects { plugins.withId("java") { the().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("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://IntellectualSites@github.com/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("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 {