Skip to content
Open
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
82 changes: 82 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
outputs:
emulator_jobs_matrix: ${{ steps.dataStep.outputs.emulator_jobs_matrix }}
ios_test_jobs_matrix: ${{ steps.dataStep.outputs.ios_test_jobs_matrix }}
macos_test_jobs_matrix: ${{ steps.dataStep.outputs.macos_test_jobs_matrix }}
tvos_test_jobs_matrix: ${{ steps.dataStep.outputs.tvos_test_jobs_matrix }}
js_test_jobs_matrix: ${{ steps.dataStep.outputs.js_test_jobs_matrix }}
jvm_test_jobs_matrix: ${{ steps.dataStep.outputs.jvm_test_jobs_matrix }}
steps:
Expand All @@ -34,6 +36,8 @@ jobs:
echo "
emulator_jobs_matrix=$(jq -c . < ./build/emulator_jobs_matrix.json)
ios_test_jobs_matrix=$(jq -c . < ./build/ios_test_jobs_matrix.json)
macos_test_jobs_matrix=$(jq -c . < ./build/macos_test_jobs_matrix.json)
tvos_test_jobs_matrix=$(jq -c . < ./build/tvos_test_jobs_matrix.json)
js_test_jobs_matrix=$(jq -c . < ./build/js_test_jobs_matrix.json)
jvm_test_jobs_matrix=$(jq -c . < ./build/jvm_test_jobs_matrix.json)
" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -141,6 +145,84 @@ jobs:
with:
name: iOS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
path: "**/firebase-debug.log"
build-macos:
needs: jobMatrixSetup
runs-on: macos-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.jobMatrixSetup.outputs.macos_test_jobs_matrix) }}
steps:
- uses: actions/checkout@v4
- name: Cocoapods cache
uses: actions/cache@v4
with:
path: |
~/.cocoapods
~/Library/Caches/CocoaPods
*/build/cocoapods
*/build/classes
key: cocoapods-cache-v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup test environment
uses: ./.github/actions/setup_test_action
- name: Set Artifact Name
run: |
echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
- name: Run macOS Tests
run: ./gradlew ${{ matrix.gradle_tasks }}
- name: Upload macOS test artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: macOS ${{ env.ARCHIVE_KEY }} Test Report HTML
path: "**/build/reports/tests/macosArm64Test/"
- name: Upload Firebase Debug Log
uses: actions/upload-artifact@v4
if: failure()
with:
name: iOS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
path: "**/firebase-debug.log"
build-tvos:
needs: jobMatrixSetup
runs-on: macos-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.jobMatrixSetup.outputs.tvos_test_jobs_matrix) }}
steps:
- uses: actions/checkout@v4
- name: Cocoapods cache
uses: actions/cache@v4
with:
path: |
~/.cocoapods
~/Library/Caches/CocoaPods
*/build/cocoapods
*/build/classes
key: cocoapods-cache-v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup test environment
uses: ./.github/actions/setup_test_action
- name: Set Artifact Name
run: |
echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
- name: Run tvOS Tests
run: ./gradlew ${{ matrix.gradle_tasks }}
- name: Upload tvOS test artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: iOS ${{ env.ARCHIVE_KEY }} Test Report HTML
path: "**/build/reports/tests/tvosArm64Test/"
- name: Upload Firebase Debug Log
uses: actions/upload-artifact@v4
if: failure()
with:
name: iOS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
path: "**/firebase-debug.log"
build-jvm:
needs: jobMatrixSetup
runs-on: ubuntu-latest
Expand Down
18 changes: 15 additions & 3 deletions firebase-analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
}
}

val supportIosTarget = project.property("skipIosTarget") != "true"
val supportAppleTarget = project.property("skipAppleTargets") != "true"

