From 10983e7b7a0c5c5dc198812836f0377e0e66f4b1 Mon Sep 17 00:00:00 2001 From: slam Date: Fri, 2 Feb 2024 21:08:48 +0800 Subject: [PATCH] added: kmmbridge support - Publish KMMBridge --- build.gradle.kts | 12 +++++++++--- gradle.properties | 3 +++ shared/build.gradle.kts | 11 ++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5ad2554..0c92e5a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,12 +9,18 @@ dependencies { kover(project(":shared")) } +val autoVersion = project.property( + if (project.hasProperty("AUTO_VERSION")) { + "AUTO_VERSION" + } else { + "LIBRARY_VERSION" + } +) as String + subprojects { val GROUP: String by project - val LIBRARY_VERSION: String by project - group = GROUP - version = LIBRARY_VERSION + version = autoVersion } koverReport { diff --git a/gradle.properties b/gradle.properties index 99307a8..4ed2b7e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,6 +9,9 @@ kotlin.mpp.enableCInteropCommonization=true #Development development=true +# `ENABLE_PUBLISHING` - Gradle parameter. For local dev, by default we avoid certain operations that are only necessary if you are publishing. Pass in +# Package.swift will use binaryTarget path or binaryTarget url +ENABLE_PUBLISHING=true LIBRARY_VERSION=0.1 GROUP=com.snacks.lemonsqueezy \ No newline at end of file diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 6029bf9..f4170db 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -11,9 +11,9 @@ kotlin { jvm() listOf( macosArm64(), - iosX64(), - iosArm64(), - iosSimulatorArm64() +// iosX64(), +// iosArm64(), +// iosSimulatorArm64() ).forEach { iosTarget -> iosTarget.binaries.framework { baseName = "Shared" @@ -51,6 +51,9 @@ multiplatformSwiftPackage { } } + +addGithubPackagesRepository() // <- Add the GitHub Packages repo + kmmbridge { /** * reference: https://kmmbridge.touchlab.co/docs/artifacts/MAVEN_REPO_ARTIFACTS#github-packages @@ -69,8 +72,6 @@ kmmbridge { // } } -addGithubPackagesRepository() // <- Add the GitHub Packages repo - tasks { named("jvmTest") { useJUnitPlatform()