Skip to content

Commit c2c2da3

Browse files
authored
updated kotlin & dependencies, using Firebase Android BoM (#201)
* updated kotlin & dependencies, using Firebase Android BoM (https://firebase.google.com/docs/android/learn-more#bom) * one more version bump * updated Android Gradle Plugin, some cleanups * updated JDK to 11, fixed Gradle deprecations
1 parent 0e1abd6 commit c2c2da3

File tree

28 files changed

+155
-154
lines changed

28 files changed

+155
-154
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v2
17-
- name: Set up JDK 1.8
18-
uses: actions/setup-java@v1
17+
- name: Set up JDK
18+
uses: actions/setup-java@v2
1919
with:
20-
java-version: 1.8
20+
distribution: 'zulu'
21+
java-version: '11'
2122
- name: Setup versions
2223
uses: eskatos/gradle-command-action@v1
2324
with:

.github/workflows/pull_request.yml

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,49 @@ jobs:
1313
runs-on: macos-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up JDK 1.8
18-
uses: actions/setup-java@v1
19-
with:
20-
java-version: 1.8
21-
- name: Grant execute permission for gradlew
22-
run: chmod +x gradlew
23-
- name: Install Carthage
24-
run: brew list carthage || brew install carthage
25-
- name: Install Firebase tools
26-
run: npm install -g firebase-tools
27-
- name: Start Firebase emulator
28-
run: "firebase emulators:start --config=./test/firebase.json &"
29-
- name: Assemble
30-
run: ./gradlew assemble
31-
- name: Run JS Tests
32-
run: ./gradlew cleanTest jsTest
33-
- name: Upload JS test artifact
34-
uses: actions/upload-artifact@v2
35-
if: failure()
36-
with:
37-
name: "JS Test Report HTML"
38-
path: "firebase-firestore/build/reports/tests/jsTest/"
39-
- name: Run iOS Tests
40-
run: ./gradlew cleanTest iosX64Test
41-
- name: Upload iOS test artifact
42-
uses: actions/upload-artifact@v2
43-
if: failure()
44-
with:
45-
name: "iOS Test Report HTML"
46-
path: "firebase-firestore/build/reports/tests/iosTest/"
47-
- name: Run Android Instrumented Tests
48-
uses: reactivecircus/android-emulator-runner@v2
49-
with:
50-
api-level: 29
51-
target: google_apis
52-
arch: x86_64
53-
profile: Nexus 6
54-
script: ./gradlew connectedAndroidTest
55-
- name: Upload Android test artifact
56-
uses: actions/upload-artifact@v2
57-
if: failure()
58-
with:
59-
name: "Android Test Report HTML"
60-
path: "firebase-firestore/build/reports/tests/androidTests/"
16+
- uses: actions/checkout@v2
17+
- name: Set up JDK
18+
uses: actions/setup-java@v2
19+
with:
20+
distribution: 'zulu'
21+
java-version: '11'
22+
- name: Grant execute permission for gradlew
23+
run: chmod +x gradlew
24+
- name: Install Carthage
25+
run: brew list carthage || brew install carthage
26+
- name: Install Firebase tools
27+
run: npm install -g firebase-tools
28+
- name: Start Firebase emulator
29+
run: "firebase emulators:start --config=./test/firebase.json &"
30+
- name: Assemble
31+
run: ./gradlew assemble
32+
- name: Run JS Tests
33+
run: ./gradlew cleanTest jsTest
34+
- name: Upload JS test artifact
35+
uses: actions/upload-artifact@v2
36+
if: failure()
37+
with:
38+
name: "JS Test Report HTML"
39+
path: "firebase-firestore/build/reports/tests/jsTest/"
40+
- name: Run iOS Tests
41+
run: ./gradlew cleanTest iosX64Test
42+
- name: Upload iOS test artifact
43+
uses: actions/upload-artifact@v2
44+
if: failure()
45+
with:
46+
name: "iOS Test Report HTML"
47+
path: "firebase-firestore/build/reports/tests/iosTest/"
48+
- name: Run Android Instrumented Tests
49+
uses: reactivecircus/android-emulator-runner@v2
50+
with:
51+
api-level: 29
52+
target: google_apis
53+
arch: x86_64
54+
profile: Nexus 6
55+
script: ./gradlew connectedAndroidTest
56+
- name: Upload Android test artifact
57+
uses: actions/upload-artifact@v2
58+
if: failure()
59+
with:
60+
name: "Android Test Report HTML"
61+
path: "firebase-firestore/build/reports/tests/androidTests/"

build.gradle.kts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
44
import org.gradle.api.tasks.testing.logging.TestLogEvent
55

66
plugins {
7-
kotlin("multiplatform") version "1.5.10" apply false
7+
kotlin("multiplatform") version "1.5.21" apply false
88
id("base")
99
}
1010

@@ -18,7 +18,7 @@ buildscript {
1818
}
1919
}
2020
dependencies {
21-
classpath("com.android.tools.build:gradle:4.2.1")
21+
classpath("com.android.tools.build:gradle:7.0.0")
2222
classpath("com.adarshr:gradle-test-logger-plugin:2.1.1")
2323
}
2424
}
@@ -207,19 +207,18 @@ subprojects {
207207
}
208208

