Skip to content

Commit

Permalink
Removed carthage and added cocoapods plugin (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
Reedyuk authored Apr 3, 2023
1 parent 249cb19 commit 30cc1f9
Show file tree
Hide file tree
Showing 70 changed files with 365 additions and 848 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
arguments: :updateVersions
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Install Carthage
run: brew install carthage
- name: Publish Firebase App
uses: eskatos/gradle-command-action@v1
with:
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,26 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: Cocoapods cache
uses: actions/cache@v3
id: cocoapods-cache
with:
path: |
~/.cocoapods
~/Library/Caches/CocoaPods
*/build/cocoapods
*/build/classes
key: cocoapods-cache
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
cache: gradle
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Install Carthage
run: brew list carthage || brew install carthage
- name: Install Firebase tools
run: npm install -g firebase-tools
- name: Start Firebase emulator
Expand Down
6 changes: 6 additions & 0 deletions .idea/externalDependencies.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It's API is similar

The following libraries are available for the various Firebase products.

| Service or Product | Gradle Dependency | API Coverage |
|---------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Authentication](https://firebase.google.com/docs/auth) | [`dev.gitlive:firebase-auth:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-auth/1.7.3/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.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-database/1.7.3/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.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-firestore/1.7.3/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.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-functions/1.7.3/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.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-messaging/1.7.3/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
| [Cloud Storage](https://firebase.google.com/docs/storage) | [`dev.gitlive:firebase-storage:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-storage/1.7.3/pom) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
| [Installations](https://firebase.google.com/docs/projects/manage-installations) | [`dev.gitlive:firebase-installations:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-installations/1.7.3/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.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-config/1.7.3/pom) | ![20%](https://img.shields.io/badge/-20%25-orange?style=flat-square) |
| [Performance](https://firebase.google.com/docs/perf-mon) | [`dev.gitlive:firebase-perf:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-perf/1.7.3/pom) | ![60%](https://img.shields.io/badge/-60%25-orange?style=flat-square) |
| [Crashlytics](https://firebase.google.com/docs/crashlytics) | [`dev.gitlive:firebase-crashlytics:1.7.3`](https://search.maven.org/artifact/dev.gitlive/firebase-crashlytics/1.7.3/pom) | ![80%](https://img.shields.io/badge/-80%25-green?style=flat-square) |
| Service or Product | Gradle Dependency | API Coverage |
|---------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |
| [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) |



Expand Down Expand Up @@ -69,8 +69,8 @@ The Firebase Kotlin SDK uses Kotlin serialization to read and write custom class

```groovy
plugins {
kotlin("multiplatform") version "1.6.10" // or kotlin("jvm") or any other kotlin plugin
kotlin("plugin.serialization") version "1.6.10"
kotlin("multiplatform") version "1.8.20" // or kotlin("jvm") or any other kotlin plugin
kotlin("plugin.serialization") version "1.8.20"
}
```

Expand Down Expand Up @@ -203,16 +203,16 @@ If you are building a Kotlin multiplatform library which will be consumed from J

```json
"dependencies": {
"@gitlive/firebase-auth": "1.7.3",
"@gitlive/firebase-config": "1.7.3",
"@gitlive/firebase-database": "1.7.3",
"@gitlive/firebase-firestore": "1.7.3",
"@gitlive/firebase-functions": "1.7.3",
"@gitlive/firebase-installations": "1.7.3",
"@gitlive/firebase-messaging": "1.7.3",
"@gitlive/firebase-storage": "1.7.3"
"@gitlive/firebase-perf": "1.7.3"
"@gitlive/firebase-crashlytics": "1.7.3"
"@gitlive/firebase-auth": "1.8.0",
"@gitlive/firebase-config": "1.8.0",
"@gitlive/firebase-database": "1.8.0",
"@gitlive/firebase-firestore": "1.8.0",
"@gitlive/firebase-functions": "1.8.0",
"@gitlive/firebase-installations": "1.8.0",
"@gitlive/firebase-messaging": "1.8.0",
"@gitlive/firebase-storage": "1.8.0"
"@gitlive/firebase-perf": "1.8.0"
"@gitlive/firebase-crashlytics": "1.8.0"
}
```

Expand Down
64 changes: 12 additions & 52 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

repositories {
google()
mavenCentral()
}

plugins {
kotlin("multiplatform") version "1.6.10" apply false
kotlin("multiplatform") version "1.8.20" apply false
kotlin("native.cocoapods") version "1.8.20" apply false
id("base")
id("com.github.ben-manes.versions") version "0.42.0"
}
Expand All @@ -19,6 +25,7 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20-RC")
classpath("com.adarshr:gradle-test-logger-plugin:3.2.0")
}
}
Expand Down Expand Up @@ -54,24 +61,10 @@ subprojects {
mavenCentral()
}

rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().nodeVersion = "16.0.0"
}

tasks.withType<Sign>().configureEach {
onlyIf { !project.gradle.startParameter.taskNames.contains("publishToMavenLocal") }
}

tasks.whenTaskAdded {
enabled = when(name) {
"compileDebugUnitTestKotlinAndroid" -> false
"compileReleaseUnitTestKotlinAndroid" -> false
"testDebugUnitTest" -> false
"testReleaseUnitTest" -> false
else -> enabled
}
}

tasks {

val updateVersion by registering(Exec::class) {
Expand Down Expand Up @@ -161,36 +154,6 @@ subprojects {
)
}
}

val carthageTasks = if (projectDir.resolve("src/nativeInterop/cinterop/Cartfile").exists()) { // skipping firebase-common module
listOf("bootstrap", "update").map {
task<Exec>("carthage${it.capitalize()}") {
group = "carthage"
executable = "carthage"
args(
it,
"--project-directory", projectDir.resolve("src/nativeInterop/cinterop"),
"--platform", "iOS"
)
}
}
} else emptyList()

if (Os.isFamily(Os.FAMILY_MAC)) {
withType(org.jetbrains.kotlin.gradle.tasks.CInteropProcess::class) {
if (carthageTasks.isNotEmpty()) {
dependsOn("carthageBootstrap")
}
}
}

create("carthageClean", Delete::class.java) {
group = "carthage"
delete(
projectDir.resolve("src/nativeInterop/cinterop/Carthage"),
projectDir.resolve("src/nativeInterop/cinterop/Cartfile.resolved")
)
}
}

afterEvaluate {
Expand All @@ -199,17 +162,14 @@ subprojects {
mkdir("$buildDir/node_module")
}

tasks.named<Delete>("clean") {
dependsOn("carthageClean")
}

dependencies {
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1-native-mt")
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.1-native-mt")
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4")
"androidMainImplementation"(platform("com.google.firebase:firebase-bom:29.3.0"))
"commonTestImplementation"(kotlin("test-common"))
"commonTestImplementation"(kotlin("test-annotations-common"))
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1-native-mt")
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4")
if (this@afterEvaluate.name != "firebase-crashlytics") {
"jsTestImplementation"(kotlin("test-js"))
}
Expand Down
Loading

0 comments on commit 30cc1f9

Please sign in to comment.