Skip to content

Commit 69848e5

Browse files
committed
Merge pull request #64 from splendo/feature/kotlin-1.9.20
Support Kotlin 1.9.20
1 parent 5dd6145 commit 69848e5

File tree

63 files changed

+675
-392
lines changed

Some content is hidden

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

63 files changed

+675
-392
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Setup Tests'
2+
description: 'Prepares to run tests on Firebase emulator'
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Set up JDK
8+
uses: actions/setup-java@v3
9+
with:
10+
distribution: 'zulu'
11+
java-version: '17'
12+
cache: gradle
13+
- name: Set up Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: '21.x'
17+
- name: Upgrade packages
18+
shell: bash
19+
run: npm update
20+
- name: Gradle cache
21+
uses: gradle/gradle-build-action@v2
22+
- name: Grant execute permission for gradlew
23+
shell: bash
24+
run: chmod +x gradlew
25+
- name: Install Firebase tools
26+
shell: bash
27+
run: npm install -g firebase-tools
28+
- name: Start Firebase emulator
29+
shell: bash
30+
run: "firebase emulators:start --config=./test/firebase.json &"

.github/workflows/pull_request.yml

Lines changed: 71 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,71 +8,36 @@ on:
88
branches: [ master ]
99

1010
jobs:
11-
build:
12-
runs-on: macos-13
11+
build-android:
12+
runs-on: 4-core-ubuntu
1313
strategy:
1414
matrix:
1515
api-level: [ 34 ]
1616
steps:
1717
- uses: actions/checkout@v3
18-
- name: Cocoapods cache
19-
uses: actions/cache@v3
20-
id: cocoapods-cache
21-
with:
22-
path: |
23-
~/.cocoapods
24-
~/Library/Caches/CocoaPods
25-
*/build/cocoapods
26-
*/build/classes
27-
key: cocoapods-cache
28-
- name: Set up JDK
29-
uses: actions/setup-java@v3
30-
with:
31-
distribution: 'zulu'
32-
java-version: '17'
33-
cache: gradle
34-
- name: Gradle cache
35-
uses: gradle/gradle-build-action@v2
36-
- name: Grant execute permission for gradlew
37-
run: chmod +x gradlew
38-
- name: Install Firebase tools
39-
run: npm install -g firebase-tools
40-
- name: Start Firebase emulator
41-
run: "firebase emulators:start --config=./test/firebase.json &"
42-
- name: Run JS Tests
43-
run: ./gradlew cleanTest jsTest
44-
- name: Upload JS test artifact
45-
uses: actions/upload-artifact@v3
46-
if: failure()
47-
with:
48-
name: "JS Test Report HTML"
49-
path: |
50-
**/build/reports/tests/jsTest/
51-
**/build/reports/tests/jsBrowserTest/
52-
**/build/reports/tests/jsNodeTest/
53-
- name: Run iOS Tests
54-
run: ./gradlew cleanTest iosX64Test
55-
- name: Upload iOS test artifact
56-
uses: actions/upload-artifact@v3
57-
if: failure()
58-
with:
59-
name: "iOS Test Report HTML"
60-
path: "**/build/reports/tests/iosX64Test/"
18+
- name: Enable KVM group perms
19+
run: |
20+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
21+
sudo udevadm control --reload-rules
22+
sudo udevadm trigger --name-match=kvm
23+
- name: Setup test environment
24+
uses: ./.github/actions/setup_test_action
6125
- name: AVD cache
6226
uses: actions/cache@v3
6327
id: avd-cache
6428
with:
6529
path: |
6630
~/.android/avd/*
6731
~/.android/adb*
68-
key: avd-${{ matrix.api-level }}
32+
key: avd-${{ matrix.api-level }}-${{ runner.os }}-${{ runner.arch }}
6933
- name: create AVD and generate snapshot for caching
7034
if: steps.avd-cache.outputs.cache-hit != 'true'
7135
uses: reactivecircus/android-emulator-runner@v2
7236
with:
7337
api-level: ${{ matrix.api-level }}
7438
arch: x86_64
7539
target: google_apis
40+
avd-name: pixel6_API${{ matrix.api-level }}
7641
force-avd-creation: false
7742
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
7843
disable-animations: false
@@ -83,6 +48,7 @@ jobs:
8348
api-level: ${{ matrix.api-level }}
8449
arch: x86_64
8550
target: google_apis
51+
avd-name: pixel6_API${{ matrix.api-level }}
8652
force-avd-creation: false
8753
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
8854
disable-animations: true
@@ -93,3 +59,62 @@ jobs:
9359
with:
9460
name: "Android Test Report HTML"
9561
path: "**/build/reports/androidTests/"
62+
- name: Upload Firebase Debug Log
63+
uses: actions/upload-artifact@v3
64+
if: failure()
65+
with:
66+
name: "Firebase Debug Log"
67+
path: "**/firebase-debug.log"
68+
build-js:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v3
72+
- name: Setup test environment
73+
uses: ./.github/actions/setup_test_action
74+
- name: Run JS Tests
75+
run: ./gradlew cleanTest jsTest
76+
- name: Upload JS test artifact
77+
uses: actions/upload-artifact@v3
78+
if: failure()
79+
with:
80+
name: "JS Test Report HTML"
81+
path: |
82+
**/build/reports/tests/jsTest/
83+
**/build/reports/tests/jsBrowserTest/
84+
**/build/reports/tests/jsNodeTest/
85+
- name: Upload Firebase Debug Log
86+
uses: actions/upload-artifact@v3
87+
if: failure()
88+
with:
89+
name: "Firebase Debug Log"
90+
path: "**/firebase-debug.log"
91+
build-ios:
92+
runs-on: macos-13
93+
steps:
94+
- uses: actions/checkout@v3
95+
- name: Cocoapods cache
96+
uses: actions/cache@v3
97+
id: cocoapods-cache
98+
with:
99+
path: |
100+
~/.cocoapods
101+
~/Library/Caches/CocoaPods
102+
*/build/cocoapods
103+
*/build/classes
104+
key: cocoapods-cache
105+
- name: Setup test environment
106+
uses: ./.github/actions/setup_test_action
107+
- name: Run iOS Tests
108+
run: ./gradlew cleanTest iosX64Test
109+
- name: Upload iOS test artifact
110+
uses: actions/upload-artifact@v3
111+
if: failure()
112+
with:
113+
name: "iOS Test Report HTML"
114+
path: "**/build/reports/tests/iosX64Test/"
115+
- name: Upload Firebase Debug Log
116+
uses: actions/upload-artifact@v3
117+
if: failure()
118+
with:
119+
name: "Firebase Debug Log"
120+
path: "**/firebase-debug.log"

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ Firebase as a backend for <a href="https://www.jetbrains.com/lp/compose-multipla
1414

