Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KMP] JS CustomMessageType support + build tweaks #321

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/commands-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Process command
if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true
runs-on:
group: organization/Default
group: macos-gh
steps:
- name: Check referred user
id: user-check
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ out/
test.properties
local.properties
*.DS_STORE
*.podspec

# GitHub Actions #
##################
Expand Down
13 changes: 9 additions & 4 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: kotlin
version: 10.3.0
version: 10.3.1
schema: 1
scm: github.com/pubnub/kotlin
files:
- build/libs/pubnub-kotlin-10.3.0-all.jar
- build/libs/pubnub-kotlin-10.3.1-all.jar
sdks:
-
type: library
Expand All @@ -23,8 +23,8 @@ sdks:
-
distribution-type: library
distribution-repository: maven
package-name: pubnub-kotlin-10.3.0
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.3.0/pubnub-kotlin-10.3.0.jar
package-name: pubnub-kotlin-10.3.1
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.3.1/pubnub-kotlin-10.3.1.jar
supported-platforms:
supported-operating-systems:
Android:
Expand Down Expand Up @@ -114,6 +114,11 @@ sdks:
license-url: https://www.apache.org/licenses/LICENSE-2.0.txt
is-required: Required
changelog:
- date: 2024-12-12
version: v10.3.1
changes:
- type: improvement
text: "Internal changes for Chat SDK."
- date: 2024-12-05
version: v10.3.0
changes:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v10.3.1
December 12 2024

#### Modified
- Internal changes for Chat SDK.

## v10.3.0
December 05 2024

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your
<dependency>
<groupId>com.pubnub</groupId>
<artifactId>pubnub-kotlin</artifactId>
<version>10.3.0</version>
<version>10.3.1</version>
</dependency>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.pubnub.gradle

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.tasks.testing.AbstractTestTask
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
Expand Down Expand Up @@ -38,9 +39,16 @@ class PubNubKotlinMultiplatformPlugin : Plugin<Project> {
}

