From 463fc83f785eb7dfe5ba70c54fd75fa037363439 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Sun, 24 Apr 2022 13:16:39 -0500 Subject: [PATCH] Publishing changes --- Jenkinsfile | 10 ++++-- .../kotlin/geyser.api-conventions.gradle.kts | 2 +- .../geyser.platform-conventions.gradle.kts | 2 +- .../geyser.publish-conventions.gradle.kts | 31 +++++++++++++++++++ .../geyser.shadow-conventions.gradle.kts | 23 -------------- build.gradle.kts | 2 +- core/build.gradle.kts | 1 + 7 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 build-logic/src/main/kotlin/geyser.publish-conventions.gradle.kts diff --git a/Jenkinsfile b/Jenkinsfile index 3e485bc10..f92778318 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,12 @@ pipeline { stage ('Build') { steps { sh 'git submodule update --init --recursive' - sh './gradlew clean build' + rtGradleRun( + usesPlugin: true, + tool: 'Gradle 7', + buildFile: 'build.gradle.kts', + tasks: 'clean build', + ) } post { success { @@ -40,9 +45,10 @@ pipeline { serverId: "opencollab-artifactory" ) rtGradleRun( - usesPlugin: false, + usesPlugin: true, tool: 'Gradle 7', rootDir: "", + useWrapper: true, buildFile: 'build.gradle.kts', tasks: 'build artifactoryPublish', deployerId: "GRADLE_DEPLOYER", diff --git a/build-logic/src/main/kotlin/geyser.api-conventions.gradle.kts b/build-logic/src/main/kotlin/geyser.api-conventions.gradle.kts index 0781436c4..31117f2da 100644 --- a/build-logic/src/main/kotlin/geyser.api-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/geyser.api-conventions.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("geyser.shadow-conventions") + id("geyser.api-conventions") } tasks { diff --git a/build-logic/src/main/kotlin/geyser.platform-conventions.gradle.kts b/build-logic/src/main/kotlin/geyser.platform-conventions.gradle.kts index 07968f231..81d224906 100644 --- a/build-logic/src/main/kotlin/geyser.platform-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/geyser.platform-conventions.gradle.kts @@ -1,4 +1,4 @@ plugins { application - id("geyser.shadow-conventions") + id("geyser.publish-conventions") } \ No newline at end of file diff --git a/build-logic/src/main/kotlin/geyser.publish-conventions.gradle.kts b/build-logic/src/main/kotlin/geyser.publish-conventions.gradle.kts new file mode 100644 index 000000000..6336e7887 --- /dev/null +++ b/build-logic/src/main/kotlin/geyser.publish-conventions.gradle.kts @@ -0,0 +1,31 @@ +plugins { + id("geyser.shadow-conventions") + id("com.jfrog.artifactory") + id("maven-publish") +} + +publishing { + publications.create("mavenJava") { + groupId = project.group as String + artifactId = "Geyser-" + project.name + version = project.version as String + + artifact(tasks["shadowJar"]) + artifact(tasks["sourcesJar"]) + } +} + +artifactory { + publish { + repository { + setRepoKey(if (isSnapshot()) "maven-snapshots" else "maven-releases") + setMavenCompatible(true) + } + defaults { + publishConfigs("archives") + setPublishArtifacts(true) + setPublishPom(true) + setPublishIvy(false) + } + } +} \ No newline at end of file diff --git a/build-logic/src/main/kotlin/geyser.shadow-conventions.gradle.kts b/build-logic/src/main/kotlin/geyser.shadow-conventions.gradle.kts index ddd427897..395beb104 100644 --- a/build-logic/src/main/kotlin/geyser.shadow-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/geyser.shadow-conventions.gradle.kts @@ -3,7 +3,6 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { id("geyser.base-conventions") id("com.github.johnrengelman.shadow") - id("com.jfrog.artifactory") } tasks { @@ -30,26 +29,4 @@ tasks { named("build") { dependsOn(shadowJar) } -} - -publishing { - publications.named("mavenJava") { - artifact(tasks["shadowJar"]) - artifact(tasks["sourcesJar"]) - } -} - -artifactory { - publish { - repository { - setRepoKey("maven-snapshots") - setMavenCompatible(true) - } - defaults { - publishConfigs("archives") - setPublishArtifacts(true) - setPublishPom(true) - setPublishIvy(false) - } - } } \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index bf6c1df4d..aa35c9345 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -41,7 +41,7 @@ subprojects { group = rootProject.group as String + ".geyser" when (this) { in platforms -> plugins.apply("geyser.platform-conventions") - api -> plugins.apply("geyser.shadow-conventions") + api -> plugins.apply("geyser.publish-conventions") else -> plugins.apply("geyser.base-conventions") } } diff --git a/core/build.gradle.kts b/core/build.gradle.kts index c22df20ba..5ab2c3932 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -4,6 +4,7 @@ import net.kyori.blossom.BlossomExtension plugins { id("net.kyori.blossom") id("net.kyori.indra.git") + id("geyser.shadow-conventions") } dependencies {