Skip to content

Commit

Permalink
Merge branch 'master' into feature/gitlive-master-tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Daeda88 committed Aug 29, 2024
2 parents f6e4393 + 0c6f408 commit 53ad156
Show file tree
Hide file tree
Showing 146 changed files with 1,064 additions and 942 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup_test_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
shell: bash
run: npm update
- name: Gradle cache
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v4
- name: Grant execute permission for gradlew
shell: bash
run: chmod +x gradlew
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
distribution: 'zulu'
java-version: '17'
- uses: gradle/gradle-build-action@v2
- uses: gradle/actions/setup-gradle@v4
- name: Setup versions
run: ./gradlew :updateVersions
- name: Grant execute permission for gradlew
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
with:
distribution: 'zulu'
java-version: '17'
- uses: gradle/gradle-build-action@v2
- uses: gradle/gradle-build-action@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Generate documentation
Expand Down
75 changes: 57 additions & 18 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,26 @@ on:
branches: [ master, prerelease ]

jobs:
jobEmulatorMatrixSetup:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: ktLint
run: ./gradlew lintKotlin
- name: run apiCheck
run: ./gradlew apiCheck
jobMatrixSetup:
runs-on: ubuntu-latest
outputs:
emulator_jobs_matrix: ${{ steps.dataStep.outputs.emulator_jobs_matrix }}
ios_test_jobs_matrix: ${{ steps.dataStep.outputs.ios_test_jobs_matrix }}
js_test_jobs_matrix: ${{ steps.dataStep.outputs.js_test_jobs_matrix }}
jvm_test_jobs_matrix: ${{ steps.dataStep.outputs.jvm_test_jobs_matrix }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
Expand All @@ -21,15 +37,21 @@ jobs:
java-version: '17'
cache: gradle
- name: Prepare the matrix JSON
run: ./gradlew ciEmulatorJobsMatrixSetup
run: ./gradlew ciJobsMatrixSetup
- id: dataStep
run: echo "emulator_jobs_matrix=$(jq -c . < ./build/emulator_jobs_matrix.json)" >> $GITHUB_OUTPUT
run: |
echo "
emulator_jobs_matrix=$(jq -c . < ./build/emulator_jobs_matrix.json)
ios_test_jobs_matrix=$(jq -c . < ./build/ios_test_jobs_matrix.json)
js_test_jobs_matrix=$(jq -c . < ./build/js_test_jobs_matrix.json)
jvm_test_jobs_matrix=$(jq -c . < ./build/jvm_test_jobs_matrix.json)
" >> $GITHUB_OUTPUT
build-android:
needs: jobEmulatorMatrixSetup
needs: jobMatrixSetup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.jobEmulatorMatrixSetup.outputs.emulator_jobs_matrix) }}
matrix: ${{ fromJson(needs.jobMatrixSetup.outputs.emulator_jobs_matrix) }}
steps:
- uses: actions/checkout@v4
- name: Enable KVM group perms
Expand Down Expand Up @@ -59,19 +81,26 @@ jobs:
name: Android ${{ env.ARCHIVE_KEY }} Firebase Debug Log
path: "**/firebase-debug.log"
build-js:
needs: jobMatrixSetup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.jobMatrixSetup.outputs.js_test_jobs_matrix) }}
steps:
- uses: actions/checkout@v4
- name: Setup test environment
uses: ./.github/actions/setup_test_action
timeout-minutes: 10
- name: Set Artifact Name
run: |
echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
- name: Run JS Tests
run: ./gradlew cleanTest jsTest
run: ./gradlew ${{ matrix.gradle_tasks }}
- name: Upload JS test artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: "JS Test Report HTML"
name: JS ${{ env.ARCHIVE_KEY }} Test Report HTML
path: |
**/build/reports/tests/jsTest/
**/build/reports/tests/jsBrowserTest/
Expand All @@ -80,10 +109,14 @@ jobs:
uses: actions/upload-artifact@v4
if: failure()
with:
name: "JS Firebase Debug Log"
name: JS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
path: "**/firebase-debug.log"
build-ios:
needs: jobMatrixSetup
runs-on: macos-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.jobMatrixSetup.outputs.ios_test_jobs_matrix) }}
steps:
- uses: actions/checkout@v4
- name: Cocoapods cache
Expand All @@ -97,43 +130,49 @@ jobs:
key: cocoapods-cache-v2
- name: Setup test environment
uses: ./.github/actions/setup_test_action
- name: ktLint
run: ./gradlew lintKotlin
- name: Set Artifact Name
run: |
echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
- name: Run iOS Tests
run: ./gradlew cleanTest iosSimulatorArm64Test
run: ./gradlew ${{ matrix.gradle_tasks }}
- name: Upload iOS test artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: "iOS Test Report HTML"
name: iOS ${{ env.ARCHIVE_KEY }} Test Report HTML
path: "**/build/reports/tests/iosSimulatorArm64Test/"
- name: Upload Firebase Debug Log
uses: actions/upload-artifact@v4
if: failure()
with:
name: "iOS Firebase Debug Log"
name: iOS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
path: "**/firebase-debug.log"
build-jvm:
needs: jobMatrixSetup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.jobMatrixSetup.outputs.jvm_test_jobs_matrix) }}
steps:
- uses: actions/checkout@v4
- name: Setup test environment
uses: ./.github/actions/setup_test_action
timeout-minutes: 10
- name: run apiCheck
run: ./gradlew apiCheck
- name: Set Artifact Name
run: |
echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
- name: Run JVM Tests
run: ./gradlew cleanTest jvmTest
run: ./gradlew ${{ matrix.gradle_tasks }}
- name: Upload JVM test artifact
uses: actions/upload-artifact@v4
if: failure()
with:
name: "JVM Test Report HTML"
name: JVM ${{ env.ARCHIVE_KEY }} Test Report HTML
path: |
**/build/reports/tests/jvmTest/
- name: Upload Firebase Debug Log
uses: actions/upload-artifact@v4
if: failure()
with:
name: "JVM Firebase Debug Log"
name: JVM ${{ env.ARCHIVE_KEY }} Firebase Debug Log
path: "**/firebase-debug.log"
23 changes: 23 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Push

