mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
ci: Switch deployment to gh actions and use semver & java 17
This commit is contained in:
@ -29,4 +29,5 @@ dependencies {
|
||||
implementation("org.ajoberstar.grgit:grgit-gradle:4.1.0")
|
||||
implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.0")
|
||||
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.1.14")
|
||||
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ fun Project.applyCommonConfiguration() {
|
||||
|
||||
plugins.withId("java") {
|
||||
the<JavaPluginExtension>().toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(16))
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, banSlf4j: Boolean
|
||||
val disabledLint = listOf(
|
||||
"processing", "path", "fallthrough", "serial"
|
||||
)
|
||||
options.release.set(11)
|
||||
options.release.set(17)
|
||||
options.compilerArgs.addAll(listOf("-Xlint:all") + disabledLint.map { "-Xlint:-$it" })
|
||||
options.isDeprecation = true
|
||||
options.encoding = "UTF-8"
|
||||
@ -32,7 +32,7 @@ fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, banSlf4j: Boolean
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 16)
|
||||
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import io.github.gradlenexus.publishplugin.NexusPublishExtension
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.ExternalModuleDependency
|
||||
@ -21,6 +22,8 @@ import org.gradle.kotlin.dsl.invoke
|
||||
import org.gradle.kotlin.dsl.named
|
||||
import org.gradle.kotlin.dsl.provideDelegate
|
||||
import org.gradle.kotlin.dsl.register
|
||||
import org.gradle.plugins.signing.SigningExtension
|
||||
import java.net.URI
|
||||
import javax.inject.Inject
|
||||
|
||||
fun Project.applyLibrariesConfiguration() {
|
||||
@ -28,6 +31,8 @@ fun Project.applyLibrariesConfiguration() {
|
||||
apply(plugin = "java-base")
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
apply(plugin = "signing")
|
||||
apply(plugin = "io.github.gradle-nexus.publish-plugin")
|
||||
|
||||
configurations {
|
||||
create("shade")
|
||||
@ -112,7 +117,7 @@ fun Project.applyLibrariesConfiguration() {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
||||
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.SHADOWED))
|
||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
|
||||
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 11)
|
||||
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
|
||||
}
|
||||
outgoing.artifact(tasks.named("jar"))
|
||||
}
|
||||
@ -127,7 +132,7 @@ fun Project.applyLibrariesConfiguration() {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
||||
attribute(Bundling.BUNDLING_ATTRIBUTE, project.objects.named(Bundling.SHADOWED))
|
||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements.JAR))
|
||||
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 11)
|
||||
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
|
||||
}
|
||||
outgoing.artifact(tasks.named("jar"))
|
||||
}
|
||||
@ -158,6 +163,16 @@ fun Project.applyLibrariesConfiguration() {
|
||||
mapToMavenScope("runtime")
|
||||
}
|
||||
|
||||
configure<SigningExtension> {
|
||||
if (!version.toString().endsWith("-SNAPSHOT")) {
|
||||
val signingKey: String? by project
|
||||
val signingPassword: String? by project
|
||||
useInMemoryPgpKeys(signingKey, signingPassword)
|
||||
isRequired
|
||||
sign(tasks["publications"])
|
||||
}
|
||||
}
|
||||
|
||||
configure<PublishingExtension> {
|
||||
publications {
|
||||
register<MavenPublication>("maven") {
|
||||
@ -212,31 +227,13 @@ fun Project.applyLibrariesConfiguration() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configure<NexusPublishExtension> {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
val nexusUsername: String? by project
|
||||
val nexusPassword: String? by project
|
||||
if (nexusUsername != null && nexusPassword != null) {
|
||||
maven {
|
||||
val releasesRepositoryUrl = "https://mvn.intellectualsites.com/content/repositories/releases/"
|
||||
val snapshotRepositoryUrl = "https://mvn.intellectualsites.com/content/repositories/snapshots/"
|
||||
/* Commenting this out for now - Fawe currently does not user semver or any sort of versioning that
|
||||
differentiates between snapshots and releases, API & (past) deployment wise, this will come with a next major release.
|
||||
url = uri(
|
||||
if (version.toString().endsWith("-SNAPSHOT")) snapshotRepositoryUrl
|
||||
else releasesRepositoryUrl
|
||||
)
|
||||
*/
|
||||
url = uri(releasesRepositoryUrl)
|
||||
|
||||
credentials {
|
||||
username = nexusUsername
|
||||
password = nexusPassword
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.warn("No nexus repository is added; nexusUsername or nexusPassword is null.")
|
||||
sonatype {
|
||||
nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/"))
|
||||
snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,9 @@ 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.plugins.signing.SigningExtension
|
||||
import io.github.gradlenexus.publishplugin.NexusPublishExtension
|
||||
import java.net.URI
|
||||
|
||||
fun Project.applyPlatformAndCoreConfiguration() {
|
||||
applyCommonConfiguration()
|
||||
@ -20,6 +23,8 @@ fun Project.applyPlatformAndCoreConfiguration() {
|
||||
apply(plugin = "idea")
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
apply(plugin = "signing")
|
||||
apply(plugin = "io.github.gradle-nexus.publish-plugin")
|
||||
|
||||
applyCommonJavaConfiguration(
|
||||
sourcesJar = name in setOf("worldedit-core", "worldedit-bukkit"),
|
||||
@ -45,6 +50,16 @@ fun Project.applyPlatformAndCoreConfiguration() {
|
||||
skip()
|
||||
}
|
||||
|
||||
configure<SigningExtension> {
|
||||
if (!version.toString().endsWith("-SNAPSHOT")) {
|
||||
val signingKey: String? by project
|
||||
val signingPassword: String? by project
|
||||
useInMemoryPgpKeys(signingKey, signingPassword)
|
||||
isRequired
|
||||
sign(tasks["publications"])
|
||||
}
|
||||
}
|
||||
|
||||
configure<PublishingExtension> {
|
||||
publications {
|
||||
register<MavenPublication>("maven") {
|
||||
@ -99,31 +114,13 @@ fun Project.applyPlatformAndCoreConfiguration() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configure<NexusPublishExtension> {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
val nexusUsername: String? by project
|
||||
val nexusPassword: String? by project
|
||||
if (nexusUsername != null && nexusPassword != null) {
|
||||
maven {
|
||||
val releasesRepositoryUrl = "https://mvn.intellectualsites.com/content/repositories/releases/"
|
||||
val snapshotRepositoryUrl = "https://mvn.intellectualsites.com/content/repositories/snapshots/"
|
||||
/* Commenting this out for now - Fawe currently does not user semver or any sort of versioning that
|
||||
differentiates between snapshots and releases, API & (past) deployment wise, this will come with a next major release.
|
||||
url = uri(
|
||||
if (version.toString().endsWith("-SNAPSHOT")) snapshotRepositoryUrl
|
||||
else releasesRepositoryUrl
|
||||
)
|
||||
*/
|
||||
url = uri(releasesRepositoryUrl)
|
||||
|
||||
credentials {
|
||||
username = nexusUsername
|
||||
password = nexusPassword
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.warn("No nexus repository is added; nexusUsername or nexusPassword is null.")
|
||||
sonatype {
|
||||
nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/"))
|
||||
snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user