Skip to content

Commit 8011f85

Browse files
sajidalidevReedyuk
authored andcommitted
Add support for tvOS and update dependencies
Updated the build configuration to include support for tvOS by setting deployment targets and adjusting Kotlin opt-ins. Also, updated Gradle and library versions to their latest stable releases as of commit `9b4c5f6`. This change ensures compatibility with new platforms while leveraging the latest features and improvements in dependencies.
1 parent 2c957c7 commit 8011f85

File tree

15 files changed

+41
-7
lines changed

15 files changed

+41
-7
lines changed

firebase-app/build.gradle.kts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ android {
2424
val compileSdkVersion: Int by project
2525

2626
compileSdk = compileSdkVersion
27-
namespace="dev.gitlive.firebase"
27+
namespace = "dev.gitlive.firebase"
2828

2929
defaultConfig {
3030
minSdk = minSdkVersion
@@ -82,9 +82,13 @@ kotlin {
8282
if (supportIosTarget) {
8383
iosArm64()
8484
iosSimulatorArm64()
85+
tvosArm64()
86+
tvosX64()
87+
tvosSimulatorArm64()
8588

8689
cocoapods {
8790
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
91+
tvos.deploymentTarget = libs.versions.tvos.deploymentTarget.get()
8892
framework {
8993
baseName = "FirebaseApp"
9094
}
@@ -120,7 +124,10 @@ kotlin {
120124
this.apiVersion = libs.versions.settings.api.get()
121125
this.languageVersion = libs.versions.settings.language.get()
122126
progressiveMode = true
123-
if (name.lowercase().contains("ios")) {
127+
if (name.lowercase().contains("ios")
128+
|| name.lowercase().contains("apple")
129+
|| name.lowercase().contains("tvos")
130+
) {
124131
optIn("kotlinx.cinterop.ExperimentalForeignApi")
125132
}
126133
}
@@ -152,19 +159,25 @@ kotlin {
152159

153160
if (project.property("firebase-app.skipIosTests") == "true") {
154161
tasks.forEach {
155-
if (it.name.contains("ios", true) && it.name.contains("test", true)) { it.enabled = false }
162+
if (it.name.contains("ios", true) && it.name.contains("test", true)) {
163+
it.enabled = false
164+
}
156165
}
157166
}
158167

159168
if (project.property("firebase-app.skipJvmTests") == "true") {
160169
tasks.forEach {
161-
if (it.name.contains("jvm", true) && it.name.contains("test", true)) { it.enabled = false }
170+
if (it.name.contains("jvm", true) && it.name.contains("test", true)) {
171+
it.enabled = false
172+
}
162173
}
163174
}
164175

165176
if (project.property("firebase-app.skipJsTests") == "true") {
166177
tasks.forEach {
167-
if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false }
178+
if (it.name.contains("js", true) && it.name.contains("test", true)) {
179+
it.enabled = false
180+
}
168181
}
169182
}
170183

firebase-common-internal/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ kotlin {
8282
if (supportIosTarget) {
8383
iosArm64()
8484
iosSimulatorArm64()
85+
tvosArm64()
86+
tvosX64()
87+
tvosSimulatorArm64()
8588
}
8689

8790
js(IR) {

firebase-common-internal/src/iosMain/kotlin/dev/gitlive/firebase/internal/_decoders.kt renamed to firebase-common-internal/src/appleMain/kotlin/dev/gitlive/firebase/internal/_decoders.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import kotlinx.serialization.encoding.CompositeDecoder
88
import kotlinx.serialization.descriptors.PolymorphicKind
99
import kotlinx.serialization.descriptors.SerialDescriptor
1010
import kotlinx.serialization.descriptors.StructureKind
11+
import kotlin.collections.get
1112

1213
public actual fun FirebaseDecoder.structureDecoder(descriptor: SerialDescriptor, polymorphicIsNested: Boolean): CompositeDecoder = when (descriptor.kind) {
1314
StructureKind.CLASS, StructureKind.OBJECT -> decodeAsMap(false)

firebase-common-internal/src/commonMain/kotlin/dev/gitlive/firebase/internal/serializers.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
@file:OptIn(SealedSerializationApi::class)
6+
57
package dev.gitlive.firebase.internal
68

79
import kotlinx.serialization.KSerializer

firebase-common/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ kotlin {
8181
if (supportIosTarget) {
8282
iosArm64()
8383
iosSimulatorArm64()
84+
tvosArm64()
85+
tvosX64()
86+
tvosSimulatorArm64()
8487
}
8588

8689
js(IR) {

firebase-database/build.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ kotlin {
8383
if (supportIosTarget) {
8484
iosArm64()
8585
iosSimulatorArm64()
86+
tvosArm64()
87+
tvosX64()
88+
tvosSimulatorArm64()
8689
cocoapods {
8790
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
91+
tvos.deploymentTarget = libs.versions.tvos.deploymentTarget.get()
8892
framework {
8993
baseName = "FirebaseDatabase"
9094
}
@@ -123,7 +127,10 @@ kotlin {
123127
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
124128
optIn("kotlinx.coroutines.FlowPreview")
125129
optIn("kotlinx.serialization.InternalSerializationApi")
126-
if (name.lowercase().contains("ios")) {
130+
if (name.lowercase().contains("ios")
131+
|| name.lowercase().contains("apple")
132+
|| name.lowercase().contains("tvos")
133+
) {
127134
optIn("kotlinx.cinterop.ExperimentalForeignApi")
128135
}
129136
}

0 commit comments

Comments
 (0)