From 355fc86d60554cc520a9e19c4b26485cb282a78d Mon Sep 17 00:00:00 2001 From: skydoves Date: Sat, 11 Nov 2023 12:36:54 +0900 Subject: [PATCH] Update maven scripts --- README.md | 2 +- .../kotlin/com/github/skydoves/Configurations.kt | 6 ++++-- compose-stable-marker/build.gradle.kts | 16 ++++++++++++++++ gradle.properties | 7 ------- scripts/publish-module.gradle.kts | 13 +++++++++++++ 5 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 scripts/publish-module.gradle.kts diff --git a/README.md b/README.md index af045b4..3af3f09 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Add the `compileOnly` dependency below to your **module**'s `build.gradle.kts` f ```gradle dependencies { - compileOnly("com.github.skydoves:compose-stable-marker:1.0.2") + compileOnly("com.github.skydoves:compose-stable-marker:1.0.3") } ``` diff --git a/buildSrc/src/main/kotlin/com/github/skydoves/Configurations.kt b/buildSrc/src/main/kotlin/com/github/skydoves/Configurations.kt index 14891df..5f66a2d 100644 --- a/buildSrc/src/main/kotlin/com/github/skydoves/Configurations.kt +++ b/buildSrc/src/main/kotlin/com/github/skydoves/Configurations.kt @@ -22,7 +22,9 @@ object Configurations { const val minSdk = 21 const val majorVersion = 1 const val minorVersion = 0 - const val patchVersion = 1 + const val patchVersion = 3 const val versionName = "$majorVersion.$minorVersion.$patchVersion" - const val versionCode = 2 + const val versionCode = 4 + const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT" + const val artifactGroup = "com.github.skydoves" } diff --git a/compose-stable-marker/build.gradle.kts b/compose-stable-marker/build.gradle.kts index 6b79e04..a8fe088 100644 --- a/compose-stable-marker/build.gradle.kts +++ b/compose-stable-marker/build.gradle.kts @@ -25,6 +25,22 @@ plugins { id(libs.plugins.nexus.plugin.get().pluginId) } +apply(from = "${rootDir}/scripts/publish-module.gradle.kts") + +mavenPublishing { + val artifactId = "compose-stable-marker" + coordinates( + Configurations.artifactGroup, + artifactId, + rootProject.extra.get("libVersion").toString() + ) + + pom { + name.set(artifactId) + description.set("Compose stable markers for KMP to tell stable/immutable guarantees to the compose compiler.") + } +} + kotlin { jvmToolchain(11) diff --git a/gradle.properties b/gradle.properties index 47db12e..07a3f9d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -50,13 +50,6 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true # Increase timeout when pushing to Sonatype (otherwise we get timeouts) systemProp.org.gradle.internal.http.socketTimeout=120000 -GROUP=com.github.skydoves -VERSION_NAME=1.0.2 - -POM_ARTIFACT_ID=compose-stable-marker -POM_NAME=compose-stable-marker -POM_DESCRIPTION=Compose stable markers to tell stable/immutable guarantees to the compose compiler. - POM_URL=https://github.com/skydoves/compose-stable-marker/ POM_SCM_URL=https://github.com/skydoves/compose-stable-marker/ POM_SCM_CONNECTION=scm:git:git://github.com/skydoves/compose-stable-marker.git diff --git a/scripts/publish-module.gradle.kts b/scripts/publish-module.gradle.kts new file mode 100644 index 0000000..4376661 --- /dev/null +++ b/scripts/publish-module.gradle.kts @@ -0,0 +1,13 @@ +import com.github.skydoves.Configurations + +apply(plugin = "com.vanniktech.maven.publish") + +rootProject.extra.apply { + val snapshot = System.getenv("SNAPSHOT").toBoolean() + val libVersion = if (snapshot) { + Configurations.snapshotVersionName + } else { + Configurations.versionName + } + set("libVersion", libVersion) +}