Skip to content

Commit 18364b3

Browse files
committed
Merge branch 'master' into refactor-web-version-9
# Conflicts: # firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt # firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals2.kt # firebase-database/src/commonTest/kotlin/dev.gitlive.firebase.database/database.kt # firebase-database/src/jsMain/kotlin/dev/gitlive/firebase/database/database.kt # firebase-database/src/jsTest/kotlin/dev.gitlive.firebase.database/database.kt
2 parents 1d36094 + b50dcf2 commit 18364b3

File tree

100 files changed

+1815
-684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1815
-684
lines changed

.github/workflows/publish.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ jobs:
2525
arguments: :updateVersions
2626
- name: Grant execute permission for gradlew
2727
run: chmod +x gradlew
28-
- name: Install Carthage
29-
run: brew install carthage
3028
- name: Publish Firebase App
3129
uses: eskatos/gradle-command-action@v1
3230
with:
@@ -94,6 +92,24 @@ jobs:
9492
uses: eskatos/gradle-command-action@v1
9593
with:
9694
arguments: :firebase-installations:publish
95+
env:
96+
sonatypeUsername: ${{ secrets.SONATYPEUSERNAME }}
97+
sonatypePassword: ${{ secrets.SONATYPEPASSWORD }}
98+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
99+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PASSPHRASE }}
100+
- name: Publish Firebase Performance
101+
uses: eskatos/gradle-command-action@v1
102+
with:
103+
arguments: :firebase-perf:publish
104+
env:
105+
sonatypeUsername: ${{ secrets.SONATYPEUSERNAME }}
106+
sonatypePassword: ${{ secrets.SONATYPEPASSWORD }}
107+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
108+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PASSPHRASE }}
109+
- name: Publish Firebase Crashlytics
110+
uses: eskatos/gradle-command-action@v1
111+
with:
112+
arguments: :firebase-crashlytics:publish
97113
env:
98114
sonatypeUsername: ${{ secrets.SONATYPEUSERNAME }}
99115
sonatypePassword: ${{ secrets.SONATYPEPASSWORD }}

.github/workflows/pull_request.yml

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,32 @@ jobs:
1111
build:
1212

1313
runs-on: macos-latest
14+
strategy:
15+
matrix:
16+
api-level: [ 29 ]
1417

1518
steps:
1619
- uses: actions/checkout@v2
20+
- name: Cocoapods cache
21+
uses: actions/cache@v3
22+
id: cocoapods-cache
23+
with:
24+
path: |
25+
~/.cocoapods
26+
~/Library/Caches/CocoaPods
27+
*/build/cocoapods
28+
*/build/classes
29+
key: cocoapods-cache
1730
- name: Set up JDK
1831
uses: actions/setup-java@v2
1932
with:
2033
distribution: 'zulu'
2134
java-version: '11'
35+
cache: gradle
36+
- name: Gradle cache
37+
uses: gradle/gradle-build-action@v2
2238
- name: Grant execute permission for gradlew
2339
run: chmod +x gradlew
24-
- name: Install Carthage
25-
run: brew list carthage || brew install carthage
2640
- name: Install Firebase tools
2741
run: npm install -g firebase-tools
2842
- name: Start Firebase emulator
@@ -45,13 +59,30 @@ jobs:
4559
with:
4660
name: "iOS Test Report HTML"
4761
path: "firebase-firestore/build/reports/tests/iosTest/"
62+
- name: AVD cache
63+
uses: actions/cache@v3
64+
id: avd-cache
65+
with:
66+
path: |
67+
~/.android/avd/*
68+
~/.android/adb*
69+
key: avd-${{ matrix.api-level }}
70+
- name: create AVD and generate snapshot for caching
71+
if: steps.avd-cache.outputs.cache-hit != 'true'
72+
uses: reactivecircus/android-emulator-runner@v2
73+
with:
74+
api-level: ${{ matrix.api-level }}
75+
force-avd-creation: false
76+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
77+
disable-animations: false
78+
script: echo "Generated AVD snapshot for caching."
4879
- name: Run Android Instrumented Tests
4980
uses: reactivecircus/android-emulator-runner@v2
5081
with:
51-
api-level: 29
52-
target: google_apis
53-
arch: x86_64
54-
profile: Nexus 6
82+
api-level: ${{ matrix.api-level }}
83+
force-avd-creation: false
84+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
85+
disable-animations: true
5586
script: ./gradlew connectedAndroidTest
5687
- name: Upload Android test artifact
5788
uses: actions/upload-artifact@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ Firebase*.zip
1818

1919
/**/nativeInterop/cinterop/Cartfile.resolved
2020
/**/nativeInterop/cinterop/Carthage/
21+
/kotlin-js-store/yarn.lock

