Skip to content

Commit 31d5360

Browse files
[KMP] JS CustomMessageType support + build tweaks (#321)
* [KMP] JS CustomMessageType support + build tweaks * PubNub SDK v10.3.1 release. --------- Co-authored-by: PubNub Release Bot <[email protected]>
1 parent e82e27a commit 31d5360

File tree

22 files changed

+94
-221
lines changed

22 files changed

+94
-221
lines changed

.github/workflows/commands-handler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Process command
1313
if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true
1414
runs-on:
15-
group: organization/Default
15+
group: macos-gh
1616
steps:
1717
- name: Check referred user
1818
id: user-check

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ out/
1313
test.properties
1414
local.properties
1515
*.DS_STORE
16+
*.podspec
1617

1718
# GitHub Actions #
1819
##################

.pubnub.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: kotlin
2-
version: 10.3.0
2+
version: 10.3.1
33
schema: 1
44
scm: github.com/pubnub/kotlin
55
files:
6-
- build/libs/pubnub-kotlin-10.3.0-all.jar
6+
- build/libs/pubnub-kotlin-10.3.1-all.jar
77
sdks:
88
-
99
type: library
@@ -23,8 +23,8 @@ sdks:
2323
-
2424
distribution-type: library
2525
distribution-repository: maven
26-
package-name: pubnub-kotlin-10.3.0
27-
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.3.0/pubnub-kotlin-10.3.0.jar
26+
package-name: pubnub-kotlin-10.3.1
27+
location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.3.1/pubnub-kotlin-10.3.1.jar
2828
supported-platforms:
2929
supported-operating-systems:
3030
Android:
@@ -114,6 +114,11 @@ sdks:
114114
license-url: https://www.apache.org/licenses/LICENSE-2.0.txt
115115
is-required: Required
116116
changelog:
117+
- date: 2024-12-12
118+
version: v10.3.1
119+
changes:
120+
- type: improvement
121+
text: "Internal changes for Chat SDK."
117122
- date: 2024-12-05
118123
version: v10.3.0
119124
changes:

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v10.3.1
2+
December 12 2024
3+
4+
#### Modified
5+
- Internal changes for Chat SDK.
6+
17
## v10.3.0
28
December 05 2024
39

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your
2020
<dependency>
2121
<groupId>com.pubnub</groupId>
2222
<artifactId>pubnub-kotlin</artifactId>
23-
<version>10.3.0</version>
23+
<version>10.3.1</version>
2424
</dependency>
2525
```
2626

build-logic/gradle-plugins/src/main/kotlin/com/pubnub/gradle/PubNubKotlinMultiplatformPlugin.kt

+11-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.pubnub.gradle
22

33
import org.gradle.api.Plugin
44
import org.gradle.api.Project
5+
import org.gradle.api.artifacts.VersionCatalogsExtension
56
import org.gradle.api.plugins.ExtensionAware
67
import org.gradle.api.tasks.testing.AbstractTestTask
78
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
@@ -38,9 +39,16 @@ class PubNubKotlinMultiplatformPlugin : Plugin<Project> {
3839
}
3940

4041
pod("PubNubSwift") {
41-
// val swiftPath = project.findProperty("SWIFT_PATH") as? String ?: "swift"
42-
// source = path(rootProject.file(swiftPath))
43-
version = "8.2.2"
42+
val swiftPath = project.findProperty("SWIFT_PATH") as? String
43+
if (swiftPath != null) {
44+
source = path(rootProject.file(swiftPath))
45+
} else {
46+
version = project.rootProject
47+
.extensions
48+
.getByType(VersionCatalogsExtension::class.java)
49+
.named("libs")
50+
.findVersion("pubnub.swift").get().requiredVersion
51+
}
4452
moduleName = "PubNubSDK"
4553
extraOpts += listOf("-compiler-option", "-fmodules")
4654
}

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RELEASE_SIGNING_ENABLED=true
1818
SONATYPE_HOST=DEFAULT
1919
SONATYPE_AUTOMATIC_RELEASE=false
2020
GROUP=com.pubnub
21-
VERSION_NAME=10.3.0
21+
VERSION_NAME=10.3.1
2222
POM_PACKAGING=jar
2323

2424
POM_NAME=PubNub SDK
@@ -39,7 +39,7 @@ POM_DEVELOPER_NAME=PubNub
3939
POM_DEVELOPER_URL=[email protected]
4040

4141
IOS_SIMULATOR_ID=iPhone 15 Pro
42-
SWIFT_PATH=swift
42+
#SWIFT_PATH=../swift
4343

4444
ENABLE_TARGET_JS=true
4545
ENABLE_TARGET_IOS_OTHER=false

gradle/libs.versions.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ vanniktech = "0.29.0"
1010
ktlint = "12.1.0"
1111
dokka = "1.9.20"
1212
kotlinx_datetime = "0.6.1"
13-
kotlinx_coroutines = "1.8.1"
13+
kotlinx_coroutines = "1.9.0"
14+
pubnub_js = "8.3.1"
15+
pubnub_swift = "8.2.2"
1416

1517
[libraries]
1618
retrofit2 = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit2" }

kotlin-js-store/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,10 @@ proxy-from-env@^1.1.0:
659659
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
660660
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
661661

662-
pubnub@8.2.8:
663-
version "8.2.8"
664-
resolved "https://registry.yarnpkg.com/pubnub/-/pubnub-8.2.8.tgz#68d3b84d07e128b29f74c6c46495f0c5bedd1a3f"
665-
integrity sha512-OREW+YDWWocOaz16jbrrybD0AyqEFuskCGi+EMgOb9FUJkuYPnInjlMSAUBBrlx7lMTARMQxx3Sk0EIvbB3hig==
662+
pubnub@8.3.1:
663+
version "8.3.1"
664+
resolved "https://registry.yarnpkg.com/pubnub/-/pubnub-8.3.1.tgz#48b6c2468452427c9d1aa9a51e78781d25eec660"
665+
integrity sha512-+aFp84Jsqpmu9utci8uQhABTMoh1Uk8UafGS1QANSkceXX3HDRTQnpTw8itH0UchzCS9pSfUATTl+Ay3jvM5EA==
666666
dependencies:
667667
agentkeepalive "^3.5.2"
668668
buffer "^6.0.3"

pubnub-kotlin/pubnub-kotlin-api/PubNubKMP.podspec

-54
This file was deleted.

pubnub-kotlin/pubnub-kotlin-api/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ kotlin {
4949
if (enableJsTarget) {
5050
val jsMain by getting {
5151
dependencies {
52-
implementation(npm("pubnub", "8.2.8"))
52+
implementation(npm("pubnub", libs.versions.pubnub.js.get()))
5353
}
5454
}
5555
}

pubnub-kotlin/pubnub-kotlin-api/config/ktlint/baseline.xml

+28-28
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,28 @@
88
</file>
99
<file name="src/jsMain/kotlin/Pubnub.d.kt">
1010
<error line="156" column="40" source="standard:comment-wrapping" />
11-
<error line="409" column="15" source="standard:class-naming" />
12-
<error line="425" column="15" source="standard:class-naming" />
13-
<error line="441" column="15" source="standard:class-naming" />
14-
<error line="453" column="15" source="standard:class-naming" />
15-
<error line="461" column="15" source="standard:class-naming" />
16-
<error line="469" column="15" source="standard:class-naming" />
17-
<error line="485" column="15" source="standard:class-naming" />
18-
<error line="498" column="15" source="standard:class-naming" />
19-
<error line="845" column="13" source="standard:property-naming" />
20-
<error line="1030" column="15" source="standard:class-naming" />
21-
<error line="1036" column="15" source="standard:class-naming" />
22-
<error line="1156" column="13" source="standard:property-naming" />
23-
<error line="1162" column="13" source="standard:property-naming" />
24-
<error line="1164" column="13" source="standard:property-naming" />
25-
<error line="1224" column="39" source="standard:comment-wrapping" />
26-
<error line="1309" column="15" source="standard:class-naming" />
27-
<error line="1337" column="42" source="standard:comment-wrapping" />
28-
<error line="1387" column="37" source="standard:comment-wrapping" />
29-
<error line="1408" column="13" source="standard:property-naming" />
30-
<error line="1409" column="13" source="standard:property-naming" />
11+
<error line="411" column="15" source="standard:class-naming" />
12+
<error line="428" column="15" source="standard:class-naming" />
13+
<error line="444" column="15" source="standard:class-naming" />
14+
<error line="456" column="15" source="standard:class-naming" />
15+
<error line="464" column="15" source="standard:class-naming" />
16+
<error line="472" column="15" source="standard:class-naming" />
17+
<error line="488" column="15" source="standard:class-naming" />
18+
<error line="501" column="15" source="standard:class-naming" />
19+
<error line="849" column="13" source="standard:property-naming" />
20+
<error line="1034" column="15" source="standard:class-naming" />
21+
<error line="1040" column="15" source="standard:class-naming" />
22+
<error line="1160" column="13" source="standard:property-naming" />
23+
<error line="1166" column="13" source="standard:property-naming" />
24+
<error line="1168" column="13" source="standard:property-naming" />
25+
<error line="1228" column="39" source="standard:comment-wrapping" />
26+
<error line="1313" column="15" source="standard:class-naming" />
27+
<error line="1341" column="42" source="standard:comment-wrapping" />
28+
<error line="1391" column="37" source="standard:comment-wrapping" />
29+
<error line="1412" column="13" source="standard:property-naming" />
3130
<error line="1413" column="13" source="standard:property-naming" />
32-
<error line="1414" column="13" source="standard:property-naming" />
33-
<error line="1433" column="9" source="standard:property-naming" />
34-
<error line="1434" column="9" source="standard:property-naming" />
35-
<error line="1435" column="9" source="standard:property-naming" />
36-
<error line="1436" column="9" source="standard:property-naming" />
31+
<error line="1417" column="13" source="standard:property-naming" />
32+
<error line="1418" column="13" source="standard:property-naming" />
3733
<error line="1437" column="9" source="standard:property-naming" />
3834
<error line="1438" column="9" source="standard:property-naming" />
3935
<error line="1439" column="9" source="standard:property-naming" />
@@ -43,10 +39,10 @@
4339
<error line="1443" column="9" source="standard:property-naming" />
4440
<error line="1444" column="9" source="standard:property-naming" />
4541
<error line="1445" column="9" source="standard:property-naming" />
42+
<error line="1446" column="9" source="standard:property-naming" />
43+
<error line="1447" column="9" source="standard:property-naming" />
44+
<error line="1448" column="9" source="standard:property-naming" />
4645
<error line="1449" column="9" source="standard:property-naming" />
47-
<error line="1450" column="9" source="standard:property-naming" />
48-
<error line="1451" column="9" source="standard:property-naming" />
49-
<error line="1452" column="9" source="standard:property-naming" />
5046
<error line="1453" column="9" source="standard:property-naming" />
5147
<error line="1454" column="9" source="standard:property-naming" />
5248
<error line="1455" column="9" source="standard:property-naming" />
@@ -79,5 +75,9 @@
7975
<error line="1482" column="9" source="standard:property-naming" />
8076
<error line="1483" column="9" source="standard:property-naming" />
8177
<error line="1484" column="9" source="standard:property-naming" />
78+
<error line="1485" column="9" source="standard:property-naming" />
79+
<error line="1486" column="9" source="standard:property-naming" />
80+
<error line="1487" column="9" source="standard:property-naming" />
81+
<error line="1488" column="9" source="standard:property-naming" />
8282
</file>
8383
</baseline>

pubnub-kotlin/pubnub-kotlin-api/pubnub_kotlin_api.podspec

-56
This file was deleted.

pubnub-kotlin/pubnub-kotlin-api/src/appleMain/kotlin/com/pubnub/kmp/factories.ios.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private fun createFileEventResult(from: KMPFileChangeEvent?): PNFileEventResult
176176
id = from.file().id(),
177177
name = from.file().name(),
178178
url = from.file().url()?.absoluteString.orEmpty()
179-
)
179+
),
180180
)
181181
}
182182

pubnub-kotlin/pubnub-kotlin-api/src/commonTest/kotlin/com/pubnub/test/integration/PublishTest.kt

+12
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,18 @@ class PublishTest : BaseIntegrationTest() {
185185
assertEquals("123", result2.userMetadata?.asString())
186186
}
187187
}
188+
189+
@Test
190+
fun publish_with_custom_message_type() = runTest {
191+
val customMessageType = randomString()
192+
pubnub.test(backgroundScope) {
193+
pubnub.awaitSubscribe(listOf(channel))
194+
pubnub.publish(channel, "some message", customMessageType = customMessageType).await()
195+
val result = nextMessage()
196+
assertEquals("some message", result.message.asString())
197+
assertEquals(customMessageType, result.customMessageType)
198+
}
199+
}
188200
}
189201

190202
private fun deepCompare(expected: Any?, actual: JsonElement) {

0 commit comments

Comments
 (0)