diff --git a/build.gradle.kts b/build.gradle.kts index 00e35e3..f0ab9bb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,9 @@ plugins { } group = "com.xuqm" +// Global fallback — individual modules override via their own SDK__VERSION property. +// Publish all at once: ./gradlew publish -PPUBLISH_VERSION=1.0.2 +// Publish one module: ./gradlew :sdk-license:publish -PSDK_LICENSE_VERSION=1.0.3 -PPUBLISH_VERSION=1.0.2 version = providers.gradleProperty("PUBLISH_VERSION").getOrElse("0.1.0-SNAPSHOT") ext["nexusUrl"] = "https://nexus.xuqinmin.com/repository/android-hosted/" diff --git a/gradle/publish.gradle b/gradle/publish.gradle index c51ed6d..1219de9 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -7,7 +7,7 @@ afterEvaluate { from components.release groupId rootProject.group artifactId project.name - version rootProject.version + version project.version } } repositories { diff --git a/sdk-core/build.gradle.kts b/sdk-core/build.gradle.kts index df4b86d..2c1e7b4 100644 --- a/sdk-core/build.gradle.kts +++ b/sdk-core/build.gradle.kts @@ -6,6 +6,10 @@ plugins { apply(from = rootProject.file("gradle/publish.gradle")) +version = providers.gradleProperty("SDK_CORE_VERSION") + .orElse(providers.gradleProperty("PUBLISH_VERSION")) + .getOrElse("0.1.0-SNAPSHOT") + android { namespace = "com.xuqm.sdk.core" compileSdk = libs.versions.compileSdk.get().toInt() diff --git a/sdk-im/build.gradle.kts b/sdk-im/build.gradle.kts index 5055b3a..d3f702a 100644 --- a/sdk-im/build.gradle.kts +++ b/sdk-im/build.gradle.kts @@ -4,6 +4,10 @@ plugins { apply(from = rootProject.file("gradle/publish.gradle")) +version = providers.gradleProperty("SDK_IM_VERSION") + .orElse(providers.gradleProperty("PUBLISH_VERSION")) + .getOrElse("0.1.0-SNAPSHOT") + android { namespace = "com.xuqm.sdk.im" compileSdk = libs.versions.compileSdk.get().toInt() diff --git a/sdk-license/build.gradle.kts b/sdk-license/build.gradle.kts index 585a467..879d964 100644 --- a/sdk-license/build.gradle.kts +++ b/sdk-license/build.gradle.kts @@ -5,6 +5,10 @@ plugins { apply(from = rootProject.file("gradle/publish.gradle")) +version = providers.gradleProperty("SDK_LICENSE_VERSION") + .orElse(providers.gradleProperty("PUBLISH_VERSION")) + .getOrElse("0.1.0-SNAPSHOT") + android { namespace = "com.xuqm.sdk.license" compileSdk = libs.versions.compileSdk.get().toInt() diff --git a/sdk-push/build.gradle.kts b/sdk-push/build.gradle.kts index 94faa68..a304074 100644 --- a/sdk-push/build.gradle.kts +++ b/sdk-push/build.gradle.kts @@ -4,6 +4,10 @@ plugins { apply(from = rootProject.file("gradle/publish.gradle")) +version = providers.gradleProperty("SDK_PUSH_VERSION") + .orElse(providers.gradleProperty("PUBLISH_VERSION")) + .getOrElse("0.1.0-SNAPSHOT") + android { namespace = "com.xuqm.sdk.push" compileSdk = libs.versions.compileSdk.get().toInt() diff --git a/sdk-update/build.gradle.kts b/sdk-update/build.gradle.kts index fb10a33..a86e1ee 100644 --- a/sdk-update/build.gradle.kts +++ b/sdk-update/build.gradle.kts @@ -4,6 +4,10 @@ plugins { apply(from = rootProject.file("gradle/publish.gradle")) +version = providers.gradleProperty("SDK_UPDATE_VERSION") + .orElse(providers.gradleProperty("PUBLISH_VERSION")) + .getOrElse("0.1.0-SNAPSHOT") + android { namespace = "com.xuqm.sdk.update" compileSdk = libs.versions.compileSdk.get().toInt() diff --git a/sdk-webview/build.gradle.kts b/sdk-webview/build.gradle.kts index e569f44..247d35a 100644 --- a/sdk-webview/build.gradle.kts +++ b/sdk-webview/build.gradle.kts @@ -5,6 +5,10 @@ plugins { apply(from = rootProject.file("gradle/publish.gradle")) +version = providers.gradleProperty("SDK_WEBVIEW_VERSION") + .orElse(providers.gradleProperty("PUBLISH_VERSION")) + .getOrElse("0.1.0-SNAPSHOT") + android { namespace = "com.xuqm.sdk.webview" compileSdk = libs.versions.compileSdk.get().toInt()