diff --git a/build.gradle.kts b/build.gradle.kts index 8a664034e..f908181f9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,8 @@ repositories { } plugins { - kotlin("multiplatform") version "1.8.20" apply false - kotlin("native.cocoapods") version "1.8.20" apply false + kotlin("multiplatform") version "1.9.10" apply false + kotlin("native.cocoapods") version "1.9.10" apply false id("base") id("com.github.ben-manes.versions") version "0.42.0" } @@ -32,23 +32,6 @@ buildscript { val targetSdkVersion by extra(32) val minSdkVersion by extra(19) -tasks { - val updateVersions by registering { - dependsOn( - "firebase-app:updateVersion", "firebase-app:updateDependencyVersion", - "firebase-auth:updateVersion", "firebase-auth:updateDependencyVersion", - "firebase-common:updateVersion", "firebase-common:updateDependencyVersion", - "firebase-config:updateVersion", "firebase-config:updateDependencyVersion", - "firebase-database:updateVersion", "firebase-database:updateDependencyVersion", - "firebase-firestore:updateVersion", "firebase-firestore:updateDependencyVersion", - "firebase-functions:updateVersion", "firebase-functions:updateDependencyVersion", - "firebase-installations:updateVersion", "firebase-installations:updateDependencyVersion", - "firebase-perf:updateVersion", "firebase-perf:updateDependencyVersion", - "firebase-storage:updateVersion", "firebase-storage:updateDependencyVersion" - ) - } -} - subprojects { group = "dev.gitlive" @@ -85,23 +68,6 @@ subprojects { ) } } - - if (skipPublishing) return@tasks - - val updateVersion by registering(Exec::class) { - commandLine("npm", "--allow-same-version", "--prefix", projectDir, "version", "${project.property("${project.name}.version")}") - } - - val updateDependencyVersion by registering(Copy::class) { - mustRunAfter("updateVersion") - val from = file("package.json") - from.writeText( - from.readText() - .replace("version\": \"([^\"]+)".toRegex(), "version\": \"${project.property("${project.name}.version")}") - .replace("firebase-common\": \"([^\"]+)".toRegex(), "firebase-common\": \"${project.property("firebase-common.version")}") - .replace("firebase-app\": \"([^\"]+)".toRegex(), "firebase-app\": \"${project.property("firebase-app.version")}") - ) - } } afterEvaluate { @@ -123,11 +89,12 @@ subprojects { "jvmTestImplementation"(kotlin("test-junit")) "jvmTestImplementation"("junit:junit:4.13.2") } - "androidAndroidTestImplementation"(kotlin("test-junit")) - "androidAndroidTestImplementation"("junit:junit:4.13.2") - "androidAndroidTestImplementation"("androidx.test:core:1.4.0") - "androidAndroidTestImplementation"("androidx.test.ext:junit:1.1.3") - "androidAndroidTestImplementation"("androidx.test:runner:1.4.0") + "androidUnitTestImplementation"(kotlin("test-junit")) + "androidInstrumentedTestImplementation"(kotlin("test-junit")) + "androidInstrumentedTestImplementation"("junit:junit:4.13.2") + "androidInstrumentedTestImplementation"("androidx.test:core:1.4.0") + "androidInstrumentedTestImplementation"("androidx.test.ext:junit:1.1.3") + "androidInstrumentedTestImplementation"("androidx.test:runner:1.4.0") } } diff --git a/firebase-app/build.gradle.kts b/firebase-app/build.gradle.kts index 109d5182a..94a209ef1 100644 --- a/firebase-app/build.gradle.kts +++ b/firebase-app/build.gradle.kts @@ -75,7 +75,7 @@ kotlin { } js { - useCommonJs() + useEsModules() nodejs { testTask { useKarma { @@ -106,12 +106,18 @@ kotlin { implementation(project(":firebase-common")) } } + val commonTest by getting val androidMain by getting { dependencies { api("com.google.firebase:firebase-common") } } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } val jvmMain by getting { kotlin.srcDir("src/androidMain/kotlin") diff --git a/firebase-app/package.json b/firebase-app/package.json deleted file mode 100644 index ad462e03f..000000000 --- a/firebase-app/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-app", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-app.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-common": "1.10.0", - "firebase": "9.19.1", - "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/androidInstrumentedTest/kotlin/dev/gitlive/firebase/firebase.kt similarity index 100% rename from firebase-app/src/androidAndroidTest/kotlin/dev/gitlive/firebase/firebase.kt rename to firebase-app/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/firebase.kt diff --git a/firebase-auth/build.gradle.kts b/firebase-auth/build.gradle.kts index 4182c951f..ef4e62cbd 100644 --- a/firebase-auth/build.gradle.kts +++ b/firebase-auth/build.gradle.kts @@ -36,8 +36,8 @@ android { manifest.srcFile("src/androidMain/AndroidManifest.xml") } getByName("androidTest") { - java.srcDir(file("src/androidAndroidTest/kotlin")) - manifest.srcFile("src/androidAndroidTest/AndroidManifest.xml") + java.srcDir(file("src/androidInstrumentedTest/kotlin")) + manifest.srcFile("src/androidInstrumentedTest/AndroidManifest.xml") } } testOptions { @@ -92,7 +92,7 @@ kotlin { } js { - useCommonJs() + useEsModules() nodejs { testTask { useKarma { @@ -133,12 +133,18 @@ kotlin { implementation(project(":firebase-common")) } } + val commonTest by getting val androidMain by getting { dependencies { api("com.google.firebase:firebase-auth") } } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } val jvmMain by getting { kotlin.srcDir("src/androidMain/kotlin") diff --git a/firebase-auth/package.json b/firebase-auth/package.json deleted file mode 100644 index fe344e504..000000000 --- a/firebase-auth/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-auth", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-auth.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-app": "1.10.0", - "firebase": "9.19.1", - "kotlin": "1.8.20", - "kotlinx-coroutines-core": "1.6.4" - } -} diff --git a/firebase-auth/src/androidAndroidTest/AndroidManifest.xml b/firebase-auth/src/androidInstrumentedTest/AndroidManifest.xml similarity index 100% rename from firebase-auth/src/androidAndroidTest/AndroidManifest.xml rename to firebase-auth/src/androidInstrumentedTest/AndroidManifest.xml diff --git a/firebase-auth/src/androidAndroidTest/kotlin/dev/gitlive/firebase/auth/auth.kt b/firebase-auth/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/auth/auth.kt similarity index 100% rename from firebase-auth/src/androidAndroidTest/kotlin/dev/gitlive/firebase/auth/auth.kt rename to firebase-auth/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/auth/auth.kt diff --git a/firebase-common/build.gradle.kts b/firebase-common/build.gradle.kts index 128fc43fc..9f8255816 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.8.20" + kotlin("plugin.serialization") version "1.9.10" } android { @@ -24,8 +24,8 @@ android { manifest.srcFile("src/androidMain/AndroidManifest.xml") } getByName("androidTest") { - java.srcDir(file("src/androidAndroidTest/kotlin")) - manifest.srcFile("src/androidAndroidTest/AndroidManifest.xml") + java.srcDir(file("src/androidInstrumentedTest/kotlin")) + manifest.srcFile("src/androidInstrumentedTest/AndroidManifest.xml") } } testOptions { @@ -70,7 +70,7 @@ kotlin { } js { - useCommonJs() + useEsModules() nodejs { testTask { useKarma { @@ -117,6 +117,11 @@ kotlin { api("com.google.firebase:firebase-common") } } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } if (supportIosTarget) { val iosMain by getting diff --git a/firebase-common/package.json b/firebase-common/package.json deleted file mode 100644 index ad254de8f..000000000 --- a/firebase-common/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-common", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-common.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-multiplatform-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-multiplatform-sdk", - "dependencies": { - "firebase": "9.19.1", - "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 77bf273b0..01d73407e 100644 --- a/firebase-config/build.gradle.kts +++ b/firebase-config/build.gradle.kts @@ -26,7 +26,7 @@ android { manifest.srcFile("src/androidMain/AndroidManifest.xml") } getByName("androidTest"){ - java.srcDir(file("src/androidAndroidTest/kotlin")) + java.srcDir(file("src/androidInstrumentedTest/kotlin")) } } testOptions { @@ -94,7 +94,7 @@ kotlin { } js { - useCommonJs() + useEsModules() browser { testTask { useKarma { @@ -120,12 +120,18 @@ kotlin { implementation(project(":firebase-common")) } } + val commonTest by getting val androidMain by getting { dependencies { api("com.google.firebase:firebase-config") } } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } val jvmMain by getting { kotlin.srcDir("src/androidMain/kotlin") diff --git a/firebase-config/package.json b/firebase-config/package.json deleted file mode 100644 index 195116866..000000000 --- a/firebase-config/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-config", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-config.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-app": "1.10.0", - "firebase": "9.19.1", - "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/androidInstrumentedTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt similarity index 100% rename from firebase-config/src/androidAndroidTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt rename to firebase-config/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/remoteconfig/RemoteConfig.kt diff --git a/firebase-crashlytics/build.gradle.kts b/firebase-crashlytics/build.gradle.kts index 38bdeee48..2e5315273 100644 --- a/firebase-crashlytics/build.gradle.kts +++ b/firebase-crashlytics/build.gradle.kts @@ -23,8 +23,8 @@ android { manifest.srcFile("src/androidMain/AndroidManifest.xml") } getByName("androidTest") { - java.srcDir(file("src/androidAndroidTest/kotlin")) - manifest.srcFile("src/androidAndroidTest/AndroidManifest.xml") + java.srcDir(file("src/androidInstrumentedTest/kotlin")) + manifest.srcFile("src/androidInstrumentedTest/AndroidManifest.xml") } } testOptions { @@ -94,12 +94,18 @@ kotlin { implementation(project(":firebase-common")) } } + val commonTest by getting val androidMain by getting { dependencies { api("com.google.firebase:firebase-crashlytics") } } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } // val jvmMain by getting { // kotlin.srcDir("src/androidMain/kotlin") diff --git a/firebase-crashlytics/package.json b/firebase-crashlytics/package.json deleted file mode 100644 index 1a32ade20..000000000 --- a/firebase-crashlytics/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-crashlytics", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-crashlytics.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-app": "1.10.0", - "firebase": "9.19.1", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" - } -} diff --git a/firebase-crashlytics/src/androidAndroidTest/AndroidManifest.xml b/firebase-crashlytics/src/androidInstrumentedTest/AndroidManifest.xml similarity index 100% rename from firebase-crashlytics/src/androidAndroidTest/AndroidManifest.xml rename to firebase-crashlytics/src/androidInstrumentedTest/AndroidManifest.xml diff --git a/firebase-crashlytics/src/androidAndroidTest/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt b/firebase-crashlytics/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt similarity index 100% rename from firebase-crashlytics/src/androidAndroidTest/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt rename to firebase-crashlytics/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt diff --git a/firebase-crashlytics/src/androidAndroidTest/res/values/strings.xml b/firebase-crashlytics/src/androidInstrumentedTest/res/values/strings.xml similarity index 100% rename from firebase-crashlytics/src/androidAndroidTest/res/values/strings.xml rename to firebase-crashlytics/src/androidInstrumentedTest/res/values/strings.xml diff --git a/firebase-database/build.gradle.kts b/firebase-database/build.gradle.kts index e3640473c..95a8e01ed 100644 --- a/firebase-database/build.gradle.kts +++ b/firebase-database/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile + /* * Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license. */ @@ -8,7 +10,7 @@ plugins { id("com.android.library") kotlin("native.cocoapods") kotlin("multiplatform") - kotlin("plugin.serialization") version "1.8.20" + kotlin("plugin.serialization") version "1.9.10" } repositories { @@ -80,8 +82,10 @@ kotlin { } js { - useCommonJs() + useEsModules() + binaries.library() nodejs { + testTask { useKarma { useChromeHeadless() @@ -97,6 +101,13 @@ kotlin { } } + // Enables ES6 classes generation + tasks.withType().configureEach { + kotlinOptions { + useEsClasses = true + } + } + sourceSets { all { languageSettings.apply { @@ -115,6 +126,7 @@ kotlin { implementation(project(":firebase-common")) } } + val commonTest by getting val androidMain by getting { dependencies { @@ -124,6 +136,11 @@ kotlin { val jvmMain by getting { kotlin.srcDir("src/androidMain/kotlin") } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } if (supportIosTarget) { val iosMain by getting diff --git a/firebase-database/package.json b/firebase-database/package.json deleted file mode 100644 index 966515c71..000000000 --- a/firebase-database/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-database", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-database.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-app": "1.10.0", - "firebase": "9.19.1", - "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/androidInstrumentedTest/kotlin/dev/gitlive/firebase/database/database.kt similarity index 100% rename from firebase-database/src/androidAndroidTest/kotlin/dev/gitlive/firebase/database/database.kt rename to firebase-database/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/database/database.kt diff --git a/firebase-database/src/jsMain/kotlin/dev/gitlive/firebase/database/externals/database.kt b/firebase-database/src/jsMain/kotlin/dev/gitlive/firebase/database/externals/database.kt index 52f71422b..a538b4c2c 100644 --- a/firebase-database/src/jsMain/kotlin/dev/gitlive/firebase/database/externals/database.kt +++ b/firebase-database/src/jsMain/kotlin/dev/gitlive/firebase/database/externals/database.kt @@ -1,6 +1,4 @@ @file:JsModule("firebase/database") -@file:JsNonModule - package dev.gitlive.firebase.database.externals import dev.gitlive.firebase.* diff --git a/firebase-firestore/build.gradle.kts b/firebase-firestore/build.gradle.kts index 46935236d..e07bfc2ed 100644 --- a/firebase-firestore/build.gradle.kts +++ b/firebase-firestore/build.gradle.kts @@ -8,7 +8,7 @@ plugins { id("com.android.library") kotlin("native.cocoapods") kotlin("multiplatform") - kotlin("plugin.serialization") version "1.8.20" + kotlin("plugin.serialization") version "1.9.10" } android { @@ -24,8 +24,8 @@ android { manifest.srcFile("src/androidMain/AndroidManifest.xml") } getByName("androidTest"){ - java.srcDir(file("src/androidAndroidTest/kotlin")) - manifest.srcFile("src/androidAndroidTest/AndroidManifest.xml") + java.srcDir(file("src/androidInstrumentedTest/kotlin")) + manifest.srcFile("src/androidInstrumentedTest/AndroidManifest.xml") } } testOptions { @@ -81,7 +81,7 @@ kotlin { } js { - useCommonJs() + useEsModules() nodejs { testTask { useKarma { @@ -127,6 +127,11 @@ kotlin { api("com.google.firebase:firebase-firestore") } } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } val jvmMain by getting { kotlin.srcDir("src/androidMain/kotlin") diff --git a/firebase-firestore/package.json b/firebase-firestore/package.json deleted file mode 100644 index dd417f8b3..000000000 --- a/firebase-firestore/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-firestore", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-firestore.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-app": "1.10.0", - "firebase": "9.19.1", - "kotlin": "1.8.20", - "kotlinx-coroutines-core": "1.6.4" - } -} diff --git a/firebase-firestore/src/androidAndroidTest/AndroidManifest.xml b/firebase-firestore/src/androidInstrumentedTest/AndroidManifest.xml similarity index 100% rename from firebase-firestore/src/androidAndroidTest/AndroidManifest.xml rename to firebase-firestore/src/androidInstrumentedTest/AndroidManifest.xml diff --git a/firebase-firestore/src/androidAndroidTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt similarity index 100% rename from firebase-firestore/src/androidAndroidTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt rename to firebase-firestore/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt diff --git a/firebase-functions/build.gradle.kts b/firebase-functions/build.gradle.kts index 4990f075b..a4ee99304 100644 --- a/firebase-functions/build.gradle.kts +++ b/firebase-functions/build.gradle.kts @@ -60,7 +60,7 @@ kotlin { } js { - useCommonJs() + useEsModules() nodejs { testTask { useKarma { @@ -102,12 +102,18 @@ kotlin { implementation(project(":firebase-common")) } } + val commonTest by getting val androidMain by getting { dependencies { api("com.google.firebase:firebase-functions") } } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } val jvmMain by getting { kotlin.srcDir("src/androidMain/kotlin") diff --git a/firebase-functions/package.json b/firebase-functions/package.json deleted file mode 100644 index e0db81fe6..000000000 --- a/firebase-functions/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-functions", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-functions.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-app": "1.10.0", - "firebase": "9.19.1", - "kotlin": "1.8.20", - "kotlinx-coroutines-core": "1.6.4" - } -} diff --git a/firebase-installations/build.gradle.kts b/firebase-installations/build.gradle.kts index 0114d7104..a19ba6ec0 100644 --- a/firebase-installations/build.gradle.kts +++ b/firebase-installations/build.gradle.kts @@ -73,7 +73,7 @@ kotlin { } js { - useCommonJs() + useEsModules() nodejs { testTask { useKarma { @@ -105,12 +105,18 @@ kotlin { implementation(project(":firebase-common")) } } + val commonTest by getting val androidMain by getting { dependencies { api("com.google.firebase:firebase-installations") } } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } val jvmMain by getting { kotlin.srcDir("src/androidMain/kotlin") diff --git a/firebase-installations/package.json b/firebase-installations/package.json deleted file mode 100644 index 94aaac8c5..000000000 --- a/firebase-installations/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-installations", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-installations.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-app": "1.10.0", - "firebase": "9.19.1", - "kotlin": "1.8.20", - "kotlinx-coroutines-core": "1.6.4" - } -} diff --git a/firebase-perf/build.gradle.kts b/firebase-perf/build.gradle.kts index 44d5785e2..b014696d2 100644 --- a/firebase-perf/build.gradle.kts +++ b/firebase-perf/build.gradle.kts @@ -23,8 +23,8 @@ android { manifest.srcFile("src/androidMain/AndroidManifest.xml") } getByName("androidTest"){ - java.srcDir(file("src/androidAndroidTest/kotlin")) - manifest.srcFile("src/androidAndroidTest/AndroidManifest.xml") + java.srcDir(file("src/androidInstrumentedTest/kotlin")) + manifest.srcFile("src/androidInstrumentedTest/AndroidManifest.xml") } } testOptions { @@ -79,7 +79,7 @@ kotlin { } js { - useCommonJs() + useEsModules() browser { testTask { useKarma { @@ -105,12 +105,18 @@ kotlin { implementation(project(":firebase-common")) } } + val commonTest by getting val androidMain by getting { dependencies { api("com.google.firebase:firebase-perf") } } + val androidInstrumentedTest by getting { + dependencies { + dependsOn(commonTest) + } + } // val jvmMain by getting { // kotlin.srcDir("src/androidMain/kotlin") diff --git a/firebase-perf/package.json b/firebase-perf/package.json deleted file mode 100644 index ac32fe16c..000000000 --- a/firebase-perf/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-perf", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-perf.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-app": "1.10.0", - "firebase": "9.19.1", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" - } -} diff --git a/firebase-perf/src/androidAndroidTest/AndroidManifest.xml b/firebase-perf/src/androidInstrumentedTest/AndroidManifest.xml similarity index 100% rename from firebase-perf/src/androidAndroidTest/AndroidManifest.xml rename to firebase-perf/src/androidInstrumentedTest/AndroidManifest.xml diff --git a/firebase-perf/src/androidAndroidTest/kotlin/dev/gitlive/firebase/perf/metrics/Trace.kt b/firebase-perf/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/perf/metrics/Trace.kt similarity index 100% rename from firebase-perf/src/androidAndroidTest/kotlin/dev/gitlive/firebase/perf/metrics/Trace.kt rename to firebase-perf/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/perf/metrics/Trace.kt diff --git a/firebase-perf/src/androidAndroidTest/kotlin/dev/gitlive/firebase/perf/performance.kt b/firebase-perf/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/perf/performance.kt similarity index 100% rename from firebase-perf/src/androidAndroidTest/kotlin/dev/gitlive/firebase/perf/performance.kt rename to firebase-perf/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/perf/performance.kt diff --git a/firebase-storage/build.gradle.kts b/firebase-storage/build.gradle.kts index c49c2d52e..66c6e8377 100644 --- a/firebase-storage/build.gradle.kts +++ b/firebase-storage/build.gradle.kts @@ -73,7 +73,7 @@ kotlin { } js { - useCommonJs() + useEsModules() nodejs { testTask { useKarma { diff --git a/firebase-storage/package.json b/firebase-storage/package.json deleted file mode 100644 index 6b757c5ec..000000000 --- a/firebase-storage/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@gitlive/firebase-storage", - "version": "1.10.0", - "description": "Wrapper around firebase for usage in Kotlin Multiplatform projects", - "main": "firebase-storage.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git" - }, - "keywords": [ - "kotlin", - "multiplatform", - "kotlin-js", - "firebase" - ], - "author": "dev.gitlive", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues" - }, - "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", - "dependencies": { - "@gitlive/firebase-app": "1.10.0", - "firebase": "9.19.1", - "kotlin": "1.6.10", - "kotlinx-coroutines-core": "1.6.1-native-mt" - } -} diff --git a/gradle.properties b/gradle.properties index 6384d22a4..ae256bcad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ android.useAndroidX=true kapt.use.worker.api=true kotlin.code.style=official kotlin.incremental.multiplatform=true -kotlin.js.compiler=both +kotlin.js.compiler=ir kotlin.js.experimental.generateKotlinExternals=false #kotlin.mpp.enableCompatibilityMetadataVariant=true #kotlin.mpp.enableGranularSourceSetsMetadata=true @@ -20,6 +20,8 @@ testOptions.unitTests.isIncludeAndroidResources=true kotlin.mpp.enableCInteropCommonization=true kotlin.native.cacheKind=none +kotlin.mpp.androidSourceSetLayoutVersion=2 + # Set to true to skip tests and even compilation of the iOS target. skipIosTarget=false # Skip iOS Tests