Skip to content

Commit 470fcc4

Browse files
committed
Merge branch 'feature/kotlin-2.0' into feature/api-validation
2 parents 28fc8d4 + 5a06df6 commit 470fcc4

File tree

133 files changed

+3802
-569
lines changed

Some content is hidden

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

133 files changed

+3802
-569
lines changed

.github/actions/setup_test_action/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ runs:
55
using: "composite"
66
steps:
77
- name: Set up JDK
8-
uses: actions/setup-java@v3
8+
uses: actions/setup-java@v4
99
with:
1010
distribution: 'zulu'
1111
java-version: '17'

.github/workflows/publish.yml

+34-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
build:
1818
runs-on: macos-14
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- name: Set up JDK
22-
uses: actions/setup-java@v3
22+
uses: actions/setup-java@v4
2323
with:
2424
distribution: 'zulu'
2525
java-version: '17'
@@ -28,12 +28,16 @@ jobs:
2828
run: ./gradlew :updateVersions
2929
- name: Grant execute permission for gradlew
3030
run: chmod +x gradlew
31+
- name: Publish Firebase Analytics
32+
run: ./gradlew :firebase-analytics:publish
3133
- name: Publish Firebase App
3234
run: ./gradlew :firebase-app:publish
3335
- name: Publish Firebase Auth
3436
run: ./gradlew :firebase-auth:publish
3537
- name: Publish Firebase Common
3638
run: ./gradlew :firebase-common:publish
39+
- name: Publish Firebase Common Internal
40+
run: ./gradlew :firebase-common-internal:publish
3741
- name: Publish Firebase Config
3842
run: ./gradlew :firebase-config:publish
3943
- name: Publish Firebase Database
@@ -42,11 +46,38 @@ jobs:
4246
run: ./gradlew :firebase-firestore:publish
4347
- name: Publish Firebase Functions
4448
run: ./gradlew :firebase-functions:publish
49+
- name: Publish Firebase Messaging
50+
run: ./gradlew :firebase-messaging:publish
4551
- name: Publish Firebase Storage
4652
run: ./gradlew :firebase-storage:publish
4753
- name: Publish Firebase Installations
4854
run: ./gradlew :firebase-installations:publish
4955
- name: Publish Firebase Performance
5056
run: ./gradlew :firebase-perf:publish
5157
- name: Publish Firebase Crashlytics
52-
run: ./gradlew :firebase-crashlytics:publish
58+
run: ./gradlew :firebase-crashlytics:publish
59+
documentation:
60+
runs-on: macos-13
61+
steps:
62+
- uses: actions/checkout@v4
63+
- name: Set up JDK
64+
uses: actions/setup-java@v4
65+
with:
66+
distribution: 'zulu'
67+
java-version: '17'
68+
- uses: gradle/gradle-build-action@v2
69+
- name: Grant execute permission for gradlew
70+
run: chmod +x gradlew
71+
- name: Generate documentation
72+
run: ./gradlew dokkaHtmlMultiModule
73+
- name: Uploading build folder
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: artefact
77+
path: build/dokka/htmlMultiModule
78+
- name: Deploy API documentation to Github Pages
79+
uses: JamesIves/github-pages-deploy-action@v4
80+
with:
81+
branch: gh-pages
82+
folder: build/dokka/htmlMultiModule
83+
target-folder: docs

.github/workflows/pull_request.yml

+41-46
Original file line numberDiff line numberDiff line change
@@ -8,71 +8,66 @@ on:
88
branches: [ master ]
99