.idea/externalDependencies.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It's API is similar
1010

1111
The following libraries are available for the various Firebase products.
1212

13-
| Service or Product | Gradle Dependency | API Coverage |
14-
|---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
15-
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.6.2`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.6.2/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-auth/src/commonMain/kotlin/dev/gitlive/firebase/auth/auth.kt) |
16-
| [Realtime Database](https://firebase.google.com/docs/database) | [`dev.gitlive:firebase-database:1.6.2`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.6.2/pom) | [![70%](https://img.shields.io/badge/-70%25-orange?style=flat-square)](/firebase-database/src/commonMain/kotlin/dev/gitlive/firebase/database/database.kt) |
17-
| [Cloud Firestore](https://firebase.google.com/docs/firestore) | [`dev.gitlive:firebase-firestore:1.6.2`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.6.2/pom) | [![60%](https://img.shields.io/badge/-60%25-orange?style=flat-square)](/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt) |
18-
| [Cloud Functions](https://firebase.google.com/docs/functions) | [`dev.gitlive:firebase-functions:1.6.2`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.6.2/pom) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-functions/src/commonMain/kotlin/dev/gitlive/firebase/functions/functions.kt) |
19-
| [Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) | [`dev.gitlive:firebase-messaging:1.6.2`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.6.2/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
20-
| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:1.6.2`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.6.2/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
21-
| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:1.6.2`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.6.2/pom) | [![90%](https://img.shields.io/badge/-90%25-green?style=flat-square)](/firebase-installations/src/commonMain/kotlin/dev/gitlive/firebase/installations/installations.kt) |
22-
| [Remote Config](https://firebase.google.com/docs/remote-config) | [`dev.gitlive:firebase-config:1.6.2`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.6.2/pom) | ![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square) |
13+
| Service or Product | Gradle Dependency | API Coverage |
14+
|---------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
15+
| [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) |
16+
| [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) |
17+
| [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) |
18+
| [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) |
19+
| [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) |
20+
| [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) |
21+
| [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) |
22+
| [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) |
23+
| [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) |
24+
| [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) |
2325

2426

2527

@@ -67,8 +69,8 @@ The Firebase Kotlin SDK uses Kotlin serialization to read and write custom class
6769

6870
```groovy
6971
plugins {
70-
kotlin("multiplatform") version "1.6.10" // or kotlin("jvm") or any other kotlin plugin
71-
kotlin("plugin.serialization") version "1.6.10"
72+
kotlin("multiplatform") version "1.8.20" // or kotlin("jvm") or any other kotlin plugin
73+
kotlin("plugin.serialization") version "1.8.20"
7274
}
7375
```
7476

@@ -201,14 +203,16 @@ If you are building a Kotlin multiplatform library which will be consumed from J
201203

202204
```json
203205
"dependencies": {
204-
"@gitlive/firebase-auth": "1.6.2",
205-
"@gitlive/firebase-config": "1.6.2",
206-
"@gitlive/firebase-database": "1.6.2",
207-
"@gitlive/firebase-firestore": "1.6.2",
208-
"@gitlive/firebase-functions": "1.6.2",
209-
"@gitlive/firebase-installations": "1.6.2",
210-
"@gitlive/firebase-messaging": "1.6.2",
211-
"@gitlive/firebase-storage": "1.6.2"
206+
"@gitlive/firebase-auth": "1.8.0",
207+
"@gitlive/firebase-config": "1.8.0",
208+
"@gitlive/firebase-database": "1.8.0",
209+
"@gitlive/firebase-firestore": "1.8.0",
210+
"@gitlive/firebase-functions": "1.8.0",
211+
"@gitlive/firebase-installations": "1.8.0",
212+
"@gitlive/firebase-messaging": "1.8.0",
213+
"@gitlive/firebase-storage": "1.8.0"
214+
"@gitlive/firebase-perf": "1.8.0"
215+
"@gitlive/firebase-crashlytics": "1.8.0"
212216
}
213217
```
214218

build.gradle.kts

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ import org.apache.tools.ant.taskdefs.condition.Os
22
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
33
import org.gradle.api.tasks.testing.logging.TestLogEvent
44

5+
repositories {
6+
google()
7+
mavenCentral()
8+
}
9+
510
plugins {
6-
kotlin("multiplatform") version "1.6.10" apply false
11+
kotlin("multiplatform") version "1.8.20" apply false
12+
kotlin("native.cocoapods") version "1.8.20" apply false
713
id("base")
814
id("com.github.ben-manes.versions") version "0.42.0"
915
}
@@ -18,7 +24,8 @@ buildscript {
1824
}
1925
}
2026
dependencies {
21-
classpath("com.android.tools.build:gradle:7.2.0")
27+
classpath("com.android.tools.build:gradle:7.2.2")
28+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20-RC")
2229
classpath("com.adarshr:gradle-test-logger-plugin:3.2.0")
2330
}
2431
}
@@ -36,7 +43,8 @@ tasks {
3643
"firebase-database:updateVersion", "firebase-database:updateDependencyVersion",
3744
"firebase-firestore:updateVersion", "firebase-firestore:updateDependencyVersion",
3845
"firebase-functions:updateVersion", "firebase-functions:updateDependencyVersion",
39-
"firebase-installations:updateVersion", "firebase-installations:updateDependencyVersion"
46+
"firebase-installations:updateVersion", "firebase-installations:updateDependencyVersion",
47+
"firebase-perf:updateVersion", "firebase-perf:updateDependencyVersion"
4048
)
4149
}
4250
}
@@ -57,16 +65,6 @@ subprojects {
5765
onlyIf { !project.gradle.startParameter.taskNames.contains("publishToMavenLocal") }
5866
}
5967

60-
tasks.whenTaskAdded {
61-
enabled = when(name) {
62-
"compileDebugUnitTestKotlinAndroid" -> false
63-
"compileReleaseUnitTestKotlinAndroid" -> false
64-
"testDebugUnitTest" -> false
65-
"testReleaseUnitTest" -> false
66-
else -> enabled
67-
}
68-
}
69-
7068
tasks {
7169

7270
val updateVersion by registering(Exec::class) {
@@ -156,36 +154,6 @@ subprojects {
156154
)
157155
}
158156
}
159-
160-
val carthageTasks = if (projectDir.resolve("src/nativeInterop/cinterop/Cartfile").exists()) { // skipping firebase-common module
161-
listOf("bootstrap", "update").map {
162-
task<Exec>("carthage${it.capitalize()}") {
163-
group = "carthage"
164-
executable = "carthage"
165-
args(
166-
it,
167-
"--project-directory", projectDir.resolve("src/nativeInterop/cinterop"),
168-
"--platform", "iOS"
169-
)
170-
}
171-
}
172-
} else emptyList()
173-
174-
if (Os.isFamily(Os.FAMILY_MAC)) {
175-
withType(org.jetbrains.kotlin.gradle.tasks.CInteropProcess::class) {
176-
if (carthageTasks.isNotEmpty()) {
177-
dependsOn("carthageBootstrap")
178-
}
179-
}
180-
}
181-
182-
create("carthageClean", Delete::class.java) {
183-
group = "carthage"
184-
delete(
185-
projectDir.resolve("src/nativeInterop/cinterop/Carthage"),
186-
projectDir.resolve("src/nativeInterop/cinterop/Cartfile.resolved")
187-
)
188-
}
189157
}
190158

191159
afterEvaluate {
@@ -194,18 +162,17 @@ subprojects {
194162
mkdir("$buildDir/node_module")
195163
}
196164

197-
tasks.named<Delete>("clean") {
198-
dependsOn("carthageClean")
199-
}
200-
201165
dependencies {
202-
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1-native-mt")
203-
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.1-native-mt")
204-
"androidMainImplementation"(platform("com.google.firebase:firebase-bom:29.3.0"))
166+
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
167+
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4")
168+
"androidMainImplementation"(platform("com.google.firebase:firebase-bom:31.4.0"))
205169
"commonTestImplementation"(kotlin("test-common"))
206170
"commonTestImplementation"(kotlin("test-annotations-common"))
207-
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1-native-mt")
208-
"jsTestImplementation"(kotlin("test-js"))
171+
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
172+
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4")
173+
if (this@afterEvaluate.name != "firebase-crashlytics") {
174+
"jsTestImplementation"(kotlin("test-js"))
175+
}
209176
"androidAndroidTestImplementation"(kotlin("test-junit"))
210177
"androidAndroidTestImplementation"("junit:junit:4.13.2")
211178
"androidAndroidTestImplementation"("androidx.test:core:1.4.0")

0 commit comments

Comments
 (0)