pod("PubNubSwift") {
// val swiftPath = project.findProperty("SWIFT_PATH") as? String ?: "swift"
// source = path(rootProject.file(swiftPath))
version = "8.2.2"
val swiftPath = project.findProperty("SWIFT_PATH") as? String
if (swiftPath != null) {
source = path(rootProject.file(swiftPath))
} else {
version = project.rootProject
.extensions
.getByType(VersionCatalogsExtension::class.java)
.named("libs")
.findVersion("pubnub.swift").get().requiredVersion
}
moduleName = "PubNubSDK"
extraOpts += listOf("-compiler-option", "-fmodules")
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RELEASE_SIGNING_ENABLED=true
SONATYPE_HOST=DEFAULT
SONATYPE_AUTOMATIC_RELEASE=false
GROUP=com.pubnub
VERSION_NAME=10.3.0
VERSION_NAME=10.3.1
POM_PACKAGING=jar

POM_NAME=PubNub SDK
Expand All @@ -39,7 +39,7 @@ POM_DEVELOPER_NAME=PubNub
[email protected]

IOS_SIMULATOR_ID=iPhone 15 Pro
SWIFT_PATH=swift
#SWIFT_PATH=../swift
wkal-pubnub marked this conversation as resolved.
Show resolved Hide resolved

ENABLE_TARGET_JS=true
ENABLE_TARGET_IOS_OTHER=false
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ vanniktech = "0.29.0"
ktlint = "12.1.0"
dokka = "1.9.20"
kotlinx_datetime = "0.6.1"
kotlinx_coroutines = "1.8.1"
kotlinx_coroutines = "1.9.0"
pubnub_js = "8.3.1"
pubnub_swift = "8.2.2"

[libraries]
retrofit2 = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit2" }
Expand Down
8 changes: 4 additions & 4 deletions kotlin-js-store/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,10 @@ proxy-from-env@^1.1.0:
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==

pubnub@8.2.8:
version "8.2.8"
resolved "https://registry.yarnpkg.com/pubnub/-/pubnub-8.2.8.tgz#68d3b84d07e128b29f74c6c46495f0c5bedd1a3f"
integrity sha512-OREW+YDWWocOaz16jbrrybD0AyqEFuskCGi+EMgOb9FUJkuYPnInjlMSAUBBrlx7lMTARMQxx3Sk0EIvbB3hig==
pubnub@8.3.1:
version "8.3.1"
resolved "https://registry.yarnpkg.com/pubnub/-/pubnub-8.3.1.tgz#48b6c2468452427c9d1aa9a51e78781d25eec660"
integrity sha512-+aFp84Jsqpmu9utci8uQhABTMoh1Uk8UafGS1QANSkceXX3HDRTQnpTw8itH0UchzCS9pSfUATTl+Ay3jvM5EA==
dependencies:
agentkeepalive "^3.5.2"
buffer "^6.0.3"
Expand Down
54 changes: 0 additions & 54 deletions pubnub-kotlin/pubnub-kotlin-api/PubNubKMP.podspec

This file was deleted.

2 changes: 1 addition & 1 deletion pubnub-kotlin/pubnub-kotlin-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ kotlin {
if (enableJsTarget) {
val jsMain by getting {
dependencies {
implementation(npm("pubnub", "8.2.8"))
implementation(npm("pubnub", libs.versions.pubnub.js.get()))
}
}
}
Expand Down
56 changes: 28 additions & 28 deletions pubnub-kotlin/pubnub-kotlin-api/config/ktlint/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,28 @@
</file>
<file name="src/jsMain/kotlin/Pubnub.d.kt">
<error line="156" column="40" source="standard:comment-wrapping" />
<error line="409" column="15" source="standard:class-naming" />
<error line="425" column="15" source="standard:class-naming" />
<error line="441" column="15" source="standard:class-naming" />
<error line="453" column="15" source="standard:class-naming" />
<error line="461" column="15" source="standard:class-naming" />
<error line="469" column="15" source="standard:class-naming" />
<error line="485" column="15" source="standard:class-naming" />
<error line="498" column="15" source="standard:class-naming" />
<error line="845" column="13" source="standard:property-naming" />
<error line="1030" column="15" source="standard:class-naming" />
<error line="1036" column="15" source="standard:class-naming" />
<error line="1156" column="13" source="standard:property-naming" />
<error line="1162" column="13" source="standard:property-naming" />
<error line="1164" column="13" source="standard:property-naming" />
<error line="1224" column="39" source="standard:comment-wrapping" />
<error line="1309" column="15" source="standard:class-naming" />
<error line="1337" column="42" source="standard:comment-wrapping" />
<error line="1387" column="37" source="standard:comment-wrapping" />
<error line="1408" column="13" source="standard:property-naming" />
<error line="1409" column="13" source="standard:property-naming" />
<error line="411" column="15" source="standard:class-naming" />
<error line="428" column="15" source="standard:class-naming" />
<error line="444" column="15" source="standard:class-naming" />
<error line="456" column="15" source="standard:class-naming" />
<error line="464" column="15" source="standard:class-naming" />
<error line="472" column="15" source="standard:class-naming" />
<error line="488" column="15" source="standard:class-naming" />
<error line="501" column="15" source="standard:class-naming" />
<error line="849" column="13" source="standard:property-naming" />
<error line="1034" column="15" source="standard:class-naming" />
<error line="1040" column="15" source="standard:class-naming" />
<error line="1160" column="13" source="standard:property-naming" />
<error line="1166" column="13" source="standard:property-naming" />
<error line="1168" column="13" source="standard:property-naming" />
<error line="1228" column="39" source="standard:comment-wrapping" />
<error line="1313" column="15" source="standard:class-naming" />
<error line="1341" column="42" source="standard:comment-wrapping" />
<error line="1391" column="37" source="standard:comment-wrapping" />
<error line="1412" column="13" source="standard:property-naming" />
<error line="1413" column="13" source="standard:property-naming" />
<error line="1414" column="13" source="standard:property-naming" />
<error line="1433" column="9" source="standard:property-naming" />
<error line="1434" column="9" source="standard:property-naming" />
<error line="1435" column="9" source="standard:property-naming" />
<error line="1436" column="9" source="standard:property-naming" />
<error line="1417" column="13" source="standard:property-naming" />
<error line="1418" column="13" source="standard:property-naming" />
<error line="1437" column="9" source="standard:property-naming" />
<error line="1438" column="9" source="standard:property-naming" />
<error line="1439" column="9" source="standard:property-naming" />
Expand All @@ -43,10 +39,10 @@
<error line="1443" column="9" source="standard:property-naming" />
<error line="1444" column="9" source="standard:property-naming" />
<error line="1445" column="9" source="standard:property-naming" />
<error line="1446" column="9" source="standard:property-naming" />
<error line="1447" column="9" source="standard:property-naming" />
<error line="1448" column="9" source="standard:property-naming" />
<error line="1449" column="9" source="standard:property-naming" />
<error line="1450" column="9" source="standard:property-naming" />
<error line="1451" column="9" source="standard:property-naming" />
<error line="1452" column="9" source="standard:property-naming" />
<error line="1453" column="9" source="standard:property-naming" />
<error line="1454" column="9" source="standard:property-naming" />
<error line="1455" column="9" source="standard:property-naming" />
Expand Down Expand Up @@ -79,5 +75,9 @@
<error line="1482" column="9" source="standard:property-naming" />
<error line="1483" column="9" source="standard:property-naming" />
<error line="1484" column="9" source="standard:property-naming" />
<error line="1485" column="9" source="standard:property-naming" />
<error line="1486" column="9" source="standard:property-naming" />
<error line="1487" column="9" source="standard:property-naming" />
<error line="1488" column="9" source="standard:property-naming" />
</file>
</baseline>
56 changes: 0 additions & 56 deletions pubnub-kotlin/pubnub-kotlin-api/pubnub_kotlin_api.podspec

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private fun createFileEventResult(from: KMPFileChangeEvent?): PNFileEventResult
id = from.file().id(),
name = from.file().name(),
url = from.file().url()?.absoluteString.orEmpty()
)
),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@ class PublishTest : BaseIntegrationTest() {
assertEquals("123", result2.userMetadata?.asString())
}
}

@Test
fun publish_with_custom_message_type() = runTest {
val customMessageType = randomString()
pubnub.test(backgroundScope) {
pubnub.awaitSubscribe(listOf(channel))
pubnub.publish(channel, "some message", customMessageType = customMessageType).await()
val result = nextMessage()
assertEquals("some message", result.message.asString())
assertEquals(customMessageType, result.customMessageType)
}
}
}

private fun deepCompare(expected: Any?, actual: JsonElement) {
Expand Down
Loading
Loading