From baa2d86d5f33123b339c8933ce75ed949471923b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Gryta?= Date: Thu, 24 Oct 2024 09:31:58 +0200 Subject: [PATCH] Change publishing plugin --- .github/workflows/build.yaml | 2 +- gradle/libs.versions.toml | 2 ++ library/build.gradle.kts | 47 ++++++++++++++++++++++++++++++------ library/version.properties | 2 +- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4f285a2..015b52b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -45,4 +45,4 @@ jobs: env: GPR_USERNAME: ${{ secrets.GPR_USERNAME }} GPR_TOKEN: ${{ secrets.GPR_TOKEN }} - run: ./gradlew publish --no-daemon --stacktrace --info --scan + run: ./gradlew publishAllPublicationsToGitHubPackagesRepository --no-daemon --stacktrace --info --scan --no-configuration-cache diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e4b9669..58fd3af 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,6 +5,7 @@ kotlin = "2.0.21" kotlinx-coroutines = "1.9.0" kotlinx-serialization = "1.7.3" ktor = "3.0.0-rc-1" +vanniktech = "0.30.0" [libraries] kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } @@ -28,3 +29,4 @@ kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-t android-library = { id = "com.android.library", version.ref = "agp" } kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +venniktech = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech" } \ No newline at end of file diff --git a/library/build.gradle.kts b/library/build.gradle.kts index 8987178..0f7f252 100644 --- a/library/build.gradle.kts +++ b/library/build.gradle.kts @@ -1,3 +1,4 @@ +import com.vanniktech.maven.publish.SonatypeHost import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest @@ -10,7 +11,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlinx.serialization) - id("maven-publish") + alias(libs.plugins.venniktech) } val versions = Properties() @@ -22,6 +23,8 @@ group = "io.wellmate" version = versions.getProperty("version") kotlin { + withSourcesJar(publish = false) + jvmToolchain(17) androidTarget { publishLibraryVariants("release") @@ -119,14 +122,42 @@ publishing { } } } - publications { - create("ReleaseAar") { - groupId = "io.wellmate" - artifactId = "api.client" - version = versions.getProperty("version") - afterEvaluate { - artifact(tasks.getByName("bundleReleaseAar")) +} + +mavenPublishing { + coordinates( + groupId = "io.wellmate", + artifactId = "api.client", + version = versions.getProperty("version") + ) + + pom { + name.set("KMP Library containing WellMate API Client") + description.set("This library can be utilized by various KMP targets to connect with WellMate API") + inceptionYear.set("2024") + url.set("https://github.com/wellmateio/WellMate-Kotlin-API-Client") + + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + + developers { + developer { + id.set("rgryta") + name.set("Radosław Gryta") + email.set("radek.gryta@gmail.com") + url.set("https://github.com/rgryta/") } } + + scm { + url.set("https://github.com/wellmateio/WellMate-Kotlin-API-Client") + connection.set("scm:git:git://github.com/wellmateio/WellMate-Kotlin-API-Client.git") + developerConnection.set("scm:git:ssh://git@github.com/wellmateio/WellMate-Kotlin-API-Client.git") + } } } \ No newline at end of file diff --git a/library/version.properties b/library/version.properties index beb72cc..5f233db 100644 --- a/library/version.properties +++ b/library/version.properties @@ -1 +1 @@ -version=1.0.0 \ No newline at end of file +version=0.0.0 \ No newline at end of file