209209
dependencies {
210-
"commonMainImplementation"(kotlin("stdlib-common"))
211-
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
212-
"jsMainImplementation"(kotlin("stdlib-js"))
213-
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.5.0")
210+
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1")
211+
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.5.1")
212+
"androidMainImplementation"(platform("com.google.firebase:firebase-bom:28.3.1"))
214213
"commonTestImplementation"(kotlin("test-common"))
215214
"commonTestImplementation"(kotlin("test-annotations-common"))
216-
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
215+
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1")
217216
"jsTestImplementation"(kotlin("test-js"))
218217
"androidAndroidTestImplementation"(kotlin("test-junit"))
219218
"androidAndroidTestImplementation"("junit:junit:4.13.2")
220-
"androidAndroidTestImplementation"("androidx.test:core:1.3.0")
221-
"androidAndroidTestImplementation"("androidx.test.ext:junit:1.1.2")
222-
"androidAndroidTestImplementation"("androidx.test:runner:1.3.0")
219+
"androidAndroidTestImplementation"("androidx.test:core:1.4.0")
220+
"androidAndroidTestImplementation"("androidx.test.ext:junit:1.1.3")
221+
"androidAndroidTestImplementation"("androidx.test:runner:1.4.0")
223222
}
224223
}
225224

firebase-app/build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ repositories {
1818
}
1919

2020
android {
21-
compileSdkVersion(property("targetSdkVersion") as Int)
21+
compileSdk = property("targetSdkVersion") as Int
2222
defaultConfig {
23-
minSdkVersion(property("minSdkVersion") as Int)
24-
targetSdkVersion(property("targetSdkVersion") as Int)
23+
minSdk = property("minSdkVersion") as Int
24+
targetSdk = property("targetSdkVersion") as Int
2525
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2626
}
2727
sourceSets {
@@ -35,11 +35,11 @@ android {
3535
}
3636
}
3737
packagingOptions {
38-
pickFirst("META-INF/kotlinx-serialization-core.kotlin_module")
39-
pickFirst("META-INF/AL2.0")
40-
pickFirst("META-INF/LGPL2.1")
38+
resources.pickFirsts.add("META-INF/kotlinx-serialization-core.kotlin_module")
39+
resources.pickFirsts.add("META-INF/AL2.0")
40+
resources.pickFirsts.add("META-INF/LGPL2.1")
4141
}
42-
lintOptions {
42+
lint {
4343
isAbortOnError = false
4444
}
4545
}
@@ -127,7 +127,7 @@ kotlin {
127127

128128
val androidMain by getting {
129129
dependencies {
130-
api("com.google.firebase:firebase-common:20.0.0")
130+
api("com.google.firebase:firebase-common-ktx")
131131
}
132132
}
133133

firebase-app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
2626
"@gitlive/firebase-common": "1.4.1",
27-
"firebase": "8.6.7",
28-
"kotlin": "1.5.10",
29-
"kotlinx-coroutines-core": "1.5.0"
27+
"firebase": "8.8.1",
28+
"kotlin": "1.5.21",
29+
"kotlinx-coroutines-core": "1.5.1"
3030
}
3131
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 8.2.0
1+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 8.5.0

firebase-auth/build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ plugins {
2424
//}
2525

2626
android {
27-
compileSdkVersion(property("targetSdkVersion") as Int)
27+
compileSdk = property("targetSdkVersion") as Int
2828
defaultConfig {
29-
minSdkVersion(property("minSdkVersion") as Int)
30-
targetSdkVersion(property("targetSdkVersion") as Int)
29+
minSdk = property("minSdkVersion") as Int
30+
targetSdk = property("targetSdkVersion") as Int
3131
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3232
}
3333
sourceSets {
@@ -45,11 +45,11 @@ android {
4545
}
4646
}
4747
packagingOptions {
48-
pickFirst("META-INF/kotlinx-serialization-core.kotlin_module")
49-
pickFirst("META-INF/AL2.0")
50-
pickFirst("META-INF/LGPL2.1")
48+
resources.pickFirsts.add("META-INF/kotlinx-serialization-core.kotlin_module")
49+
resources.pickFirsts.add("META-INF/AL2.0")
50+
resources.pickFirsts.add("META-INF/LGPL2.1")
5151
}
52-
lintOptions {
52+
lint {
5353
isAbortOnError = false
5454
}
5555
}
@@ -161,7 +161,7 @@ kotlin {
161161

162162
val androidMain by getting {
163163
dependencies {
164-
api("com.google.firebase:firebase-auth:21.0.1")
164+
api("com.google.firebase:firebase-auth-ktx")
165165
}
166166
}
167167

firebase-auth/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
2626
"@gitlive/firebase-app": "1.4.1",
27-
"firebase": "8.6.7",
28-
"kotlin": "1.5.10",
29-
"kotlinx-coroutines-core": "1.5.0"
27+
"firebase": "8.8.1",
28+
"kotlin": "1.5.21",
29+
"kotlinx-coroutines-core": "1.5.1"
3030
}
3131
}

firebase-auth/src/jsMain/kotlin/dev/gitlive/firebase/auth/auth.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ private inline fun <R> rethrow(function: () -> R): R {
148148
}
149149
}
150150

151-
private fun errorToException(cause: dynamic) = when(val code = cause.code?.toString()?.toLowerCase()) {
151+
private fun errorToException(cause: dynamic) = when(val code = cause.code?.toString()?.lowercase()) {
152152
"auth/invalid-user-token" -> FirebaseAuthInvalidUserException(code, cause)
153153
"auth/requires-recent-login" -> FirebaseAuthRecentLoginRequiredException(code, cause)
154154
"auth/user-disabled" -> FirebaseAuthInvalidUserException(code, cause)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 8.2.0
1+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 8.5.0

0 commit comments

Comments
 (0)