on: [ push ]

jobs:
formatKotlin:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: formatKotlin
run: ./gradlew formatKotlin
- uses: stefanzweifel/git-auto-commit-action@v5
- name: lintKotlin
run: ./gradlew lintKotlin
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ The following libraries are available for the various Firebase products.

| Service or Product | Gradle Dependency | API Coverage |
|---------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |
| [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/-10%25-orange?style=flat-square)](/firebase-messaging/src/commonMain/kotlin/dev/gitlive/firebase/messaging/messaging.kt) |
| [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) |
| [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) |
| [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) |
| [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/-10%25-orange?style=flat-square)](/firebase-perf/src/commonMain/kotlin/dev/gitlive/firebase/perf/performance.kt) |
| [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/-10%25-orange?style=flat-square)](/firebase-crashlytics/src/commonMain/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt) |
| [Analytics](https://firebase.google.com/docs/analytics) | [`dev.gitlive:firebase-analytics:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-analytics/2.0.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) |
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/2.0.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:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/2.0.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:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/2.0.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:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/2.0.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:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/2.0.0/pom) | [![1%](https://img.shields.io/badge/-10%25-orange?style=flat-square)](/firebase-messaging/src/commonMain/kotlin/dev/gitlive/firebase/messaging/messaging.kt) |
| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/2.0.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) |
| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/2.0.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:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-config/2.0.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) |
| [Performance](https://firebase.google.com/docs/perf-mon) | [`dev.gitlive:firebase-perf:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/2.0.0/pom) | [![1%](https://img.shields.io/badge/-10%25-orange?style=flat-square)](/firebase-perf/src/commonMain/kotlin/dev/gitlive/firebase/perf/performance.kt) |
| [Crashlytics](https://firebase.google.com/docs/crashlytics) | [`dev.gitlive:firebase-crashlytics:2.0.0`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/2.0.0/pom) | [![80%](https://img.shields.io/badge/-10%25-orange?style=flat-square)](/firebase-crashlytics/src/commonMain/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt) |

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)

Expand Down Expand Up @@ -268,7 +268,7 @@ It uses the <a href="https://github.com/GitLiveApp/firebase-java-sdk">Firebase J

### Accessing the underlying Firebase SDK

In some cases you might want to access the underlying official Firebase SDK in platform specific code, for example when the common API is missing the functionality you need. For this purpose each class in the SDK has `android`, `ios` and `js` properties which holds the equivalent object of the underlying official Firebase SDK. For *JVM*, as the `firebase-java-sdk` is a direct port of the Firebase Android SDK, is it also accessed via the `android` property.
In some cases you might want to access the underlying official Firebase SDK in platform specific code, for example when the common API is missing the functionality you need. For this purpose each class in the SDK has `android`, `ios` and `js` extension properties that hold the equivalent object of the underlying official Firebase SDK. For *JVM*, as the `firebase-java-sdk` is a direct port of the Firebase Android SDK, is it also accessed via the `android` property.

These properties are only accessible from the equivalent target's source set. For example to disable persistence in Cloud Firestore on Android you can write the following in your Android specific code (e.g. `androidMain` or `androidTest`):

Expand Down
Loading

0 comments on commit 53ad156

Please sign in to comment.