kotlin {
explicitApi()
Expand Down Expand Up @@ -78,11 +78,19 @@ kotlin {

jvm()

if (supportIosTarget) {
if (supportAppleTarget) {
iosArm64()
iosX64()
iosSimulatorArm64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
macosArm64()
macosX64()
cocoapods {
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
tvos.deploymentTarget = libs.versions.tvos.deploymentTarget.get()
osx.deploymentTarget = libs.versions.macos.deploymentTarget.get()
framework {
baseName = "FirebaseAnalytics"
}
Expand Down Expand Up @@ -118,7 +126,11 @@ kotlin {
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
if (name.lowercase().contains("ios")) {
if (name.lowercase().contains("ios")
|| name.lowercase().contains("apple")
|| name.lowercase().contains("tvos")
|| name.lowercase().contains("macos")
) {
optIn("kotlinx.cinterop.ExperimentalForeignApi")
}
}
Expand Down
32 changes: 25 additions & 7 deletions firebase-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {
val compileSdkVersion: Int by project

compileSdk = compileSdkVersion
namespace="dev.gitlive.firebase"
namespace = "dev.gitlive.firebase"

defaultConfig {
minSdk = minSdkVersion
Expand All @@ -47,7 +47,7 @@ android {
}
}

val supportIosTarget = project.property("skipIosTarget") != "true"
val supportAppleTarget = project.property("skipAppleTargets") != "true"

kotlin {
explicitApi()
Expand Down Expand Up @@ -79,12 +79,20 @@ kotlin {

jvm()

if (supportIosTarget) {
if (supportAppleTarget) {
iosArm64()
iosX64()
iosSimulatorArm64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
macosArm64()
macosX64()

cocoapods {
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
tvos.deploymentTarget = libs.versions.tvos.deploymentTarget.get()
osx.deploymentTarget = libs.versions.macos.deploymentTarget.get()
framework {
baseName = "FirebaseApp"
}
Expand Down Expand Up @@ -120,7 +128,11 @@ kotlin {
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
if (name.lowercase().contains("ios")) {
if (name.lowercase().contains("ios")
|| name.lowercase().contains("apple")
|| name.lowercase().contains("tvos")
|| name.lowercase().contains("macos")
) {
optIn("kotlinx.cinterop.ExperimentalForeignApi")
}
}
Expand Down Expand Up @@ -152,19 +164,25 @@ kotlin {

if (project.property("firebase-app.skipIosTests") == "true") {
tasks.forEach {
if (it.name.contains("ios", true) && it.name.contains("test", true)) { it.enabled = false }
if (it.name.contains("ios", true) && it.name.contains("test", true)) {
it.enabled = false
}
}
}

if (project.property("firebase-app.skipJvmTests") == "true") {
tasks.forEach {
if (it.name.contains("jvm", true) && it.name.contains("test", true)) { it.enabled = false }
if (it.name.contains("jvm", true) && it.name.contains("test", true)) {
it.enabled = false
}
}
}

if (project.property("firebase-app.skipJsTests") == "true") {
tasks.forEach {
if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false }
if (it.name.contains("js", true) && it.name.contains("test", true)) {
it.enabled = false
}
}
}

Expand Down
7 changes: 4 additions & 3 deletions firebase-auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {
}
}

val supportIosTarget = project.property("skipIosTarget") != "true"
val supportAppleTarget = project.property("skipAppleTargets") != "true"

kotlin {
explicitApi()
Expand Down Expand Up @@ -79,8 +79,9 @@ kotlin {

jvm()

if (supportIosTarget) {
if (supportAppleTarget) {
iosArm64()
iosX64().enableKeychainForTests()
iosSimulatorArm64().enableKeychainForTests()
cocoapods {
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
Expand Down Expand Up @@ -166,7 +167,7 @@ if (project.property("firebase-auth.skipJsTests") == "true") {
}
}

if (supportIosTarget) {
if (supportAppleTarget) {
tasks.create<Exec>("launchIosSimulator") {
commandLine("open", "-a", "Simulator")
}
Expand Down
10 changes: 8 additions & 2 deletions firebase-common-internal/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,17 @@ kotlin {

jvm()

val supportIosTarget = project.property("skipIosTarget") != "true"
val supportAppleTarget = project.property("skipAppleTargets") != "true"

if (supportIosTarget) {
if (supportAppleTarget) {
iosArm64()
iosX64()
iosSimulatorArm64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
macosArm64()
macosX64()
}

js(IR) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import kotlinx.serialization.encoding.CompositeDecoder
import kotlinx.serialization.descriptors.PolymorphicKind
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.descriptors.StructureKind
import kotlin.collections.get

public actual fun FirebaseDecoder.structureDecoder(descriptor: SerialDescriptor, polymorphicIsNested: Boolean): CompositeDecoder = when (descriptor.kind) {
StructureKind.CLASS, StructureKind.OBJECT -> decodeAsMap(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license.
*/

@file:OptIn(SealedSerializationApi::class)

package dev.gitlive.firebase.internal

import kotlinx.serialization.KSerializer
Expand Down
10 changes: 8 additions & 2 deletions firebase-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,17 @@ kotlin {

jvm()

val supportIosTarget = project.property("skipIosTarget") != "true"
val supportAppleTarget = project.property("skipAppleTargets") != "true"

if (supportIosTarget) {
if (supportAppleTarget) {
iosArm64()
iosX64()
iosSimulatorArm64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
macosArm64()
macosX64()
}

js(IR) {
Expand Down
18 changes: 15 additions & 3 deletions firebase-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
}
}

val supportIosTarget = project.property("skipIosTarget") != "true"
val supportAppleTarget = project.property("skipAppleTargets") != "true"

kotlin {
explicitApi()
Expand Down Expand Up @@ -78,11 +78,19 @@ kotlin {

jvm()

if (supportIosTarget) {
if (supportAppleTarget) {
iosArm64()
iosX64()
iosSimulatorArm64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
macosArm64()
macosX64()
cocoapods {
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
tvos.deploymentTarget = libs.versions.tvos.deploymentTarget.get()
osx.deploymentTarget = libs.versions.macos.deploymentTarget.get()
framework {
baseName = "FirebaseConfig"
}
Expand Down Expand Up @@ -112,7 +120,11 @@ kotlin {
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
if (name.lowercase().contains("ios")) {
if (name.lowercase().contains("ios")
|| name.lowercase().contains("apple")
|| name.lowercase().contains("tvos")
|| name.lowercase().contains("macos")
) {
optIn("kotlinx.cinterop.ExperimentalForeignApi")
optIn("kotlinx.cinterop.BetaInteropApi")
}
Expand Down
18 changes: 15 additions & 3 deletions firebase-crashlytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {
}
}

val supportIosTarget = project.property("skipIosTarget") != "true"
val supportAppleTarget = project.property("skipAppleTargets") != "true"

kotlin {
explicitApi()
Expand Down Expand Up @@ -79,11 +79,19 @@ kotlin {

// jvm()

if (supportIosTarget) {
if (supportAppleTarget) {
iosArm64()
iosX64()
iosSimulatorArm64()
tvosArm64()
tvosX64()
tvosSimulatorArm64()
macosArm64()
macosX64()
cocoapods {
ios.deploymentTarget = libs.versions.ios.deploymentTarget.get()
tvos.deploymentTarget = libs.versions.tvos.deploymentTarget.get()
osx.deploymentTarget = libs.versions.macos.deploymentTarget.get()
framework {
baseName = "FirebaseCrashlytics"
}
Expand All @@ -102,7 +110,11 @@ kotlin {
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
if (name.lowercase().contains("ios")) {
if (name.lowercase().contains("ios")
|| name.lowercase().contains("apple")
|| name.lowercase().contains("tvos")
|| name.lowercase().contains("macos")
) {
optIn("kotlinx.cinterop.ExperimentalForeignApi")
}
}
Expand Down
Loading
Loading