1515
The following libraries are available for the various Firebase products.
1616

17-
| Service or Product | Gradle Dependency | API Coverage |
18-
|---------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
19-
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.10.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.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.10.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.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.10.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.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.10.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.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.10.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.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.10.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.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.10.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.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.10.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.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/1.10.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.10.0`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/1.10.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) |
17+
| Service or Product | Gradle Dependency | API Coverage |
18+
|---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
19+
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.10.4/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.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.10.4/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.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.10.4/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.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.10.4/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.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.10.4/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.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.10.4/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.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.10.4/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.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.10.4/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.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/1.10.4/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.10.4`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/1.10.4/pom) | [![80%](https://img.shields.io/badge/-1%25-orange?style=flat-square)](/firebase-crashlytics/src/commonMain/kotlin/dev/gitlive/firebase/crashlytics/crashlytics.kt) |
2929

3030
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)
3131

build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
22
import org.gradle.api.tasks.testing.logging.TestLogEvent
3+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
34

45
repositories {
56
google()
@@ -52,7 +53,7 @@ tasks {
5253
subprojects {
5354

5455
group = "dev.gitlive"
55-
56+
5657
apply(plugin = "com.adarshr.test-logger")
5758

5859
repositories {
@@ -116,7 +117,7 @@ subprojects {
116117
"commonTestImplementation"(kotlin("test-common"))
117118
"commonTestImplementation"(kotlin("test-annotations-common"))
118119
if (this@afterEvaluate.name != "firebase-crashlytics") {
119-
"jvmMainApi"("dev.gitlive:firebase-java-sdk:0.1.1")
120+
"jvmMainApi"("dev.gitlive:firebase-java-sdk:0.1.2")
120121
"jvmMainApi"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion") {
121122
exclude("com.google.android.gms")
122123
}
@@ -147,6 +148,7 @@ subprojects {
147148
repositories {
148149
maven {
149150
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
151+
150152
credentials {
151153
username = project.findProperty("sonatypeUsername") as String? ?: System.getenv("sonatypeUsername")
152154
password = project.findProperty("sonatypePassword") as String? ?: System.getenv("sonatypePassword")

firebase-app/build.gradle.kts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
2+
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree
3+
14
/*
25
* Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license.
36
*/
@@ -46,7 +49,16 @@ val supportIosTarget = project.property("skipIosTarget") != "true"
4649

4750
kotlin {
4851

52+
targets.configureEach {
53+
compilations.configureEach {
54+
kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes"
55+
}
56+
}
57+
58+
@Suppress("OPT_IN_USAGE")
4959
androidTarget {
60+
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
61+
unitTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
5062
publishAllLibraryVariants()
5163
compilations.configureEach {
5264
kotlinOptions {
@@ -64,7 +76,8 @@ kotlin {
6476
}
6577

6678
if (supportIosTarget) {
67-
ios()
79+
iosArm64()
80+
iosX64()
6881
iosSimulatorArm64()
6982

7083
cocoapods {
@@ -109,6 +122,9 @@ kotlin {
109122
this.apiVersion = apiVersion
110123
this.languageVersion = languageVersion
111124
progressiveMode = true
125+
if (name.lowercase().contains("ios")) {
126+
optIn("kotlinx.cinterop.ExperimentalForeignApi")
127+
}
112128
}
113129
}
114130

@@ -118,7 +134,7 @@ kotlin {
118134
}
119135
}
120136

121-
val commonTest by getting {
137+
getByName("commonTest") {
122138
dependencies {
123139
implementation(project(":test-utils"))
124140
}
@@ -130,24 +146,9 @@ kotlin {
130146
}
131147
}
132148

133-
getByName("androidInstrumentedTest") {
134-
dependencies {
135-
dependsOn(commonTest)
136-
}
137-
}
138-
139149
getByName("jvmMain") {
140150
kotlin.srcDir("src/androidMain/kotlin")
141151
}
142-
143-
if (supportIosTarget) {
144-
val iosMain by getting
145-
val iosSimulatorArm64Main by getting
146-
iosSimulatorArm64Main.dependsOn(iosMain)
147-
val iosTest by sourceSets.getting
148-
val iosSimulatorArm64Test by getting
149-
iosSimulatorArm64Test.dependsOn(iosTest)
150-
}
151152
}
152153
}
153154

firebase-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-app",
3-
"version": "1.10.1",
3+
"version": "1.10.4",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-app.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@gitlive/firebase-common": "1.10.1",
26+
"@gitlive/firebase-common": "1.10.4",
2727
"firebase": "9.19.1",
2828
"kotlin": "1.8.20",
2929
"kotlinx-coroutines-core": "1.6.4"

0 commit comments

Comments
 (0)