Skip to content

Commit

Permalink
Selectively disable targets
Browse files Browse the repository at this point in the history
  • Loading branch information
wkal-pubnub committed Aug 1, 2024
1 parent 71c497e commit 64526df
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout actions
uses: actions/checkout@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/run-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -39,6 +41,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache
uses: actions/cache@v4
with:
Expand Down
40 changes: 23 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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"))
}
}
}

Expand All @@ -37,15 +42,16 @@ kotlin {
}
}

cocoapods {
if (enableAnyIosTarget) {
(this as ExtensionAware).extensions.configure<CocoapodsExtension> {
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"))
}
}
}
}
Expand Down
8 changes: 6 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -30,4 +30,8 @@ POM_DEVELOPER_NAME=PubNub
POM_DEVELOPER_URL[email protected]

IOS_SIMULATOR_ID=iPhone 15 Pro
SWIFT_PATH=pubnub-kotlin/swift
SWIFT_PATH=pubnub-kotlin/swift

ENABLE_TARGET_JS=false
ENABLE_TARGET_IOS=false
ENABLE_TARGET_IOS_SIMULATOR=false
2 changes: 0 additions & 2 deletions pubnub-chat-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
46 changes: 15 additions & 31 deletions pubnub-chat-impl/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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<CocoapodsExtension> {
summary = "Some description for a Kotlin/Native module"
homepage = "Link to a Kotlin/Native module homepage"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 64526df

Please sign in to comment.