Skip to content

Commit c8425dc

Browse files
committed
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 eafd4f4 commit c8425dc

File tree

17 files changed

+104
-65
lines changed

17 files changed

+104
-65
lines changed

firebase-app/build.gradle.kts

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

2323
compileSdk = compileSdkVersion
24-
namespace="dev.gitlive.firebase"
24+
namespace = "dev.gitlive.firebase"
2525

2626
defaultConfig {
2727
minSdk = minSdkVersion
@@ -80,9 +80,13 @@ kotlin {
8080
iosArm64()
8181
iosX64()
8282
iosSimulatorArm64()
83+
tvosArm64()
84+
tvosX64()
85+
tvosSimulatorArm64()
8386

8487
cocoapods {
8588
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
89+
tvos.deploymentTarget = libs.versions.tvos.deploymentTarget.get()
8690
framework {
8791
baseName = "FirebaseApp"
8892
}
@@ -118,7 +122,10 @@ kotlin {
118122
this.apiVersion = libs.versions.settings.api.get()
119123
this.languageVersion = libs.versions.settings.language.get()
120124
progressiveMode = true
121-
if (name.lowercase().contains("ios")) {
125+
if (name.lowercase().contains("ios")
126+
|| name.lowercase().contains("apple")
127+
|| name.lowercase().contains("tvos")
128+
) {
122129
optIn("kotlinx.cinterop.ExperimentalForeignApi")
123130
}
124131
}
@@ -150,19 +157,25 @@ kotlin {
150157

151158
if (project.property("firebase-app.skipIosTests") == "true") {
152159
tasks.forEach {
153-
if (it.name.contains("ios", true) && it.name.contains("test", true)) { it.enabled = false }
160+
if (it.name.contains("ios", true) && it.name.contains("test", true)) {
161+
it.enabled = false
162+
}
154163
}
155164
}
156165

157166
if (project.property("firebase-app.skipJvmTests") == "true") {
158167
tasks.forEach {
159-
if (it.name.contains("jvm", true) && it.name.contains("test", true)) { it.enabled = false }
168+
if (it.name.contains("jvm", true) && it.name.contains("test", true)) {
169+
it.enabled = false
170+
}
160171
}
161172
}
162173

163174
if (project.property("firebase-app.skipJsTests") == "true") {
164175
tasks.forEach {
165-
if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false }
176+
if (it.name.contains("js", true) && it.name.contains("test", true)) {
177+
it.enabled = false
178+
}
166179
}
167180
}
168181

firebase-common-internal/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ kotlin {
8080
iosArm64()
8181
iosX64()
8282
iosSimulatorArm64()
83+
tvosArm64()
84+
tvosX64()
85+
tvosSimulatorArm64()
8386
}
8487

8588
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
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
10+
import kotlinx.serialization.SealedSerializationApi
811
import kotlinx.serialization.SerializationException
912
import kotlinx.serialization.SerializationStrategy
1013
import kotlinx.serialization.builtins.serializer

firebase-common/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ kotlin {
7979
iosArm64()
8080
iosX64()
8181
iosSimulatorArm64()
82+
tvosArm64()
83+
tvosX64()
84+
tvosSimulatorArm64()
8285
}
8386

8487
js(IR) {

firebase-database/build.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ kotlin {
8181
iosArm64()
8282
iosX64()
8383
iosSimulatorArm64()
84+
tvosArm64()
85+
tvosX64()
86+
tvosSimulatorArm64()
8487
cocoapods {
8588
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
89+
tvos.deploymentTarget = libs.versions.tvos.deploymentTarget.get()
8690
framework {
8791
baseName = "FirebaseDatabase"
8892
}
@@ -121,7 +125,10 @@ kotlin {
121125
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
122126
optIn("kotlinx.coroutines.FlowPreview")
123127
optIn("kotlinx.serialization.InternalSerializationApi")
124-
if (name.lowercase().contains("ios")) {
128+
if (name.lowercase().contains("ios")
129+
|| name.lowercase().contains("apple")
130+
|| name.lowercase().contains("tvos")
131+
) {
125132
optIn("kotlinx.cinterop.ExperimentalForeignApi")
126133
}
127134
}

0 commit comments

Comments
 (0)