From 3ead2a6f8a4a4fd111fd7b9e7a4e0c7529493aba Mon Sep 17 00:00:00 2001 From: lesclaz Date: Sun, 25 Feb 2024 13:12:11 -0500 Subject: [PATCH] various improvements --- build.gradle.kts | 54 ++++++++++++++++++++++++------ pom_gradle.txt | 86 ------------------------------------------------ 2 files changed, 44 insertions(+), 96 deletions(-) delete mode 100644 pom_gradle.txt diff --git a/build.gradle.kts b/build.gradle.kts index 7f792eb..be862ba 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,9 @@ +import cl.franciscosolis.sonatypecentralupload.SonatypeCentralUploadTask + plugins { kotlin("jvm") version "1.9.22" - id("cl.franciscosolis.sonatype-central-upload") version "1.0.0" + `maven-publish` + id("cl.franciscosolis.sonatype-central-upload") version "1.0.2" id("com.google.devtools.ksp").version("1.9.22-1.0.17") } @@ -40,21 +43,52 @@ kotlin { jvmToolchain(17) } -sonatypeCentralUpload { +publishing { + publications { + register("maven") { + pom { + name.set(project.name) + description.set("A tool designed to interact with ETECSA services.") + url.set("http://github.com/suitetecsa/nauta-connect") + licenses { + license { + name.set("MIT License") + url.set("http://github.com/suitetecsa/nauta-connect/blob/master/LICENSE") + distribution.set("repo") + } + } + developers { + developer { + id.set("lesclaz") + name.set("Lesly Cintra") + email.set("lesclaz95@gmail.com") + } + } + scm { + url.set("http://github.com/suitetecsa/nauta-connect/tree/master") + connection.set("scm:git:git://github.com/suitetecsa/nauta-connect.git") + developerConnection.set("scm:git:ssh://github.com/suitetecsa/nauta-connect.git") + } + } + } + } +} + +tasks.named("sonatypeCentralUpload") { + dependsOn("jar", "sourcesJar", "javadocJar", "generatePomFileForMavenPublication") + username = System.getenv("SONATYPE_USERNAME") password = System.getenv("SONATYPE_PASSWORD") archives = files( - "build/libs/nauta-connect-${version}.jar", - "build/libs/nauta-connect-${version}-javadoc.jar", - "build/libs/nauta-connect-${version}-sources.jar" + tasks.named("jar"), + tasks.named("sourcesJar"), + tasks.named("javadocJar"), + ) + pom = file( + tasks.named("generatePomFileForMavenPublication").get().outputs.files.single() ) - pom = file("./pom_gradle.txt") signingKey = System.getenv("SIGNING_KEY") signingKeyPassphrase = System.getenv("SIGNING_KEY_PASSPHRASE") } - -tasks.sonatypeCentralUpload { - dependsOn("build") -} diff --git a/pom_gradle.txt b/pom_gradle.txt deleted file mode 100644 index dd86350..0000000 --- a/pom_gradle.txt +++ /dev/null @@ -1,86 +0,0 @@ - - - 4.0.0 - - io.github.suitetecsa - nauta-connect - 0.1.4-alpha01 - jar - - nauta-connect - A tool designed to interact with ETECSA services. - http://github.com/suitetecsa/nauta-connect - - - - MIT License - https://www.mit.edu/~amini/LICENSE.md - - - - - - Lesly Cintra - lesclaz95@gmail.com - - - - - scm:git:git://github.com/suitetecsa/nauta-connect.git - scm:git:ssh://github.com:suitetecsa/nauta-connect.git - http://github.com/suitetecsa/nauta-connect/tree/master - - - - - org.jetbrains - annotations - 24.0.0 - runtime - - - org.jsoup - jsoup - 1.17.2 - runtime - - - com.squareup.retrofit2 - retrofit - 2.9.0 - runtime - - - com.squareup.retrofit2 - converter-moshi - 2.9.0 - runtime - - - com.squareup.moshi - moshi-kotlin - 1.15.1 - runtime - - - com.jakewharton.retrofit - retrofit2-kotlin-coroutines-adapter - 0.9.2 - runtime - - - com.squareup.retrofit2 - adapter-rxjava3 - Introduce local variable - runtime - - - com.auth0 - java-jwt - 3.18.2 - runtime - - -