diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 4a61801f..b33c3404 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,6 +12,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + submodules: recursive - name: Checkout actions uses: actions/checkout@v4 with: diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index 5b7fc9cc..d81ae9eb 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -18,6 +18,8 @@ jobs: steps: - name: Checkout project uses: actions/checkout@v4 + with: + submodules: recursive - name: Checkout validator action uses: actions/checkout@v4 with: @@ -39,6 +41,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + submodules: recursive - name: Cache uses: actions/cache@v4 with: diff --git a/build.gradle.kts b/build.gradle.kts index d088d20b..7191f392 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,16 @@ +import com.pubnub.gradle.enableAnyIosTarget import com.pubnub.gradle.tasks.GenerateVersionTask +import org.jetbrains.kotlin.gradle.plugin.cocoapods.CocoapodsExtension plugins { - kotlin("multiplatform") version "2.0.0" - kotlin("plugin.serialization") version "2.0.0" - kotlin("native.cocoapods") version "2.0.0" + kotlin("multiplatform") version "2.0.0" apply false + kotlin("plugin.serialization") version "2.0.0" apply false + kotlin("native.cocoapods") version "2.0.0" apply false + id("org.jlleitschuh.gradle.ktlint") version "12.1.0" apply false id("org.jetbrains.kotlin.plugin.atomicfu") version "2.0.0" - id("org.jlleitschuh.gradle.ktlint") version "12.1.0" - id("com.vanniktech.maven.publish") version "0.29.0" - id("org.jetbrains.dokka") version "1.9.20" + id("com.vanniktech.maven.publish") version "0.29.0" apply false + id("org.jetbrains.dokka") version "1.9.20" apply false + id("pubnub.shared") id("pubnub.dokka") id("pubnub.multiplatform") @@ -23,9 +26,11 @@ kotlin { } } - val iosMain by getting { - dependencies { - api(project(":pubnub-chat-impl")) + if (enableAnyIosTarget) { + val iosMain by getting { + dependencies { + api(project(":pubnub-chat-impl")) + } } } @@ -37,15 +42,16 @@ kotlin { } } - cocoapods { + if (enableAnyIosTarget) { + (this as ExtensionAware).extensions.configure { + summary = "Some description for a Kotlin/Native module" + homepage = "Link to a Kotlin/Native module homepage" - summary = "Some description for a Kotlin/Native module" - homepage = "Link to a Kotlin/Native module homepage" - - framework { - baseName = "PubNubChat" - export(project(":pubnub-chat-api")) - export(project(":pubnub-chat-impl")) + framework { + baseName = "PubNubChat" + export(project(":pubnub-chat-api")) + export(project(":pubnub-chat-impl")) + } } } } diff --git a/gradle.properties b/gradle.properties index e5a85afe..83989355 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ POM_PACKAGING=jar VERSION_NAME=0.8.0-DEV POM_NAME=PubNub Chat SDK -POM_DESCRIPTION=PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second! +POM_DESCRIPTION=This SDK offers a set of handy methods to create your own feature-rich chat or add a chat to your existing application. POM_INCEPTION_YEAR=2024 POM_URL=https://github.com/pubnub/kmp-chat @@ -30,4 +30,8 @@ POM_DEVELOPER_NAME=PubNub POM_DEVELOPER_URL=support@pubnub.com IOS_SIMULATOR_ID=iPhone 15 Pro -SWIFT_PATH=pubnub-kotlin/swift \ No newline at end of file +SWIFT_PATH=pubnub-kotlin/swift + +ENABLE_TARGET_JS=false +ENABLE_TARGET_IOS=false +ENABLE_TARGET_IOS_SIMULATOR=false \ No newline at end of file diff --git a/pubnub-chat-api/build.gradle.kts b/pubnub-chat-api/build.gradle.kts index db7b73ee..62336c03 100644 --- a/pubnub-chat-api/build.gradle.kts +++ b/pubnub-chat-api/build.gradle.kts @@ -1,8 +1,6 @@ plugins { - kotlin("multiplatform") version "2.0.0" kotlin("plugin.serialization") version "2.0.0" id("org.jetbrains.kotlin.plugin.atomicfu") version "2.0.0" - id("org.jlleitschuh.gradle.ktlint") version "12.1.0" id("pubnub.shared") id("pubnub.dokka") id("pubnub.multiplatform") diff --git a/pubnub-chat-impl/build.gradle.kts b/pubnub-chat-impl/build.gradle.kts index 4e29a2ed..c01c59da 100644 --- a/pubnub-chat-impl/build.gradle.kts +++ b/pubnub-chat-impl/build.gradle.kts @@ -1,35 +1,15 @@ +import com.pubnub.gradle.enableAnyIosTarget +import com.pubnub.gradle.enableJsTarget +import org.jetbrains.kotlin.gradle.plugin.cocoapods.CocoapodsExtension + plugins { - kotlin("multiplatform") version "2.0.0" kotlin("plugin.serialization") version "2.0.0" - kotlin("native.cocoapods") version "2.0.0" - id("dev.mokkery") version "2.0.0" id("org.jetbrains.kotlin.plugin.atomicfu") version "2.0.0" - id("org.jlleitschuh.gradle.ktlint") version "12.1.0" id("pubnub.ios-simulator-test") id("pubnub.shared") id("pubnub.dokka") id("pubnub.multiplatform") -} - -ktlint { - outputToConsole.set(true) - verbose.set(true) - additionalEditorconfig.set( - mapOf( - "ij_kotlin_imports_layout" to "*,java.**,javax.**,kotlin.**,^", - "indent_size" to "4", - "ktlint_standard_multiline-expression-wrapping" to "disabled", - "ktlint_standard_string-template-indent" to "disabled", - "ktlint_standard_max-line-length" to "disabled", - "ktlint_standard_if-else-wrapping" to "disabled", - "ktlint_standard_discouraged-comment-location" to "disabled", - "ktlint_standard_trailing-comma-on-declaration-site" to "disabled", - "ktlint_standard_trailing-comma-on-call-site" to "disabled", - "ktlint_standard_function-signature" to "disabled", - "ktlint_standard_filename" to "disabled", - "ktlint_standard_function-naming" to "disabled", - ) - ) + id("dev.mokkery") version "2.0.0" } kotlin { @@ -60,15 +40,19 @@ kotlin { } } - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) + if (enableJsTarget) { + val jsTest by getting { + dependencies { + implementation(kotlin("test-js")) + } } } } - cocoapods { - summary = "Some description for a Kotlin/Native module" - homepage = "Link to a Kotlin/Native module homepage" + if (enableAnyIosTarget) { + (this as ExtensionAware).extensions.configure { + summary = "Some description for a Kotlin/Native module" + homepage = "Link to a Kotlin/Native module homepage" + } } } diff --git a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChatIntegrationTest.kt b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChatIntegrationTest.kt index dc16ca51..0c25f9ba 100644 --- a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChatIntegrationTest.kt +++ b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/ChatIntegrationTest.kt @@ -463,8 +463,8 @@ class ChatIntegrationTest : BaseChatIntegrationTest() { assertEquals(1, currentUserMentionsResult.enhancedMentionsData.size) val userMentionData = currentUserMentionsResult.enhancedMentionsData.first() as ThreadMentionData assertEquals(userId, userMentionData.userId) - assertEquals(true, userMentionData.parentChannelId?.contains(CHANNEL_ID_OF_PARENT_MESSAGE_PREFIX)) - assertEquals(true, userMentionData.threadChannelId?.contains(THREAD_CHANNEL_ID_PREFIX)) + assertEquals(true, userMentionData.parentChannelId.contains(CHANNEL_ID_OF_PARENT_MESSAGE_PREFIX)) + assertEquals(true, userMentionData.threadChannelId.contains(THREAD_CHANNEL_ID_PREFIX)) assertTrue(userMentionData.event.payload is EventContent.Mention) assertEquals(message, userMentionData.message?.content?.text) diff --git a/pubnub-kotlin b/pubnub-kotlin index 55f86ce7..1df320b0 160000 --- a/pubnub-kotlin +++ b/pubnub-kotlin @@ -1 +1 @@ -Subproject commit 55f86ce7bf2c05a87cf1d28a9bab78eb7a8f59ab +Subproject commit 1df320b0e7ed13dc2f47c87a7d70c56d7a5e3b9a