From 30cc1f94537225392aa2353634f222d926962cf5 Mon Sep 17 00:00:00 2001 From: Andrew Reed Date: Mon, 3 Apr 2023 20:17:18 +0100 Subject: [PATCH] Removed carthage and added cocoapods plugin (#349) --- .github/workflows/publish.yml | 2 - .github/workflows/pull_request.yml | 17 +++- .idea/externalDependencies.xml | 6 ++ README.md | 48 +++++----- build.gradle.kts | 64 +++---------- firebase-app/build.gradle.kts | 77 +++++----------- firebase-app/firebase_app.podspec | 0 firebase-app/package.json | 8 +- .../kotlin/dev/gitlive/firebase/firebase.kt | 3 +- .../kotlin/dev/gitlive/firebase/firebase.kt | 21 +---- .../src/nativeInterop/cinterop/Cartfile | 1 - .../nativeInterop/cinterop/FirebaseCore.def | 5 - firebase-auth/build.gradle.kts | 80 +++++----------- firebase-auth/firebase_auth.podspec | 0 firebase-auth/package.json | 8 +- .../kotlin/dev/gitlive/firebase/auth/auth.kt | 7 +- .../kotlin/dev/gitlive/firebase/auth/auth.kt | 4 +- .../kotlin/dev/gitlive/firebase/auth/auth.kt | 20 +--- .../src/nativeInterop/cinterop/Cartfile | 1 - .../nativeInterop/cinterop/FirebaseAuth.def | 5 - firebase-common/build.gradle.kts | 23 +++-- firebase-common/package.json | 6 +- firebase-config/build.gradle.kts | 68 ++++---------- firebase-config/firebase_config.podspec | 0 firebase-config/package.json | 8 +- .../firebase/remoteconfig/RemoteConfig.kt | 3 +- .../remoteconfig/FirebaseRemoteConfig.kt | 5 +- .../remoteconfig/FirebaseRemoteConfig.kt | 20 +--- .../src/nativeInterop/cinterop/Cartfile | 1 - .../cinterop/FirebaseRemoteConfig.def | 5 - firebase-crashlytics/build.gradle.kts | 58 +++--------- .../firebase_crashlytics.podspec | 0 firebase-crashlytics/package.json | 4 +- .../firebase/crashlytics/crashlytics.kt | 3 +- .../src/nativeInterop/cinterop/Cartfile | 1 - .../cinterop/FirebaseCrashlytics.def | 5 - firebase-database/build.gradle.kts | 83 +++++------------ firebase-database/firebase_database.podspec | 0 firebase-database/package.json | 8 +- .../dev/gitlive/firebase/database/database.kt | 4 +- .../dev/gitlive/firebase/database/database.kt | 8 +- .../dev/gitlive/firebase/database/database.kt | 22 +---- .../src/nativeInterop/cinterop/Cartfile | 1 - .../cinterop/FirebaseDatabase.def | 5 - firebase-firestore/build.gradle.kts | 91 ++++++------------- firebase-firestore/firebase_firestore.podspec | 0 firebase-firestore/package.json | 8 +- .../gitlive/firebase/firestore/firestore.kt | 7 +- .../gitlive/firebase/firestore/firestore.kt | 21 +---- .../src/nativeInterop/cinterop/Cartfile | 1 - .../cinterop/FirebaseFirestore.def | 5 - firebase-functions/build.gradle.kts | 83 +++++------------ firebase-functions/firebase_functions.podspec | 0 firebase-functions/package.json | 8 +- .../gitlive/firebase/functions/functions.kt | 15 +-- .../src/nativeInterop/cinterop/Cartfile | 1 - .../cinterop/FirebaseFunctions.def | 5 - firebase-installations/build.gradle.kts | 76 +++++----------- .../firebase_installations.podspec | 0 firebase-installations/package.json | 8 +- .../firebase/installations/installations.kt | 4 +- .../cinterop/FirebaseInstallations.def | 5 - firebase-perf/build.gradle.kts | 90 ++++-------------- firebase-perf/firebase_perf.podspec | 0 firebase-perf/package.json | 4 +- .../dev/gitlive/firebase/perf/performance.kt | 3 +- .../dev/gitlive/firebase/perf/performance.kt | 20 +--- .../src/nativeInterop/cinterop/Cartfile | 1 - .../cinterop/FirebasePerformance.def | 5 - gradle.properties | 34 ++++--- 70 files changed, 365 insertions(+), 848 deletions(-) create mode 100644 .idea/externalDependencies.xml create mode 100644 firebase-app/firebase_app.podspec delete mode 100644 firebase-app/src/nativeInterop/cinterop/Cartfile delete mode 100644 firebase-app/src/nativeInterop/cinterop/FirebaseCore.def create mode 100644 firebase-auth/firebase_auth.podspec delete mode 100644 firebase-auth/src/nativeInterop/cinterop/Cartfile delete mode 100644 firebase-auth/src/nativeInterop/cinterop/FirebaseAuth.def create mode 100644 firebase-config/firebase_config.podspec delete mode 100644 firebase-config/src/nativeInterop/cinterop/Cartfile delete mode 100644 firebase-config/src/nativeInterop/cinterop/FirebaseRemoteConfig.def create mode 100644 firebase-crashlytics/firebase_crashlytics.podspec delete mode 100644 firebase-crashlytics/src/nativeInterop/cinterop/Cartfile delete mode 100644 firebase-crashlytics/src/nativeInterop/cinterop/FirebaseCrashlytics.def create mode 100644 firebase-database/firebase_database.podspec delete mode 100644 firebase-database/src/nativeInterop/cinterop/Cartfile delete mode 100644 firebase-database/src/nativeInterop/cinterop/FirebaseDatabase.def create mode 100644 firebase-firestore/firebase_firestore.podspec delete mode 100644 firebase-firestore/src/nativeInterop/cinterop/Cartfile delete mode 100644 firebase-firestore/src/nativeInterop/cinterop/FirebaseFirestore.def create mode 100644 firebase-functions/firebase_functions.podspec delete mode 100644 firebase-functions/src/nativeInterop/cinterop/Cartfile delete mode 100644 firebase-functions/src/nativeInterop/cinterop/FirebaseFunctions.def create mode 100644 firebase-installations/firebase_installations.podspec delete mode 100644 firebase-installations/src/nativeInterop/cinterop/FirebaseInstallations.def create mode 100644 firebase-perf/firebase_perf.podspec delete mode 100644 firebase-perf/src/nativeInterop/cinterop/Cartfile delete mode 100644 firebase-perf/src/nativeInterop/cinterop/FirebasePerformance.def diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 80313a226..9e8c08025 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,8 +25,6 @@ jobs: arguments: :updateVersions - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Install Carthage - run: brew install carthage - name: Publish Firebase App uses: eskatos/gradle-command-action@v1 with: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index dbd4cbac0..31eaa83b5 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -17,17 +17,26 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Gradle cache - uses: gradle/gradle-build-action@v2 + - name: Cocoapods cache + uses: actions/cache@v3 + id: cocoapods-cache + with: + path: | + ~/.cocoapods + ~/Library/Caches/CocoaPods + */build/cocoapods + */build/classes + key: cocoapods-cache - name: Set up JDK uses: actions/setup-java@v2 with: distribution: 'zulu' java-version: '11' + cache: gradle + - name: Gradle cache + uses: gradle/gradle-build-action@v2 - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Install Carthage - run: brew list carthage || brew install carthage - name: Install Firebase tools run: npm install -g firebase-tools - name: Start Firebase emulator diff --git a/.idea/externalDependencies.xml b/.idea/externalDependencies.xml new file mode 100644 index 000000000..865fbc4f9 --- /dev/null +++ b/.idea/externalDependencies.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 1ef0fe704..a23018d10 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,18 @@ The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It's API is similar The following libraries are available for the various Firebase products. -| Service or Product | Gradle Dependency | API Coverage | -|---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.7.3/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-auth/src/commonMain/kotlin/dev/gitlive/firebase/auth/auth.kt) | -| [Realtime Database](https://firebase.google.com/docs/database) | [`dev.gitlive:firebase-database:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.7.3/pom) | [![70%](https://img.shields.io/badge/-70%25-orange?style=flat-square)](/firebase-database/src/commonMain/kotlin/dev/gitlive/firebase/database/database.kt) | -| [Cloud Firestore](https://firebase.google.com/docs/firestore) | [`dev.gitlive:firebase-firestore:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.7.3/pom) | [![60%](https://img.shields.io/badge/-60%25-orange?style=flat-square)](/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt) | -| [Cloud Functions](https://firebase.google.com/docs/functions) | [`dev.gitlive:firebase-functions:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.7.3/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-functions/src/commonMain/kotlin/dev/gitlive/firebase/functions/functions.kt) | -| [Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) | [`dev.gitlive:firebase-messaging:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.7.3/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) | -| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.7.3/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) | -| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.7.3/pom) | [![90%](https://img.shields.io/badge/-90%25-green?style=flat-square)](/firebase-installations/src/commonMain/kotlin/dev/gitlive/firebase/installations/installations.kt) | -| [Remote Config](https://firebase.google.com/docs/remote-config) | [`dev.gitlive:firebase-config:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.7.3/pom) | ![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square) | -| [Performance](https://firebase.google.com/docs/perf-mon) | [`dev.gitlive:firebase-perf:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/1.7.3/pom) | ![60%](https://img.shields.io/badge/-60%25-orange?style=flat-square) | -| [Crashlytics](https://firebase.google.com/docs/crashlytics) | [`dev.gitlive:firebase-crashlytics:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/1.7.3/pom) | ![80%](https://img.shields.io/badge/-80%25-green?style=flat-square) | +| Service or Product | Gradle Dependency | API Coverage | +|---------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.8.0/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-auth/src/commonMain/kotlin/dev/gitlive/firebase/auth/auth.kt) | +| [Realtime Database](https://firebase.google.com/docs/database) | [`dev.gitlive:firebase-database:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.8.0/pom) | [![70%](https://img.shields.io/badge/-70%25-orange?style=flat-square)](/firebase-database/src/commonMain/kotlin/dev/gitlive/firebase/database/database.kt) | +| [Cloud Firestore](https://firebase.google.com/docs/firestore) | [`dev.gitlive:firebase-firestore:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.8.0/pom) | [![60%](https://img.shields.io/badge/-60%25-orange?style=flat-square)](/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt) | +| [Cloud Functions](https://firebase.google.com/docs/functions) | [`dev.gitlive:firebase-functions:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.8.0/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-functions/src/commonMain/kotlin/dev/gitlive/firebase/functions/functions.kt) | +| [Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) | [`dev.gitlive:firebase-messaging:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.8.0/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) | +| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.8.0/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) | +| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.8.0/pom) | [![90%](https://img.shields.io/badge/-90%25-green?style=flat-square)](/firebase-installations/src/commonMain/kotlin/dev/gitlive/firebase/installations/installations.kt) | +| [Remote Config](https://firebase.google.com/docs/remote-config) | [`dev.gitlive:firebase-config:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.8.0/pom) | ![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square) | +| [Performance](https://firebase.google.com/docs/perf-mon) | [`dev.gitlive:firebase-perf:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/1.8.0/pom) | ![1%](https://img.shields.io/badge/-1%25-orange?style=flat-square) | +| [Crashlytics](https://firebase.google.com/docs/crashlytics) | [`dev.gitlive:firebase-crashlytics:1.8.0`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/1.8.0/pom) | ![80%](https://img.shields.io/badge/-1%25-orange?style=flat-square) | @@ -69,8 +69,8 @@ The Firebase Kotlin SDK uses Kotlin serialization to read and write custom class ```groovy plugins { - kotlin("multiplatform") version "1.6.10" // or kotlin("jvm") or any other kotlin plugin - kotlin("plugin.serialization") version "1.6.10" + kotlin("multiplatform") version "1.8.20" // or kotlin("jvm") or any other kotlin plugin + kotlin("plugin.serialization") version "1.8.20" } ``` @@ -203,16 +203,16 @@ If you are building a Kotlin multiplatform library which will be consumed from J ```json "dependencies": { - "@gitlive/firebase-auth": "1.7.3", - "@gitlive/firebase-config": "1.7.3", - "@gitlive/firebase-database": "1.7.3", - "@gitlive/firebase-firestore": "1.7.3", - "@gitlive/firebase-functions": "1.7.3", - "@gitlive/firebase-installations": "1.7.3", - "@gitlive/firebase-messaging": "1.7.3", - "@gitlive/firebase-storage": "1.7.3" - "@gitlive/firebase-perf": "1.7.3" - "@gitlive/firebase-crashlytics": "1.7.3" + "@gitlive/firebase-auth": "1.8.0", + "@gitlive/firebase-config": "1.8.0", + "@gitlive/firebase-database": "1.8.0", + "@gitlive/firebase-firestore": "1.8.0", + "@gitlive/firebase-functions": "1.8.0", + "@gitlive/firebase-installations": "1.8.0", + "@gitlive/firebase-messaging": "1.8.0", + "@gitlive/firebase-storage": "1.8.0" + "@gitlive/firebase-perf": "1.8.0" + "@gitlive/firebase-crashlytics": "1.8.0" } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 2d2199ce7..678a07340 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,8 +2,14 @@ import org.apache.tools.ant.taskdefs.condition.Os import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent +repositories { + google() + mavenCentral() +} + plugins { - kotlin("multiplatform") version "1.6.10" apply false + kotlin("multiplatform") version "1.8.20" apply false + kotlin("native.cocoapods") version "1.8.20" apply false id("base") id("com.github.ben-manes.versions") version "0.42.0" } @@ -19,6 +25,7 @@ buildscript { } dependencies { classpath("com.android.tools.build:gradle:7.2.2") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20-RC") classpath("com.adarshr:gradle-test-logger-plugin:3.2.0") } } @@ -54,24 +61,10 @@ subprojects { mavenCentral() } - rootProject.plugins.withType { - rootProject.the().nodeVersion = "16.0.0" - } - tasks.withType().configureEach { onlyIf { !project.gradle.startParameter.taskNames.contains("publishToMavenLocal") } } - tasks.whenTaskAdded { - enabled = when(name) { - "compileDebugUnitTestKotlinAndroid" -> false - "compileReleaseUnitTestKotlinAndroid" -> false - "testDebugUnitTest" -> false - "testReleaseUnitTest" -> false - else -> enabled - } - } - tasks { val updateVersion by registering(Exec::class) { @@ -161,36 +154,6 @@ subprojects { ) } } - - val carthageTasks = if (projectDir.resolve("src/nativeInterop/cinterop/Cartfile").exists()) { // skipping firebase-common module - listOf("bootstrap", "update").map { - task("carthage${it.capitalize()}") { - group = "carthage" - executable = "carthage" - args( - it, - "--project-directory", projectDir.resolve("src/nativeInterop/cinterop"), - "--platform", "iOS" - ) - } - } - } else emptyList() - - if (Os.isFamily(Os.FAMILY_MAC)) { - withType(org.jetbrains.kotlin.gradle.tasks.CInteropProcess::class) { - if (carthageTasks.isNotEmpty()) { - dependsOn("carthageBootstrap") - } - } - } - - create("carthageClean", Delete::class.java) { - group = "carthage" - delete( - projectDir.resolve("src/nativeInterop/cinterop/Carthage"), - projectDir.resolve("src/nativeInterop/cinterop/Cartfile.resolved") - ) - } } afterEvaluate { @@ -199,17 +162,14 @@ subprojects { mkdir("$buildDir/node_module") } - tasks.named("clean") { - dependsOn("carthageClean") - } - dependencies { - "commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1-native-mt") - "androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.1-native-mt") + "commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") + "androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4") "androidMainImplementation"(platform("com.google.firebase:firebase-bom:29.3.0")) "commonTestImplementation"(kotlin("test-common")) "commonTestImplementation"(kotlin("test-annotations-common")) - "commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1-native-mt") + "commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") + "commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") if (this@afterEvaluate.name != "firebase-crashlytics") { "jsTestImplementation"(kotlin("test-js")) } diff --git a/firebase-app/build.gradle.kts b/firebase-app/build.gradle.kts index 4f392a34e..ca251aa45 100644 --- a/firebase-app/build.gradle.kts +++ b/firebase-app/build.gradle.kts @@ -2,13 +2,11 @@ * Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license. */ -import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget -import org.jetbrains.kotlin.konan.target.KonanTarget - version = project.property("firebase-app.version") as String plugins { id("com.android.library") + kotlin("native.cocoapods") kotlin("multiplatform") } @@ -44,12 +42,7 @@ android { } } -val KonanTarget.archVariant: String - get() = if (this is KonanTarget.IOS_X64 || this is KonanTarget.IOS_SIMULATOR_ARM64) { - "ios-arm64_i386_x86_64-simulator" - } else { - "ios-arm64_armv7" - } +val supportIosTarget = project.property("skipIosTarget") != "true" kotlin { @@ -57,61 +50,36 @@ kotlin { publishAllLibraryVariants() } - val supportIosTarget = project.property("skipIosTarget") != "true" - if (supportIosTarget) { - fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = { - val nativeFrameworkPaths = listOf( - projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS") - ).plus( - listOf( - "FirebaseAnalytics", - "FirebaseCore", - "FirebaseCoreDiagnostics", - "FirebaseInstallations", - "GoogleAppMeasurement", - "GoogleAppMeasurementIdentitySupport", - "GoogleDataTransport", - "GoogleUtilities", - "nanopb", - "PromisesObjC" - ).map { - projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ) + if (supportIosTarget) { + ios() + iosSimulatorArm64() - binaries { - getTest("DEBUG").apply { - linkerOpts(nativeFrameworkPaths.map { "-F$it" }) - linkerOpts("-ObjC") - } + cocoapods { + ios.deploymentTarget = "10.0" + framework { + baseName = "FirebaseApp" } - - compilations.getByName("main") { - cinterops.create("FirebaseCore") { - compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") - } + noPodspec() + pod("FirebaseCore") { + version = "10.4.0" } } - - ios(configure = nativeTargetConfig()) - iosSimulatorArm64(configure = nativeTargetConfig()) } js { useCommonJs() nodejs { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } browser { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } @@ -120,8 +88,8 @@ kotlin { sourceSets { all { languageSettings.apply { - apiVersion = "1.6" - languageVersion = "1.6" + apiVersion = "1.8" + languageVersion = "1.8" progressiveMode = true } } @@ -142,9 +110,8 @@ kotlin { val iosMain by getting val iosSimulatorArm64Main by getting iosSimulatorArm64Main.dependsOn(iosMain) - val iosTest by sourceSets.getting - val iosSimulatorArm64Test by sourceSets.getting + val iosSimulatorArm64Test by getting iosSimulatorArm64Test.dependsOn(iosTest) } @@ -158,6 +125,12 @@ if (project.property("firebase-app.skipIosTests") == "true") { } } +if (project.property("firebase-app.skipJsTests") == "true") { + tasks.forEach { + if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false } + } +} + signing { val signingKey: String? by project val signingPassword: String? by project diff --git a/firebase-app/firebase_app.podspec b/firebase-app/firebase_app.podspec new file mode 100644 index 000000000..e69de29bb diff --git a/firebase-app/package.json b/firebase-app/package.json index 5a5369a79..50c642c7b 100644 --- a/firebase-app/package.json +++ b/firebase-app/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-app", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-app.js", "scripts": { @@ -23,9 +23,9 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { - "@gitlive/firebase-common": "1.7.3", + "@gitlive/firebase-common": "1.8.0", "firebase": "9.7.0", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" + "kotlin": "1.8.20", + "kotlinx-coroutines-core": "1.6.4" } } diff --git a/firebase-app/src/androidAndroidTest/kotlin/dev/gitlive/firebase/firebase.kt b/firebase-app/src/androidAndroidTest/kotlin/dev/gitlive/firebase/firebase.kt index 2be45b4b2..10402d8f0 100644 --- a/firebase-app/src/androidAndroidTest/kotlin/dev/gitlive/firebase/firebase.kt +++ b/firebase-app/src/androidAndroidTest/kotlin/dev/gitlive/firebase/firebase.kt @@ -6,8 +6,7 @@ package dev.gitlive.firebase import androidx.test.platform.app.InstrumentationRegistry -import kotlinx.coroutines.runBlocking actual val context: Any = InstrumentationRegistry.getInstrumentation().targetContext -actual fun runTest(test: suspend () -> Unit) = runBlocking { test() } +actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() } diff --git a/firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt b/firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt index 0e8a91771..19b3f898f 100644 --- a/firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt +++ b/firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt @@ -4,25 +4,10 @@ package dev.gitlive.firebase -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.promise +import kotlinx.coroutines.test.runTest actual val context: Any = Unit -actual fun runTest(test: suspend () -> Unit) = GlobalScope - .promise { - try { - test() - } catch (e: dynamic) { - (e as? Throwable)?.log() - throw e - } - }.asDynamic() - -internal fun Throwable.log() { - console.error(this) - cause?.let { - console.error("Caused by:") - it.log() - } +actual fun runTest(test: suspend () -> Unit) { + runTest { test() } } \ No newline at end of file diff --git a/firebase-app/src/nativeInterop/cinterop/Cartfile b/firebase-app/src/nativeInterop/cinterop/Cartfile deleted file mode 100644 index 5b1ec5fca..000000000 --- a/firebase-app/src/nativeInterop/cinterop/Cartfile +++ /dev/null @@ -1 +0,0 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 8.15.0 diff --git a/firebase-app/src/nativeInterop/cinterop/FirebaseCore.def b/firebase-app/src/nativeInterop/cinterop/FirebaseCore.def deleted file mode 100644 index ae9ff7d73..000000000 --- a/firebase-app/src/nativeInterop/cinterop/FirebaseCore.def +++ /dev/null @@ -1,5 +0,0 @@ -language = Objective-C -package = cocoapods.FirebaseCore -modules = FirebaseCore -compilerOpts = -framework FirebaseCore -linkerOpts = -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseInstallations -framework GoogleAppMeasurement -framework GoogleAppMeasurementIdentitySupport -framework GoogleDataTransport -framework GoogleUtilities -framework nanopb -framework PromisesObjC -framework StoreKit -lsqlite3 diff --git a/firebase-auth/build.gradle.kts b/firebase-auth/build.gradle.kts index edcce04c5..e4d7c9883 100644 --- a/firebase-auth/build.gradle.kts +++ b/firebase-auth/build.gradle.kts @@ -10,6 +10,7 @@ version = project.property("firebase-auth.version") as String plugins { id("com.android.library") kotlin("multiplatform") + kotlin("native.cocoapods") //id("com.quittle.android-emulator") version "0.2.0" } @@ -67,12 +68,7 @@ android { // logEmulatorOutput(false) //} -val KonanTarget.archVariant: String - get() = if (this is KonanTarget.IOS_X64 || this is KonanTarget.IOS_SIMULATOR_ARM64) { - "ios-arm64_i386_x86_64-simulator" - } else { - "ios-arm64_armv7" - } +val supportIosTarget = project.property("skipIosTarget") != "true" kotlin { @@ -80,67 +76,34 @@ kotlin { publishAllLibraryVariants() } - val supportIosTarget = project.property("skipIosTarget") != "true" if (supportIosTarget) { - - fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = { - val nativeFrameworkPaths = listOf( - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS") - ).plus( - listOf( - "FirebaseAnalytics", - "FirebaseCore", - "FirebaseCoreDiagnostics", - "FirebaseInstallations", - "GoogleAppMeasurement", - "GoogleAppMeasurementIdentitySupport", - "GoogleDataTransport", - "GoogleUtilities", - "nanopb", - "PromisesObjC" - ).map { - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ).plus( - listOf( - "FirebaseAuth", - "GTMSessionFetcher" - ).map { - projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ) - binaries { - getTest("DEBUG").apply { - linkerOpts(nativeFrameworkPaths.map { "-F$it" }) - linkerOpts("-ObjC") - } + ios() + iosSimulatorArm64() + cocoapods { + ios.deploymentTarget = "11.0" + framework { + baseName = "FirebaseAuth" } - - compilations.getByName("main") { - cinterops.create("FirebaseAuth") { - compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") - } + noPodspec() + pod("FirebaseAuth") { + version = "10.4.0" } } - - ios(configure = nativeTargetConfig()) - iosSimulatorArm64(configure = nativeTargetConfig()) } js { useCommonJs() nodejs { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } browser { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } @@ -149,8 +112,8 @@ kotlin { sourceSets { all { languageSettings.apply { - apiVersion = "1.6" - languageVersion = "1.6" + apiVersion = "1.8" + languageVersion = "1.8" progressiveMode = true optIn("kotlinx.coroutines.ExperimentalCoroutinesApi") } @@ -173,9 +136,8 @@ kotlin { val iosMain by getting val iosSimulatorArm64Main by getting iosSimulatorArm64Main.dependsOn(iosMain) - val iosTest by sourceSets.getting - val iosSimulatorArm64Test by sourceSets.getting + val iosSimulatorArm64Test by getting iosSimulatorArm64Test.dependsOn(iosTest) } @@ -189,6 +151,12 @@ if (project.property("firebase-auth.skipIosTests") == "true") { } } +if (project.property("firebase-auth.skipJsTests") == "true") { + tasks.forEach { + if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false } + } +} + signing { val signingKey: String? by project val signingPassword: String? by project diff --git a/firebase-auth/firebase_auth.podspec b/firebase-auth/firebase_auth.podspec new file mode 100644 index 000000000..e69de29bb diff --git a/firebase-auth/package.json b/firebase-auth/package.json index 5ee8654a1..2626c9978 100644 --- a/firebase-auth/package.json +++ b/firebase-auth/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-auth", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-auth.js", "scripts": { @@ -23,9 +23,9 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { - "@gitlive/firebase-app": "1.7.3", + "@gitlive/firebase-app": "1.8.0", "firebase": "9.7.0", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" + "kotlin": "1.8.20", + "kotlinx-coroutines-core": "1.6.4" } } diff --git a/firebase-auth/src/androidAndroidTest/kotlin/dev/gitlive/firebase/auth/auth.kt b/firebase-auth/src/androidAndroidTest/kotlin/dev/gitlive/firebase/auth/auth.kt index 364e7f381..5aff507e9 100644 --- a/firebase-auth/src/androidAndroidTest/kotlin/dev/gitlive/firebase/auth/auth.kt +++ b/firebase-auth/src/androidAndroidTest/kotlin/dev/gitlive/firebase/auth/auth.kt @@ -5,15 +5,10 @@ @file:JvmName("tests") package dev.gitlive.firebase.auth -import android.util.Log import androidx.test.platform.app.InstrumentationRegistry -import kotlinx.coroutines.runBlocking actual val emulatorHost: String = "10.0.2.2" actual val context: Any = InstrumentationRegistry.getInstrumentation().targetContext -actual fun runTest(test: suspend () -> Unit) = runBlocking { - test() -} - +actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() } diff --git a/firebase-auth/src/iosMain/kotlin/dev/gitlive/firebase/auth/auth.kt b/firebase-auth/src/iosMain/kotlin/dev/gitlive/firebase/auth/auth.kt index 088daf0be..04d39cb18 100644 --- a/firebase-auth/src/iosMain/kotlin/dev/gitlive/firebase/auth/auth.kt +++ b/firebase-auth/src/iosMain/kotlin/dev/gitlive/firebase/auth/auth.kt @@ -19,8 +19,8 @@ import platform.Foundation.* actual val Firebase.auth get() = FirebaseAuth(FIRAuth.auth()) -actual fun Firebase.auth(app: FirebaseApp) = - FirebaseAuth(FIRAuth.authWithApp(app.ios)) +actual fun Firebase.auth(app: FirebaseApp): FirebaseAuth = TODO("Come back to issue") +// FirebaseAuth(FIRAuth.authWithApp(app.ios)) actual class FirebaseAuth internal constructor(val ios: FIRAuth) { diff --git a/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt b/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt index 340f1fa6c..be90b4c54 100644 --- a/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt +++ b/firebase-auth/src/jsTest/kotlin/dev/gitlive/firebase/auth/auth.kt @@ -4,27 +4,11 @@ package dev.gitlive.firebase.auth -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.promise actual val emulatorHost: String = "localhost" actual val context: Any = Unit -actual fun runTest(test: suspend () -> Unit) = GlobalScope - .promise { - try { - test() - } catch (e: dynamic) { - (e as? Throwable)?.log() - throw e - } - }.asDynamic() - -internal fun Throwable.log() { - console.error(this) - cause?.let { - console.error("Caused by:") - it.log() - } +actual fun runTest(test: suspend () -> Unit) { + kotlinx.coroutines.test.runTest { test() } } diff --git a/firebase-auth/src/nativeInterop/cinterop/Cartfile b/firebase-auth/src/nativeInterop/cinterop/Cartfile deleted file mode 100644 index 35794eb83..000000000 --- a/firebase-auth/src/nativeInterop/cinterop/Cartfile +++ /dev/null @@ -1 +0,0 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 8.15.0 diff --git a/firebase-auth/src/nativeInterop/cinterop/FirebaseAuth.def b/firebase-auth/src/nativeInterop/cinterop/FirebaseAuth.def deleted file mode 100644 index 0cba7b3c3..000000000 --- a/firebase-auth/src/nativeInterop/cinterop/FirebaseAuth.def +++ /dev/null @@ -1,5 +0,0 @@ -language = Objective-C -package = cocoapods.FirebaseAuth -modules = FirebaseAuth -compilerOpts = -framework FirebaseAuth -linkerOpts = -framework FirebaseAuth -framework GTMSessionFetcher diff --git a/firebase-common/build.gradle.kts b/firebase-common/build.gradle.kts index eee7fd4ad..93df71e17 100644 --- a/firebase-common/build.gradle.kts +++ b/firebase-common/build.gradle.kts @@ -9,7 +9,7 @@ version = project.property("firebase-common.version") as String plugins { id("com.android.library") kotlin("multiplatform") - kotlin("plugin.serialization") version "1.6.10" + kotlin("plugin.serialization") version "1.8.20" } android { @@ -57,15 +57,15 @@ kotlin { useCommonJs() nodejs { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } browser { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } @@ -74,8 +74,8 @@ kotlin { sourceSets { all { languageSettings.apply { - apiVersion = "1.6" - languageVersion = "1.6" + apiVersion = "1.8" + languageVersion = "1.8" progressiveMode = true optIn("kotlin.Experimental") optIn("kotlinx.coroutines.ExperimentalCoroutinesApi") @@ -100,9 +100,8 @@ kotlin { val iosMain by getting val iosSimulatorArm64Main by getting iosSimulatorArm64Main.dependsOn(iosMain) - val iosTest by sourceSets.getting - val iosSimulatorArm64Test by sourceSets.getting + val iosSimulatorArm64Test by getting iosSimulatorArm64Test.dependsOn(iosTest) } @@ -120,6 +119,12 @@ if (project.property("firebase-common.skipIosTests") == "true") { } } +if (project.property("firebase-common.skipJsTests") == "true") { + tasks.forEach { + if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false } + } +} + signing { val signingKey: String? by project val signingPassword: String? by project diff --git a/firebase-common/package.json b/firebase-common/package.json index 8eeaec6c4..b0e9a73b3 100644 --- a/firebase-common/package.json +++ b/firebase-common/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-common", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-common.js", "scripts": { @@ -24,8 +24,8 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-multiplatform-sdk", "dependencies": { "firebase": "9.7.0", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt", + "kotlin": "1.8.20", + "kotlinx-coroutines-core": "1.6.4", "kotlinx-serialization-kotlinx-serialization-runtime": "1.3.2" } } diff --git a/firebase-config/build.gradle.kts b/firebase-config/build.gradle.kts index e11b86399..518064c84 100644 --- a/firebase-config/build.gradle.kts +++ b/firebase-config/build.gradle.kts @@ -10,6 +10,7 @@ version = project.property("firebase-config.version") as String plugins { id("com.android.library") kotlin("multiplatform") + kotlin("native.cocoapods") //id("com.quittle.android-emulator") version "0.2.0" } @@ -56,12 +57,7 @@ android { // logEmulatorOutput(false) //} -val KonanTarget.archVariant: String - get() = if (this is KonanTarget.IOS_X64 || this is KonanTarget.IOS_SIMULATOR_ARM64) { - "ios-arm64_i386_x86_64-simulator" - } else { - "ios-arm64_armv7" - } +val supportIosTarget = project.property("skipIosTarget") != "true" kotlin { @@ -69,48 +65,19 @@ kotlin { publishAllLibraryVariants() } - val supportIosTarget = project.property("skipIosTarget") != "true" if (supportIosTarget) { - fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = { - val nativeFrameworkPaths = listOf( - "FirebaseCore", - "FirebaseCoreDiagnostics", - "FirebaseAnalytics", - "GoogleAppMeasurement", - "GoogleAppMeasurementIdentitySupport", - "FirebaseInstallations", - "GoogleDataTransport", - "GoogleUtilities", - "PromisesObjC", - "nanopb" - ).map { - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - }.plus( - listOf( - "FirebaseABTesting", - "FirebaseRemoteConfig" - ).map { - projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ) - - binaries { - getTest("DEBUG").apply { - linkerOpts(nativeFrameworkPaths.map { "-F$it" }) - linkerOpts("-ObjC") - } + ios() + iosSimulatorArm64() + cocoapods { + ios.deploymentTarget = "11.0" + framework { + baseName = "FirebaseConfig" } - - compilations.getByName("main") { - cinterops.create("FirebaseRemoteConfig") { - compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") - } + noPodspec() + pod("FirebaseRemoteConfig") { + version = "10.4.0" } } - - ios(configure = nativeTargetConfig()) - iosSimulatorArm64(configure = nativeTargetConfig()) } js { @@ -127,8 +94,8 @@ kotlin { sourceSets { all { languageSettings.apply { - apiVersion = "1.6" - languageVersion = "1.6" + apiVersion = "1.8" + languageVersion = "1.8" progressiveMode = true optIn("kotlinx.coroutines.ExperimentalCoroutinesApi") } @@ -151,9 +118,8 @@ kotlin { val iosMain by getting val iosSimulatorArm64Main by getting iosSimulatorArm64Main.dependsOn(iosMain) - val iosTest by sourceSets.getting - val iosSimulatorArm64Test by sourceSets.getting + val iosSimulatorArm64Test by getting iosSimulatorArm64Test.dependsOn(iosTest) } @@ -167,6 +133,12 @@ if (project.property("firebase-config.skipIosTests") == "true") { } } +if (project.property("firebase-config.skipJsTests") == "true") { + tasks.forEach { + if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false } + } +} + signing { val signingKey: String? by project val signingPassword: String? by project diff --git a/firebase-config/firebase_config.podspec b/firebase-config/firebase_config.podspec new file mode 100644 index 000000000..e69de29bb diff --git a/firebase-config/package.json b/firebase-config/package.json index de786f4fa..76187dcfe 100644 --- a/firebase-config/package.json +++ b/firebase-config/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-config", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-config.js", "scripts": { @@ -23,9 +23,9 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { - "@gitlive/firebase-app": "1.7.3", + "@gitlive/firebase-app": "1.8.0", "firebase": "9.7.0", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" + "kotlin": "1.8.20", + "kotlinx-coroutines-core": "1.6.4" } } diff --git a/firebase-config/src/androidAndroidTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt b/firebase-config/src/androidAndroidTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt index d7de3c9ed..821ebf0f3 100644 --- a/firebase-config/src/androidAndroidTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt +++ b/firebase-config/src/androidAndroidTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt @@ -6,8 +6,7 @@ package dev.gitlive.firebase.remoteconfig import androidx.test.platform.app.InstrumentationRegistry -import kotlinx.coroutines.runBlocking actual val context: Any = InstrumentationRegistry.getInstrumentation().targetContext -actual fun runTest(test: suspend () -> Unit) = runBlocking { test() } +actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() } diff --git a/firebase-config/src/iosMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt b/firebase-config/src/iosMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt index 2cd361d7e..851e0e22d 100644 --- a/firebase-config/src/iosMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt +++ b/firebase-config/src/iosMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt @@ -19,8 +19,8 @@ import platform.Foundation.timeIntervalSince1970 actual val Firebase.remoteConfig: FirebaseRemoteConfig get() = FirebaseRemoteConfig(FIRRemoteConfig.remoteConfig()) -actual fun Firebase.remoteConfig(app: FirebaseApp): FirebaseRemoteConfig = - FirebaseRemoteConfig(FIRRemoteConfig.remoteConfigWithApp(Firebase.app.ios)) +actual fun Firebase.remoteConfig(app: FirebaseApp): FirebaseRemoteConfig = TODO("Come back to issue") +// FirebaseRemoteConfig(FIRRemoteConfig.remoteConfigWithApp(Firebase.app.ios)) actual class FirebaseRemoteConfig internal constructor(val ios: FIRRemoteConfig) { actual val all: Map @@ -106,6 +106,7 @@ actual class FirebaseRemoteConfig internal constructor(val ios: FIRRemoteConfig) FIRRemoteConfigFetchStatus.FIRRemoteConfigFetchStatusNoFetchYet -> FetchStatus.NoFetchYet FIRRemoteConfigFetchStatus.FIRRemoteConfigFetchStatusFailure -> FetchStatus.Failure FIRRemoteConfigFetchStatus.FIRRemoteConfigFetchStatusThrottled -> FetchStatus.Throttled + else -> FetchStatus.Failure } } } diff --git a/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt b/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt index 676ad19b9..74650729c 100644 --- a/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt +++ b/firebase-config/src/jsTest/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt @@ -1,24 +1,8 @@ package dev.gitlive.firebase.remoteconfig -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.promise actual val context: Any = Unit -actual fun runTest(test: suspend () -> Unit) = GlobalScope - .promise { - try { - test() - } catch (e: dynamic) { - (e as? Throwable)?.log() - throw e - } - }.asDynamic() - -internal fun Throwable.log() { - console.error(this) - cause?.let { - console.error("Caused by:") - it.log() - } +actual fun runTest(test: suspend () -> Unit) { + kotlinx.coroutines.test.runTest { test() } } diff --git a/firebase-config/src/nativeInterop/cinterop/Cartfile b/firebase-config/src/nativeInterop/cinterop/Cartfile deleted file mode 100644 index 68ad9c666..000000000 --- a/firebase-config/src/nativeInterop/cinterop/Cartfile +++ /dev/null @@ -1 +0,0 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" == 8.15.0 diff --git a/firebase-config/src/nativeInterop/cinterop/FirebaseRemoteConfig.def b/firebase-config/src/nativeInterop/cinterop/FirebaseRemoteConfig.def deleted file mode 100644 index 366525c26..000000000 --- a/firebase-config/src/nativeInterop/cinterop/FirebaseRemoteConfig.def +++ /dev/null @@ -1,5 +0,0 @@ -language = Objective-C -package = cocoapods.FirebaseRemoteConfig -modules = FirebaseRemoteConfig -compilerOpts = -framework FirebaseRemoteConfig -linkerOpts = -framework FirebaseABTesting -framework FirebaseRemoteConfig diff --git a/firebase-crashlytics/build.gradle.kts b/firebase-crashlytics/build.gradle.kts index 490f95342..cabcf91f0 100644 --- a/firebase-crashlytics/build.gradle.kts +++ b/firebase-crashlytics/build.gradle.kts @@ -10,6 +10,7 @@ version = project.property("firebase-crashlytics.version") as String plugins { id("com.android.library") kotlin("multiplatform") + kotlin("native.cocoapods") } android { @@ -44,12 +45,7 @@ android { } } -val KonanTarget.archVariant: String - get() = if (this is KonanTarget.IOS_X64 || this is KonanTarget.IOS_SIMULATOR_ARM64) { - "ios-arm64_i386_x86_64-simulator" - } else { - "ios-arm64_armv7" - } +val supportIosTarget = project.property("skipIosTarget") != "true" kotlin { @@ -57,51 +53,19 @@ kotlin { publishAllLibraryVariants() } - val supportIosTarget = project.property("skipIosTarget") != "true" if (supportIosTarget) { - - fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = { - val nativeFrameworkPaths = listOf( - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS") - ).plus( - listOf( - "FirebaseAnalytics", - "FirebaseCore", - "FirebaseCoreDiagnostics", - "FirebaseInstallations", - "GoogleAppMeasurement", - "GoogleAppMeasurementIdentitySupport", - "GoogleDataTransport", - "GoogleUtilities", - "nanopb", - "PromisesObjC" - ).map { - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ).plus( - listOf( - "FirebaseCrashlytics" - ).map { - projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ) - binaries { - getTest("DEBUG").apply { - linkerOpts(nativeFrameworkPaths.map { "-F$it" }) - linkerOpts("-ObjC") - } + ios() + iosSimulatorArm64() + cocoapods { + ios.deploymentTarget = "11.0" + framework { + baseName = "FirebaseCrashlytics" } - - compilations.getByName("main") { - cinterops.create("FirebaseCrashlytics") { - compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") - } + noPodspec() + pod("FirebaseCrashlytics") { + version = "10.4.0" } } - - ios(configure = nativeTargetConfig()) - iosSimulatorArm64(configure = nativeTargetConfig()) } sourceSets { diff --git a/firebase-crashlytics/firebase_crashlytics.podspec b/firebase-crashlytics/firebase_crashlytics.podspec new file mode 100644 index 000000000..e69de29bb diff --git a/firebase-crashlytics/package.json b/firebase-crashlytics/package.json index 76b16558b..3a54dbd80 100644 --- a/firebase-crashlytics/package.json +++ b/firebase-crashlytics/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-crashlytics", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-crashlytics.js", "scripts": { @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { - "@gitlive/firebase-app": "1.7.3", + "@gitlive/firebase-app": "1.8.0", "firebase": "9.7.0", "kotlin": "1.6.10", "kotlinx-coroutines-core": "1.6.1-native-mt" diff --git a/firebase-crashlytics/src/androidAndroidTest/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt b/firebase-crashlytics/src/androidAndroidTest/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt index b888b6434..6e8d9c0f4 100644 --- a/firebase-crashlytics/src/androidAndroidTest/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt +++ b/firebase-crashlytics/src/androidAndroidTest/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt @@ -7,10 +7,9 @@ package dev.gitlive.firebase.crashlytics import androidx.test.platform.app.InstrumentationRegistry import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.runBlocking actual val emulatorHost: String = "10.0.2.2" actual val context: Any = InstrumentationRegistry.getInstrumentation().targetContext -actual fun runTest(test: suspend CoroutineScope.() -> Unit) = runBlocking { test() } +actual fun runTest(test: suspend CoroutineScope.() -> Unit) = kotlinx.coroutines.test.runTest { test() } diff --git a/firebase-crashlytics/src/nativeInterop/cinterop/Cartfile b/firebase-crashlytics/src/nativeInterop/cinterop/Cartfile deleted file mode 100644 index 1084c6948..000000000 --- a/firebase-crashlytics/src/nativeInterop/cinterop/Cartfile +++ /dev/null @@ -1 +0,0 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseCrashlyticsBinary.json" == 8.15.0 diff --git a/firebase-crashlytics/src/nativeInterop/cinterop/FirebaseCrashlytics.def b/firebase-crashlytics/src/nativeInterop/cinterop/FirebaseCrashlytics.def deleted file mode 100644 index cf3735672..000000000 --- a/firebase-crashlytics/src/nativeInterop/cinterop/FirebaseCrashlytics.def +++ /dev/null @@ -1,5 +0,0 @@ -language = Objective-C -package = cocoapods.FirebaseCrashlytics -modules = FirebaseCrashlytics -compilerOpts = -framework FirebaseCrashlytics -linkerOpts = -framework FirebaseCrashlytics diff --git a/firebase-database/build.gradle.kts b/firebase-database/build.gradle.kts index de4a7821e..89e8cfbec 100644 --- a/firebase-database/build.gradle.kts +++ b/firebase-database/build.gradle.kts @@ -2,15 +2,13 @@ * Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license. */ -import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget -import org.jetbrains.kotlin.konan.target.KonanTarget - version = project.property("firebase-database.version") as String plugins { id("com.android.library") + kotlin("native.cocoapods") kotlin("multiplatform") - kotlin("plugin.serialization") version "1.6.10" + kotlin("plugin.serialization") version "1.8.20" } repositories { @@ -44,12 +42,7 @@ android { } } -val KonanTarget.archVariant: String - get() = if (this is KonanTarget.IOS_X64 || this is KonanTarget.IOS_SIMULATOR_ARM64) { - "ios-arm64_i386_x86_64-simulator" - } else { - "ios-arm64_armv7" - } +val supportIosTarget = project.property("skipIosTarget") != "true" kotlin { @@ -57,52 +50,19 @@ kotlin { publishAllLibraryVariants() } - val supportIosTarget = project.property("skipIosTarget") != "true" if (supportIosTarget) { - fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = { - val nativeFrameworkPaths = listOf( - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS") - ).plus( - listOf( - "FirebaseAnalytics", - "FirebaseCore", - "FirebaseCoreDiagnostics", - "FirebaseInstallations", - "GoogleAppMeasurement", - "GoogleAppMeasurementIdentitySupport", - "GoogleDataTransport", - "GoogleUtilities", - "nanopb", - "PromisesObjC" - ).map { - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ).plus( - listOf( - "FirebaseDatabase", - "leveldb-library" - ).map { - projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ) - - binaries { - getTest("DEBUG").apply { - linkerOpts(nativeFrameworkPaths.map { "-F$it" }) - linkerOpts("-ObjC") - } + ios() + iosSimulatorArm64() + cocoapods { + ios.deploymentTarget = "11.0" + framework { + baseName = "FirebaseDatabase" } - - compilations.getByName("main") { - cinterops.create("FirebaseDatabase") { - compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") - } + noPodspec() + pod("FirebaseDatabase") { + version = "10.4.0" } } - - ios(configure = nativeTargetConfig()) - iosSimulatorArm64(configure = nativeTargetConfig()) } js { @@ -126,12 +86,12 @@ kotlin { sourceSets { all { languageSettings.apply { - apiVersion = "1.6" - languageVersion = "1.6" + apiVersion = "1.8" + languageVersion = "1.8" progressiveMode = true -// optIn("kotlinx.coroutines.ExperimentalCoroutinesApi") -// optIn("kotlinx.coroutines.FlowPreview") -// optIn("kotlinx.serialization.InternalSerializationApi") + optIn("kotlinx.coroutines.ExperimentalCoroutinesApi") + optIn("kotlinx.coroutines.FlowPreview") + optIn("kotlinx.serialization.InternalSerializationApi") } } @@ -152,9 +112,8 @@ kotlin { val iosMain by getting val iosSimulatorArm64Main by getting iosSimulatorArm64Main.dependsOn(iosMain) - val iosTest by sourceSets.getting - val iosSimulatorArm64Test by sourceSets.getting + val iosSimulatorArm64Test by getting iosSimulatorArm64Test.dependsOn(iosTest) } @@ -172,6 +131,12 @@ if (project.property("firebase-database.skipIosTests") == "true") { } } +if (project.property("firebase-database.skipJsTests") == "true") { + tasks.forEach { + if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false } + } +} + signing { val signingKey: String? by project val signingPassword: String? by project diff --git a/firebase-database/firebase_database.podspec b/firebase-database/firebase_database.podspec new file mode 100644 index 000000000..e69de29bb diff --git a/firebase-database/package.json b/firebase-database/package.json index 5470db7ea..0bb53a13e 100644 --- a/firebase-database/package.json +++ b/firebase-database/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-database", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-database.js", "scripts": { @@ -23,9 +23,9 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { - "@gitlive/firebase-app": "1.7.3", + "@gitlive/firebase-app": "1.8.0", "firebase": "9.7.0", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" + "kotlin": "1.8.20", + "kotlinx-coroutines-core": "1.6.4" } } diff --git a/firebase-database/src/androidAndroidTest/kotlin/dev/gitlive/firebase/database/database.kt b/firebase-database/src/androidAndroidTest/kotlin/dev/gitlive/firebase/database/database.kt index ebe4d120b..91653371b 100644 --- a/firebase-database/src/androidAndroidTest/kotlin/dev/gitlive/firebase/database/database.kt +++ b/firebase-database/src/androidAndroidTest/kotlin/dev/gitlive/firebase/database/database.kt @@ -6,10 +6,8 @@ package dev.gitlive.firebase.database import androidx.test.platform.app.InstrumentationRegistry -import kotlinx.coroutines.runBlocking actual val emulatorHost: String = "10.0.2.2" actual val context: Any = InstrumentationRegistry.getInstrumentation().targetContext - -actual fun runTest(test: suspend () -> Unit) = runBlocking { test() } +actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() } diff --git a/firebase-database/src/iosMain/kotlin/dev/gitlive/firebase/database/database.kt b/firebase-database/src/iosMain/kotlin/dev/gitlive/firebase/database/database.kt index c0be2d33c..da9da10ba 100644 --- a/firebase-database/src/iosMain/kotlin/dev/gitlive/firebase/database/database.kt +++ b/firebase-database/src/iosMain/kotlin/dev/gitlive/firebase/database/database.kt @@ -40,11 +40,11 @@ actual val Firebase.database actual fun Firebase.database(url: String) = FirebaseDatabase(FIRDatabase.databaseWithURL(url)) -actual fun Firebase.database(app: FirebaseApp) = - FirebaseDatabase(FIRDatabase.databaseForApp(app.ios)) +actual fun Firebase.database(app: FirebaseApp): FirebaseDatabase = TODO("Come back to issue") +// FirebaseDatabase(FIRDatabase.databaseForApp(app.ios)) -actual fun Firebase.database(app: FirebaseApp, url: String) = - FirebaseDatabase(FIRDatabase.databaseForApp(app.ios, url)) +actual fun Firebase.database(app: FirebaseApp, url: String): FirebaseDatabase = TODO("Come back to issue") +// FirebaseDatabase(FIRDatabase.databaseForApp(app.ios, url)) actual class FirebaseDatabase internal constructor(val ios: FIRDatabase) { diff --git a/firebase-database/src/jsTest/kotlin/dev/gitlive/firebase/database/database.kt b/firebase-database/src/jsTest/kotlin/dev/gitlive/firebase/database/database.kt index e30aac335..1ba05f836 100644 --- a/firebase-database/src/jsTest/kotlin/dev/gitlive/firebase/database/database.kt +++ b/firebase-database/src/jsTest/kotlin/dev/gitlive/firebase/database/database.kt @@ -1,26 +1,8 @@ package dev.gitlive.firebase.database -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.promise - actual val emulatorHost: String = "localhost" actual val context: Any = Unit - -actual fun runTest(test: suspend () -> Unit) = GlobalScope - .promise { - try { - test() - } catch (e: Throwable) { - e.log() - throw e - } - }.asDynamic() - -internal fun Throwable.log() { - console.error(this) - cause?.let { - console.error("Caused by:") - it.log() - } +actual fun runTest(test: suspend () -> Unit) { + runTest { test() } } \ No newline at end of file diff --git a/firebase-database/src/nativeInterop/cinterop/Cartfile b/firebase-database/src/nativeInterop/cinterop/Cartfile deleted file mode 100644 index b9f06b4d1..000000000 --- a/firebase-database/src/nativeInterop/cinterop/Cartfile +++ /dev/null @@ -1 +0,0 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseDatabaseBinary.json" == 8.15.0 diff --git a/firebase-database/src/nativeInterop/cinterop/FirebaseDatabase.def b/firebase-database/src/nativeInterop/cinterop/FirebaseDatabase.def deleted file mode 100644 index c183b9287..000000000 --- a/firebase-database/src/nativeInterop/cinterop/FirebaseDatabase.def +++ /dev/null @@ -1,5 +0,0 @@ -language = Objective-C -package = cocoapods.FirebaseDatabase -modules = FirebaseDatabase -compilerOpts = -framework FirebaseDatabase -linkerOpts = -framework FirebaseDatabase -framework leveldb-library diff --git a/firebase-firestore/build.gradle.kts b/firebase-firestore/build.gradle.kts index 0cddc2958..c4a0b54da 100644 --- a/firebase-firestore/build.gradle.kts +++ b/firebase-firestore/build.gradle.kts @@ -2,15 +2,13 @@ * Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license. */ -import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget -import org.jetbrains.kotlin.konan.target.KonanTarget - version = project.property("firebase-firestore.version") as String plugins { id("com.android.library") + kotlin("native.cocoapods") kotlin("multiplatform") - kotlin("plugin.serialization") version "1.6.10" + kotlin("plugin.serialization") version "1.8.20" } android { @@ -46,12 +44,7 @@ android { } } -val KonanTarget.archVariant: String - get() = if (this is KonanTarget.IOS_X64 || this is KonanTarget.IOS_SIMULATOR_ARM64) { - "ios-arm64_i386_x86_64-simulator" - } else { - "ios-arm64_armv7" - } +val supportIosTarget = project.property("skipIosTarget") != "true" kotlin { @@ -59,71 +52,34 @@ kotlin { publishAllLibraryVariants() } - val supportIosTarget = project.property("skipIosTarget") != "true" if (supportIosTarget) { - fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = { - val nativeFrameworkPaths = listOf( - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS") - ).plus( - listOf( - "FirebaseAnalytics", - "FirebaseCore", - "FirebaseCoreDiagnostics", - "FirebaseInstallations", - "GoogleAppMeasurement", - "GoogleAppMeasurementIdentitySupport", - "GoogleDataTransport", - "GoogleUtilities", - "nanopb", - "PromisesObjC" - ).map { - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ).plus( - listOf( - "abseil", - "BoringSSL-GRPC", - "FirebaseFirestore", - "gRPC-C++", - "gRPC-Core", - "leveldb-library" - ).map { - projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ) - - binaries { - getTest("DEBUG").apply { - linkerOpts(nativeFrameworkPaths.map { "-F$it" }) - linkerOpts("-ObjC") - } + ios() + iosSimulatorArm64() + cocoapods { + ios.deploymentTarget = "11.0" + framework { + baseName = "FirebaseFirestore" } - - compilations.getByName("main") { - cinterops.create("FirebaseFirestore") { - compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") - } + noPodspec() + pod("FirebaseFirestore") { + version = "10.4.0" } } - - ios(configure = nativeTargetConfig()) - iosSimulatorArm64(configure = nativeTargetConfig()) } js { useCommonJs() nodejs { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } browser { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } @@ -132,8 +88,8 @@ kotlin { sourceSets { all { languageSettings.apply { - apiVersion = "1.6" - languageVersion = "1.6" + apiVersion = "1.8" + languageVersion = "1.8" progressiveMode = true optIn("kotlinx.coroutines.ExperimentalCoroutinesApi") optIn("kotlinx.serialization.InternalSerializationApi") @@ -157,9 +113,8 @@ kotlin { val iosMain by getting val iosSimulatorArm64Main by getting iosSimulatorArm64Main.dependsOn(iosMain) - val iosTest by sourceSets.getting - val iosSimulatorArm64Test by sourceSets.getting + val iosSimulatorArm64Test by getting iosSimulatorArm64Test.dependsOn(iosTest) } @@ -173,9 +128,15 @@ if (project.property("firebase-firestore.skipIosTests") == "true") { } } +if (project.property("firebase-firestore.skipJsTests") == "true") { + tasks.forEach { + if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false } + } +} + signing { val signingKey: String? by project val signingPassword: String? by project useInMemoryPgpKeys(signingKey, signingPassword) sign(publishing.publications) -} +} \ No newline at end of file diff --git a/firebase-firestore/firebase_firestore.podspec b/firebase-firestore/firebase_firestore.podspec new file mode 100644 index 000000000..e69de29bb diff --git a/firebase-firestore/package.json b/firebase-firestore/package.json index de4c29a53..bdf3285ce 100644 --- a/firebase-firestore/package.json +++ b/firebase-firestore/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-firestore", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-firestore.js", "scripts": { @@ -23,9 +23,9 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { - "@gitlive/firebase-app": "1.7.3", + "@gitlive/firebase-app": "1.8.0", "firebase": "9.7.0", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" + "kotlin": "1.8.20", + "kotlinx-coroutines-core": "1.6.4" } } diff --git a/firebase-firestore/src/iosMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/iosMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt index 458b83b71..d2d38542e 100644 --- a/firebase-firestore/src/iosMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/iosMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -34,9 +34,10 @@ private fun encode(strategy: SerializationStrategy , value: T, shouldEnco actual val Firebase.firestore get() = FirebaseFirestore(FIRFirestore.firestore()) -actual fun Firebase.firestore(app: FirebaseApp): FirebaseFirestore { - return FirebaseFirestore(FIRFirestore.firestoreForApp(app.ios)) -} +actual fun Firebase.firestore(app: FirebaseApp): FirebaseFirestore = TODO("Come back to issue") +//actual fun Firebase.firestore(app: FirebaseApp): FirebaseFirestore { +// return FirebaseFirestore(FIRFirestore.firestoreForApp(app.ios)) +//} @Suppress("UNCHECKED_CAST") actual class FirebaseFirestore(val ios: FIRFirestore) { diff --git a/firebase-firestore/src/jsTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/jsTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt index c4b272bb8..f4cc24ae9 100644 --- a/firebase-firestore/src/jsTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/jsTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -5,27 +5,12 @@ package dev.gitlive.firebase.firestore import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.promise +import kotlinx.coroutines.test.runTest actual val emulatorHost: String = "localhost" actual val context: Any = Unit -actual fun runTest(test: suspend CoroutineScope.() -> Unit) = GlobalScope - .promise { - try { - test() - } catch (e: dynamic) { - (e as? Throwable)?.log() - throw e - } - }.asDynamic() - -internal fun Throwable.log() { - console.error(this) - cause?.let { - console.error("Caused by:") - it.log() - } +actual fun runTest(test: suspend CoroutineScope.() -> Unit) { + runTest { test() } } diff --git a/firebase-firestore/src/nativeInterop/cinterop/Cartfile b/firebase-firestore/src/nativeInterop/cinterop/Cartfile deleted file mode 100644 index 31fa209bb..000000000 --- a/firebase-firestore/src/nativeInterop/cinterop/Cartfile +++ /dev/null @@ -1 +0,0 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json" == 8.15.0 diff --git a/firebase-firestore/src/nativeInterop/cinterop/FirebaseFirestore.def b/firebase-firestore/src/nativeInterop/cinterop/FirebaseFirestore.def deleted file mode 100644 index e12e08820..000000000 --- a/firebase-firestore/src/nativeInterop/cinterop/FirebaseFirestore.def +++ /dev/null @@ -1,5 +0,0 @@ -language = Objective-C -package = cocoapods.FirebaseFirestore -modules = FirebaseFirestore -compilerOpts = -framework FirebaseFirestore -linkerOpts = -framework FirebaseFirestore -framework abseil -framework gRPC-Core -framework gRPC-C++ -framework BoringSSL-GRPC -framework leveldb-library -framework SystemConfiguration -framework MobileCoreServices diff --git a/firebase-functions/build.gradle.kts b/firebase-functions/build.gradle.kts index 8e004c007..0ace127d7 100644 --- a/firebase-functions/build.gradle.kts +++ b/firebase-functions/build.gradle.kts @@ -2,13 +2,11 @@ * Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license. */ -import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget -import org.jetbrains.kotlin.konan.target.KonanTarget - version = project.property("firebase-functions.version") as String plugins { id("com.android.library") + kotlin("native.cocoapods") kotlin("multiplatform") } @@ -38,12 +36,7 @@ android { } } -val KonanTarget.archVariant: String - get() = if (this is KonanTarget.IOS_X64 || this is KonanTarget.IOS_SIMULATOR_ARM64) { - "ios-arm64_i386_x86_64-simulator" - } else { - "ios-arm64_armv7" - } +val supportIosTarget = project.property("skipIosTarget") != "true" kotlin { @@ -51,67 +44,34 @@ kotlin { publishAllLibraryVariants() } - val supportIosTarget = project.property("skipIosTarget") != "true" if (supportIosTarget) { - fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = { - val nativeFrameworkPaths = listOf( - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS") - ).plus( - listOf( - "FirebaseAnalytics", - "FirebaseCore", - "FirebaseCoreDiagnostics", - "FirebaseInstallations", - "GoogleAppMeasurement", - "GoogleAppMeasurementIdentitySupport", - "GoogleDataTransport", - "GoogleUtilities", - "nanopb", - "PromisesObjC" - ).map { - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ).plus( - listOf( - "FirebaseFunctions", - "GTMSessionFetcher" - ).map { - projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ) - - binaries { - getTest("DEBUG").apply { - linkerOpts(nativeFrameworkPaths.map { "-F$it" }) - linkerOpts("-ObjC") - } + ios() + iosSimulatorArm64() + cocoapods { + ios.deploymentTarget = "11.0" + framework { + baseName = "FirebaseFunctions" } - - compilations.getByName("main") { - cinterops.create("FirebaseFunctions") { - compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") - } + noPodspec() + pod("FirebaseFunctions") { + version = "10.4.0" } } - - ios(configure = nativeTargetConfig()) - iosSimulatorArm64(configure = nativeTargetConfig()) } js { useCommonJs() nodejs { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } browser { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } @@ -120,8 +80,8 @@ kotlin { sourceSets { all { languageSettings.apply { - apiVersion = "1.6" - languageVersion = "1.6" + apiVersion = "1.8" + languageVersion = "1.8" progressiveMode = true optIn("kotlinx.coroutines.ExperimentalCoroutinesApi") optIn("kotlinx.serialization.InternalSerializationApi") @@ -145,9 +105,8 @@ kotlin { val iosMain by getting val iosSimulatorArm64Main by getting iosSimulatorArm64Main.dependsOn(iosMain) - val iosTest by sourceSets.getting - val iosSimulatorArm64Test by sourceSets.getting + val iosSimulatorArm64Test by getting iosSimulatorArm64Test.dependsOn(iosTest) } @@ -161,6 +120,12 @@ if (project.property("firebase-functions.skipIosTests") == "true") { } } +if (project.property("firebase-functions.skipJsTests") == "true") { + tasks.forEach { + if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false } + } +} + signing { val signingKey: String? by project val signingPassword: String? by project diff --git a/firebase-functions/firebase_functions.podspec b/firebase-functions/firebase_functions.podspec new file mode 100644 index 000000000..e69de29bb diff --git a/firebase-functions/package.json b/firebase-functions/package.json index 39cc7f052..d87fd7532 100644 --- a/firebase-functions/package.json +++ b/firebase-functions/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-functions", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-functions.js", "scripts": { @@ -23,9 +23,9 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { - "@gitlive/firebase-app": "1.7.3", + "@gitlive/firebase-app": "1.8.0", "firebase": "9.7.0", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" + "kotlin": "1.8.20", + "kotlinx-coroutines-core": "1.6.4" } } diff --git a/firebase-functions/src/iosMain/kotlin/dev/gitlive/firebase/functions/functions.kt b/firebase-functions/src/iosMain/kotlin/dev/gitlive/firebase/functions/functions.kt index 2c706d725..02134882d 100644 --- a/firebase-functions/src/iosMain/kotlin/dev/gitlive/firebase/functions/functions.kt +++ b/firebase-functions/src/iosMain/kotlin/dev/gitlive/firebase/functions/functions.kt @@ -21,17 +21,18 @@ actual val Firebase.functions actual fun Firebase.functions(region: String) = FirebaseFunctions(FIRFunctions.functionsForRegion(region)) -actual fun Firebase.functions(app: FirebaseApp) = - FirebaseFunctions(FIRFunctions.functionsForApp(app.ios)) +actual fun Firebase.functions(app: FirebaseApp): FirebaseFunctions = TODO("Come back to issue") +// FirebaseFunctions(FIRFunctions.functionsForApp(app.ios)) -actual fun Firebase.functions(app: FirebaseApp, region: String) = - FirebaseFunctions(FIRFunctions.functionsForApp(app.ios, region = region)) +actual fun Firebase.functions(app: FirebaseApp, region: String): FirebaseFunctions = TODO("Come back to issue") +// FirebaseFunctions(FIRFunctions.functionsForApp(app.ios, region = region)) actual class FirebaseFunctions internal constructor(val ios: FIRFunctions) { actual fun httpsCallable(name: String, timeout: Long?) = HttpsCallableReference(ios.HTTPSCallableWithName(name).apply { timeout?.let { setTimeoutInterval(it/1000.0) } }) - actual fun useFunctionsEmulator(origin: String) = ios.useFunctionsEmulatorOrigin(origin) + actual fun useFunctionsEmulator(origin: String): Unit = TODO("Come back to issue") + //ios.useFunctionsEmulatorOrigin(origin) actual fun useEmulator(host: String, port: Int) = ios.useEmulatorWithHost(host, port.toLong()) } @@ -49,10 +50,10 @@ actual class HttpsCallableReference internal constructor(val ios: FIRHTTPSCallab actual class HttpsCallableResult constructor(val ios: FIRHTTPSCallableResult) { actual inline fun data() = - decode(value = ios.data) + decode(value = ios.data()) actual fun data(strategy: DeserializationStrategy) = - decode(strategy, ios.data) + decode(strategy, ios.data()) } actual class FirebaseFunctionsException(message: String): FirebaseException(message) diff --git a/firebase-functions/src/nativeInterop/cinterop/Cartfile b/firebase-functions/src/nativeInterop/cinterop/Cartfile deleted file mode 100644 index 117a1d05c..000000000 --- a/firebase-functions/src/nativeInterop/cinterop/Cartfile +++ /dev/null @@ -1 +0,0 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFunctionsBinary.json" == 8.15.0 diff --git a/firebase-functions/src/nativeInterop/cinterop/FirebaseFunctions.def b/firebase-functions/src/nativeInterop/cinterop/FirebaseFunctions.def deleted file mode 100644 index bae0fcbdc..000000000 --- a/firebase-functions/src/nativeInterop/cinterop/FirebaseFunctions.def +++ /dev/null @@ -1,5 +0,0 @@ -language = Objective-C -package = cocoapods.FirebaseFunctions -modules = FirebaseFunctions -compilerOpts = -framework FirebaseFunctions -linkerOpts = -framework FirebaseFunctions -framework GTMSessionFetcher diff --git a/firebase-installations/build.gradle.kts b/firebase-installations/build.gradle.kts index c24478c42..abe7dbbb4 100644 --- a/firebase-installations/build.gradle.kts +++ b/firebase-installations/build.gradle.kts @@ -2,13 +2,11 @@ * Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license. */ -import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget -import org.jetbrains.kotlin.konan.target.KonanTarget - version = project.property("firebase-installations.version") as String plugins { id("com.android.library") + kotlin("native.cocoapods") kotlin("multiplatform") } @@ -38,12 +36,7 @@ android { } } -val KonanTarget.archVariant: String - get() = if (this is KonanTarget.IOS_X64 || this is KonanTarget.IOS_SIMULATOR_ARM64) { - "ios-arm64_i386_x86_64-simulator" - } else { - "ios-arm64_armv7" - } +val supportIosTarget = project.property("skipIosTarget") != "true" kotlin { @@ -51,60 +44,34 @@ kotlin { publishAllLibraryVariants() } - val supportIosTarget = project.property("skipIosTarget") != "true" if (supportIosTarget) { - fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = { - val nativeFrameworkPaths = listOf( - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS") - ).plus( - listOf( - "FirebaseAnalytics", - "FirebaseCore", - "FirebaseCoreDiagnostics", - "FirebaseInstallations", - "GoogleAppMeasurement", - "GoogleAppMeasurementIdentitySupport", - "GoogleDataTransport", - "GoogleUtilities", - "nanopb", - "PromisesObjC" - ).map { - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ) - - binaries { - getTest("DEBUG").apply { - linkerOpts(nativeFrameworkPaths.map { "-F$it" }) - linkerOpts("-ObjC") - } + ios() + iosSimulatorArm64() + cocoapods { + ios.deploymentTarget = "11.0" + framework { + baseName = "FirebaseFunctions" } - - compilations.getByName("main") { - cinterops.create("FirebaseInstallations") { - compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") - } + noPodspec() + pod("FirebaseInstallations") { + version = "10.4.0" } } - - ios(configure = nativeTargetConfig()) - iosSimulatorArm64(configure = nativeTargetConfig()) } js { useCommonJs() nodejs { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } browser { testTask { - useMocha { - timeout = "5s" + useKarma { + useChromeHeadless() } } } @@ -113,8 +80,8 @@ kotlin { sourceSets { all { languageSettings.apply { - apiVersion = "1.6" - languageVersion = "1.6" + apiVersion = "1.8" + languageVersion = "1.8" progressiveMode = true } } @@ -136,9 +103,8 @@ kotlin { val iosMain by getting val iosSimulatorArm64Main by getting iosSimulatorArm64Main.dependsOn(iosMain) - val iosTest by sourceSets.getting - val iosSimulatorArm64Test by sourceSets.getting + val iosSimulatorArm64Test by getting iosSimulatorArm64Test.dependsOn(iosTest) } @@ -152,6 +118,12 @@ if (project.property("firebase-installations.skipIosTests") == "true") { } } +if (project.property("firebase-installations.skipJsTests") == "true") { + tasks.forEach { + if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false } + } +} + signing { val signingKey: String? by project val signingPassword: String? by project diff --git a/firebase-installations/firebase_installations.podspec b/firebase-installations/firebase_installations.podspec new file mode 100644 index 000000000..e69de29bb diff --git a/firebase-installations/package.json b/firebase-installations/package.json index 068eed03e..2e7c5aafa 100644 --- a/firebase-installations/package.json +++ b/firebase-installations/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-installations", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-installations.js", "scripts": { @@ -23,9 +23,9 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { - "@gitlive/firebase-app": "1.7.3", + "@gitlive/firebase-app": "1.8.0", "firebase": "9.7.0", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" + "kotlin": "1.8.20", + "kotlinx-coroutines-core": "1.6.4" } } diff --git a/firebase-installations/src/iosMain/kotlin/dev/gitlive/firebase/installations/installations.kt b/firebase-installations/src/iosMain/kotlin/dev/gitlive/firebase/installations/installations.kt index 34528cb16..536b3746e 100644 --- a/firebase-installations/src/iosMain/kotlin/dev/gitlive/firebase/installations/installations.kt +++ b/firebase-installations/src/iosMain/kotlin/dev/gitlive/firebase/installations/installations.kt @@ -10,8 +10,8 @@ import platform.Foundation.* actual val Firebase.installations get() = FirebaseInstallations(FIRInstallations.installations()) -actual fun Firebase.installations(app: FirebaseApp) - = FirebaseInstallations(FIRInstallations.installationsWithApp(app.ios)) +actual fun Firebase.installations(app: FirebaseApp) : FirebaseInstallations = TODO("Come back to issue") +// = FirebaseInstallations(FIRInstallations.installationsWithApp(app.ios)) actual class FirebaseInstallations internal constructor(val ios: FIRInstallations) { diff --git a/firebase-installations/src/nativeInterop/cinterop/FirebaseInstallations.def b/firebase-installations/src/nativeInterop/cinterop/FirebaseInstallations.def deleted file mode 100644 index 1a17663ed..000000000 --- a/firebase-installations/src/nativeInterop/cinterop/FirebaseInstallations.def +++ /dev/null @@ -1,5 +0,0 @@ -language = Objective-C -package = cocoapods.FirebaseInstallations -modules = FirebaseInstallations -compilerOpts = -framework FirebaseInstallations -linkerOpts = -framework FirebaseInstallations diff --git a/firebase-perf/build.gradle.kts b/firebase-perf/build.gradle.kts index 11e7631ac..07f083bf5 100644 --- a/firebase-perf/build.gradle.kts +++ b/firebase-perf/build.gradle.kts @@ -10,19 +10,9 @@ version = project.property("firebase-perf.version") as String plugins { id("com.android.library") kotlin("multiplatform") - //id("com.quittle.android-emulator") version "0.2.0" + kotlin("native.cocoapods") } -//buildscript { -// repositories { -// google() -// gradlePluginPortal() -// } -// dependencies { -// classpath("com.android.tools.build:gradle:3.6.1") -// } -//} - android { compileSdk = property("targetSdkVersion") as Int defaultConfig { @@ -55,25 +45,7 @@ android { } } -// Optional configuration -//androidEmulator { -// emulator { -// name("givlive_emulator") -// sdkVersion(28) -// abi("x86_64") -// includeGoogleApis(true) // Defaults to false -// -// } -// headless(false) -// logEmulatorOutput(false) -//} - -val KonanTarget.archVariant: String - get() = if (this is KonanTarget.IOS_X64 || this is KonanTarget.IOS_SIMULATOR_ARM64) { - "ios-arm64_i386_x86_64-simulator" - } else { - "ios-arm64_armv7" - } +val supportIosTarget = project.property("skipIosTarget") != "true" kotlin { @@ -81,53 +53,19 @@ kotlin { publishAllLibraryVariants() } - val supportIosTarget = project.property("skipIosTarget") != "true" if (supportIosTarget) { - - fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = { - val nativeFrameworkPaths = listOf( - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS") - ).plus( - listOf( - "FirebaseAnalytics", - "FirebaseCore", - "FirebaseCoreDiagnostics", - "FirebaseInstallations", - "GoogleAppMeasurement", - "GoogleAppMeasurementIdentitySupport", - "GoogleDataTransport", - "GoogleUtilities", - "nanopb", - "PromisesObjC" - ).map { - rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ).plus( - listOf( - "FirebasePerformance", - "FirebaseRemoteConfig", - "FirebaseABTesting" - ).map { - projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/$it.xcframework/${konanTarget.archVariant}") - } - ) - binaries { - getTest("DEBUG").apply { - linkerOpts(nativeFrameworkPaths.map { "-F$it" }) - linkerOpts("-ObjC") - } + ios() + iosSimulatorArm64() + cocoapods { + ios.deploymentTarget = "11.0" + framework { + baseName = "FirebasePerformance" } - - compilations.getByName("main") { - cinterops.create("FirebasePerformance") { - compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") - } + noPodspec() + pod("FirebasePerformance") { + version = "10.4.0" } } - - ios(configure = nativeTargetConfig()) - iosSimulatorArm64(configure = nativeTargetConfig()) } js { @@ -184,6 +122,12 @@ if (project.property("firebase-perf.skipIosTests") == "true") { } } +if (project.property("firebase-perf.skipJsTests") == "true") { + tasks.forEach { + if (it.name.contains("js", true) && it.name.contains("test", true)) { it.enabled = false } + } +} + signing { val signingKey: String? by project val signingPassword: String? by project diff --git a/firebase-perf/firebase_perf.podspec b/firebase-perf/firebase_perf.podspec new file mode 100644 index 000000000..e69de29bb diff --git a/firebase-perf/package.json b/firebase-perf/package.json index a45563bee..7bbfd80ae 100644 --- a/firebase-perf/package.json +++ b/firebase-perf/package.json @@ -1,6 +1,6 @@ { "name": "@gitlive/firebase-perf", - "version": "1.7.3", + "version": "1.8.0", "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", "main": "firebase-perf.js", "scripts": { @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { - "@gitlive/firebase-app": "1.7.3", + "@gitlive/firebase-app": "1.8.0", "firebase": "9.7.0", "kotlin": "1.6.10", "kotlinx-coroutines-core": "1.6.1-native-mt" diff --git a/firebase-perf/src/androidAndroidTest/kotlin/dev/gitlive/firebase/perf/performance.kt b/firebase-perf/src/androidAndroidTest/kotlin/dev/gitlive/firebase/perf/performance.kt index f16bed3bf..3d270a930 100644 --- a/firebase-perf/src/androidAndroidTest/kotlin/dev/gitlive/firebase/perf/performance.kt +++ b/firebase-perf/src/androidAndroidTest/kotlin/dev/gitlive/firebase/perf/performance.kt @@ -7,10 +7,9 @@ package dev.gitlive.firebase.perf import androidx.test.platform.app.InstrumentationRegistry import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.runBlocking actual val emulatorHost: String = "10.0.2.2" actual val context: Any = InstrumentationRegistry.getInstrumentation().targetContext -actual fun runTest(test: suspend CoroutineScope.() -> Unit) = runBlocking { test() } +actual fun runTest(test: suspend CoroutineScope.() -> Unit) = kotlinx.coroutines.test.runTest { test() } diff --git a/firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf/performance.kt b/firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf/performance.kt index f977f4605..85fcd695b 100644 --- a/firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf/performance.kt +++ b/firebase-perf/src/jsTest/kotlin/dev/gitlive/firebase/perf/performance.kt @@ -9,30 +9,14 @@ import dev.gitlive.firebase.FirebaseOptions import dev.gitlive.firebase.apps import dev.gitlive.firebase.initialize import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.promise import kotlin.test.* actual val emulatorHost: String = "localhost" actual val context: Any = Unit -actual fun runTest(test: suspend CoroutineScope.() -> Unit) = GlobalScope - .promise { - try { - test() - } catch (e: dynamic) { - (e as? Throwable)?.log() - throw e - } - }.asDynamic() - -internal fun Throwable.log() { - console.error(this) - cause?.let { - console.error("Caused by:") - it.log() - } +actual fun runTest(test: suspend CoroutineScope.() -> Unit) { + kotlinx.coroutines.test.runTest { test() } } class JsPerformanceTest { diff --git a/firebase-perf/src/nativeInterop/cinterop/Cartfile b/firebase-perf/src/nativeInterop/cinterop/Cartfile deleted file mode 100644 index 400337b61..000000000 --- a/firebase-perf/src/nativeInterop/cinterop/Cartfile +++ /dev/null @@ -1 +0,0 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebasePerformanceBinary.json" == 8.15.0 diff --git a/firebase-perf/src/nativeInterop/cinterop/FirebasePerformance.def b/firebase-perf/src/nativeInterop/cinterop/FirebasePerformance.def deleted file mode 100644 index d2dab0f74..000000000 --- a/firebase-perf/src/nativeInterop/cinterop/FirebasePerformance.def +++ /dev/null @@ -1,5 +0,0 @@ -language = Objective-C -package = cocoapods.FirebasePerformance -modules = FirebasePerformance -compilerOpts = -framework FirebasePerformance -linkerOpts = -framework FirebasePerformance diff --git a/gradle.properties b/gradle.properties index 150790b70..ba864d90a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,6 @@ kotlin.js.experimental.generateKotlinExternals=false #kotlin.mpp.enableCompatibilityMetadataVariant=true #kotlin.mpp.enableGranularSourceSetsMetadata=true kotlin.mpp.stability.nowarn=true -kotlin.native.cacheKind.iosX64=none #kotlin.native.enableDependencyPropagation=false kotlin.native.enableParallelExecutionCheck=false kotlin.setJvmTargetFromAndroidCompileOptions=true @@ -18,6 +17,8 @@ org.gradle.jvmargs=-Xmx2048m org.gradle.parallel=true systemProp.org.gradle.internal.publish.checksums.insecure=true testOptions.unitTests.isIncludeAndroidResources=true +kotlin.mpp.enableCInteropCommonization=true +kotlin.native.cacheKind=none # Set to true to skip tests and even compilation of the iOS target. skipIosTarget=false @@ -34,14 +35,25 @@ firebase-installations.skipIosTests=false firebase-perf.skipIosTests=false firebase-crashlytics.skipIosTests=false +# We can have the functionality to skip js tests, due to compatibility issues. +firebase-app.skipJsTests=false +firebase-auth.skipJsTests=false +firebase-common.skipJsTests=false +firebase-config.skipJsTests=false +firebase-database.skipJsTests=true +firebase-firestore.skipJsTests=false +firebase-functions.skipJsTests=false +firebase-installations.skipJsTests=false +firebase-perf.skipJsTests=false + # Versions: -firebase-app.version=1.7.3 -firebase-auth.version=1.7.3 -firebase-common.version=1.7.3 -firebase-config.version=1.7.3 -firebase-database.version=1.7.3 -firebase-firestore.version=1.7.3 -firebase-functions.version=1.7.3 -firebase-installations.version=1.7.3 -firebase-perf.version=1.7.3 -firebase-crashlytics.version=1.7.3 +firebase-app.version=1.8.0 +firebase-auth.version=1.8.0 +firebase-common.version=1.8.0 +firebase-config.version=1.8.0 +firebase-database.version=1.8.0 +firebase-firestore.version=1.8.0 +firebase-functions.version=1.8.0 +firebase-installations.version=1.8.0 +firebase-perf.version=1.8.0 +firebase-crashlytics.version=1.8.0