1010
jobs:
11+
jobEmulatorMatrixSetup:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
emulator_jobs_matrix: ${{ steps.dataStep.outputs.emulator_jobs_matrix }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up JDK
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: 'zulu'
21+
java-version: '17'
22+
cache: gradle
23+
- name: Prepare the matrix JSON
24+
run: ./gradlew ciEmulatorJobsMatrixSetup
25+
- id: dataStep
26+
run: echo "emulator_jobs_matrix=$(jq -c . < ./build/emulator_jobs_matrix.json)" >> $GITHUB_OUTPUT
1127
build-android:
12-
runs-on: macos-13
28+
needs: jobEmulatorMatrixSetup
29+
runs-on: ubuntu-latest
1330
strategy:
14-
matrix:
15-
api-level: [ 34 ]
31+
fail-fast: false
32+
matrix: ${{ fromJson(needs.jobEmulatorMatrixSetup.outputs.emulator_jobs_matrix) }}
1633
steps:
17-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
35+
- name: Enable KVM group perms
36+
run: |
37+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
38+
sudo udevadm control --reload-rules
39+
sudo udevadm trigger --name-match=kvm
1840
- name: Setup test environment
1941
uses: ./.github/actions/setup_test_action
2042
- name: run apiCheck
2143
run: ./gradlew apiCheck
22-
- name: AVD cache
23-
uses: actions/cache@v3
24-
id: avd-cache
25-
with:
26-
path: |
27-
~/.android/avd/*
28-
~/.android/adb*
29-
key: avd-${{ matrix.api-level }}-${{ runner.os }}-${{ runner.arch }}
30-
- name: create AVD and generate snapshot for caching
31-
if: steps.avd-cache.outputs.cache-hit != 'true'
32-
uses: reactivecircus/android-emulator-runner@v2
33-
with:
34-
api-level: ${{ matrix.api-level }}
35-
arch: x86_64
36-
target: google_apis
37-
avd-name: pixel6_API${{ matrix.api-level }}
38-
force-avd-creation: false
39-
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
40-
disable-animations: false
41-
script: echo "Generated AVD snapshot for caching."
44+
- name: Apply Android licenses
45+
run: ./gradlew ciSdkManagerLicenses
4246
- name: Run Android Instrumented Tests
43-
uses: reactivecircus/android-emulator-runner@v2
44-
with:
45-
api-level: ${{ matrix.api-level }}
46-
arch: x86_64
47-
target: google_apis
48-
avd-name: pixel6_API${{ matrix.api-level }}
49-
force-avd-creation: false
50-
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
51-
disable-animations: true
52-
script: ./gradlew connectedAndroidTest
47+
run: ./gradlew ${{ matrix.gradle_tasks }}
5348
- name: Upload Android test artifact
54-
uses: actions/upload-artifact@v3
49+
uses: actions/upload-artifact@v4
5550
if: failure()
5651
with:
5752
name: "Android Test Report HTML"
5853
path: "**/build/reports/androidTests/"
5954
- name: Upload Firebase Debug Log
60-
uses: actions/upload-artifact@v3
55+
uses: actions/upload-artifact@v4
6156
if: failure()
6257
with:
6358
name: "Firebase Debug Log"
6459
path: "**/firebase-debug.log"
6560
build-js:
6661
runs-on: ubuntu-latest
6762
steps:
68-
- uses: actions/checkout@v3
63+
- uses: actions/checkout@v4
6964
- name: Setup test environment
7065
uses: ./.github/actions/setup_test_action
7166
timeout-minutes: 10
7267
- name: Run JS Tests
7368
run: ./gradlew cleanTest jsTest
7469
- name: Upload JS test artifact
75-
uses: actions/upload-artifact@v3
70+
uses: actions/upload-artifact@v4
7671
if: failure()
7772
with:
7873
name: "JS Test Report HTML"
@@ -81,17 +76,17 @@ jobs:
8176
**/build/reports/tests/jsBrowserTest/
8277
**/build/reports/tests/jsNodeTest/
8378
- name: Upload Firebase Debug Log
84-
uses: actions/upload-artifact@v3
79+
uses: actions/upload-artifact@v4
8580
if: failure()
8681
with:
8782
name: "Firebase Debug Log"
8883
path: "**/firebase-debug.log"
8984
build-ios:
9085
runs-on: macos-14
9186
steps:
92-
- uses: actions/checkout@v3
87+
- uses: actions/checkout@v4
9388
- name: Cocoapods cache
94-
uses: actions/cache@v3
89+
uses: actions/cache@v4
9590
with:
9691
path: |
9792
~/.cocoapods
@@ -106,35 +101,35 @@ jobs:
106101
- name: Run iOS Tests
107102
run: ./gradlew cleanTest iosSimulatorArm64Test
108103
- name: Upload iOS test artifact
109-
uses: actions/upload-artifact@v3
104+
uses: actions/upload-artifact@v4
110105
if: failure()
111106
with:
112107
name: "iOS Test Report HTML"
113108
path: "**/build/reports/tests/iosSimulatorArm64Test/"
114109
- name: Upload Firebase Debug Log
115-
uses: actions/upload-artifact@v3
110+
uses: actions/upload-artifact@v4
116111
if: failure()
117112
with:
118113
name: "Firebase Debug Log"
119114
path: "**/firebase-debug.log"
120115
build-jvm:
121116
runs-on: ubuntu-latest
122117
steps:
123-
- uses: actions/checkout@v3
118+
- uses: actions/checkout@v4
124119
- name: Setup test environment
125120
uses: ./.github/actions/setup_test_action
126121
timeout-minutes: 10
127122
- name: Run JVM Tests
128123
run: ./gradlew cleanTest jvmTest
129124
- name: Upload JVM test artifact
130-
uses: actions/upload-artifact@v3
125+
uses: actions/upload-artifact@v4
131126
if: failure()
132127
with:
133128
name: "JVM Test Report HTML"
134129
path: |
135130
**/build/reports/tests/jvmTest/
136131
- name: Upload Firebase Debug Log
137-
uses: actions/upload-artifact@v3
132+
uses: actions/upload-artifact@v4
138133
if: failure()
139134
with:
140135
name: "Firebase Debug Log"

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Project exclude paths
2-
/.gradle/
2+
/**/.gradle/
33
/**/build/
44
/.idea/
55
local.properties

README.md

+29-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1 align="left">Firebase Kotlin SDK <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/gitliveapp/firebase-kotlin-sdk?style=flat-square"> <a href="https://git.live"><img src="https://img.shields.io/badge/collaborate-on%20gitlive-blueviolet?style=flat-square"></a></h1>
1+
<h1 align="left">Firebase Kotlin SDK <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/gitliveapp/firebase-kotlin-sdk?style=flat-square"> <a href="https://git.live"><img src="https://img.shields.io/badge/GitLive-45_active_forks-blueviolet?style=flat-square"></a></h1>
22
<img align="left" width="75px" src="https://avatars2.githubusercontent.com/u/42865805?s=200&v=4">
33
<b>Built and maintained with 🧡 by <a href="https://git.live">GitLive</a></b><br/>
44
<i>Development teams merge faster with GitLive</i><br/>
@@ -16,16 +16,17 @@ The following libraries are available for the various Firebase products.
1616

1717
| Service or Product | Gradle Dependency | API Coverage |
1818
|---------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
19-
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.12.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) |
20-
| [Realtime Database](https://firebase.google.com/docs/database) | [`dev.gitlive:firebase-database:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.12.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) |
21-
| [Cloud Firestore](https://firebase.google.com/docs/firestore) | [`dev.gitlive:firebase-firestore:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.12.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) |
22-
| [Cloud Functions](https://firebase.google.com/docs/functions) | [`dev.gitlive:firebase-functions:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.12.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) |
23-
| [Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) | [`dev.gitlive:firebase-messaging:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.12.0/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
24-
| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.12.0/pom) | [![40%](https://img.shields.io/badge/-40%25-orange?style=flat-square)](/firebase-storage/src/commonMain/kotlin/dev/gitlive/firebase/storage/storage.kt) |
25-
| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.12.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) |
26-
| [Remote Config](https://firebase.google.com/docs/remote-config) | [`dev.gitlive:firebase-config:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.12.0/pom) | [![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square)](/firebase-config/src/commonMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt) |
27-
| [Performance](https://firebase.google.com/docs/perf-mon) | [`dev.gitlive:firebase-perf:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/1.12.0/pom) | [![1%](https://img.shields.io/badge/-1%25-orange?style=flat-square)](/firebase-perf/src/commonMain/kotlin/dev/gitlive/firebase/perf/performance.kt) |
28-
| [Crashlytics](https://firebase.google.com/docs/crashlytics) | [`dev.gitlive:firebase-crashlytics:1.12.0`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/1.12.0/pom) | [![80%](https://img.shields.io/badge/-1%25-orange?style=flat-square)](/firebase-crashlytics/src/commonMain/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt) |
19+
| [Analytics](https://firebase.google.com/docs/analytics) | [`dev.gitlive:firebase-analytics:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-analytics/1.13.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) |
20+
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.13.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) |
21+
| [Realtime Database](https://firebase.google.com/docs/database) | [`dev.gitlive:firebase-database:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.13.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) |
22+
| [Cloud Firestore](https://firebase.google.com/docs/firestore) | [`dev.gitlive:firebase-firestore:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.13.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) |
23+
| [Cloud Functions](https://firebase.google.com/docs/functions) | [`dev.gitlive:firebase-functions:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.13.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) |
24+
| [Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) | [`dev.gitlive:firebase-messaging:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.13.0/pom) | [![1%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square)](/firebase-messaging/src/commonMain/kotlin/dev/gitlive/firebase/messaging/messaging.kt) |
25+
| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.13.0/pom) | [![40%](https://img.shields.io/badge/-40%25-orange?style=flat-square)](/firebase-storage/src/commonMain/kotlin/dev/gitlive/firebase/storage/storage.kt) |
26+
| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.13.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) |
27+
| [Remote Config](https://firebase.google.com/docs/remote-config) | [`dev.gitlive:firebase-config:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.13.0/pom) | [![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square)](/firebase-config/src/commonMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt) |
28+
| [Performance](https://firebase.google.com/docs/perf-mon) | [`dev.gitlive:firebase-perf:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/1.13.0/pom) | [![1%](https://img.shields.io/badge/-1%25-orange?style=flat-square)](/firebase-perf/src/commonMain/kotlin/dev/gitlive/firebase/perf/performance.kt) |
29+
| [Crashlytics](https://firebase.google.com/docs/crashlytics) | [`dev.gitlive:firebase-crashlytics:1.13.0`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/1.13.0/pom) | [![80%](https://img.shields.io/badge/-1%25-orange?style=flat-square)](/firebase-crashlytics/src/commonMain/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt) |
2930

3031
Is the Firebase library or API you need missing? [Create an issue](https://github.com/GitLiveApp/firebase-kotlin-sdk/issues/new?labels=API+coverage&template=increase-api-coverage.md&title=Add+%5Bclass+name%5D.%5Bfunction+name%5D+to+%5Blibrary+name%5D+for+%5Bplatform+names%5D) to request additional API coverage or be awesome and [submit a PR](https://github.com/GitLiveApp/firebase-kotlin-sdk/fork)
3132

@@ -287,6 +288,23 @@ You can build and test the project locally.
287288
3. Install the GitLive plugin into IntelliJ
288289
4. After a gradle sync then run `publishToMavenLocal`
289290

291+
### Testing
292+
To run the tests you can use the following gradle tasks:
293+
294+
`./gradlew connectedAndroidTest` (an emulator needs to be running)
295+
296+
`./gradlew iosSimulatorArm64Test`
297+
298+
`./gradlew jsNodeTest`
299+
300+
For some tests you need to have the firebase emulator suite running. After installing them you can run the following command inside the `test` directory:
301+
302+
`firebase emulators:start`
303+
304+
### Documentation
305+
For every publicly available class or function there needs to be documentation written in the [KDoc syntax](https://kotlinlang.org/docs/kotlin-doc.html).
306+
We publish a new version of the documentation after every release and can be found [here](https://gitliveapp.github.io/firebase-kotlin-sdk/)
307+
290308
### Compatibility with the official [Firebase Android SDK](https://github.com/firebase/firebase-android-sdk)
291309

292310
When this project began, the official Firebase Android SDK was a pure java library and the separate Kotlin extensions (KTX) module consisted of only a few extensions providing some syntactic sugar, for example `Firebase.firestore` instead of `Firebase.getInstance(),` which we naturally copied for the Firebase Kotlin SDK.

0 commit comments

Comments
 (0)