Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved dependency declarations to the TOML file #532

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 16 additions & 39 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

repositories {
google()
mavenCentral()
}

plugins {
kotlin("multiplatform") apply false
kotlin("native.cocoapods") apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlinx.serialization) apply false
alias(libs.plugins.multiplatform) apply false
alias(libs.plugins.native.cocoapods) apply false
alias(libs.plugins.test.logger.plugin) apply false
alias(libs.plugins.ben.manes.versions) apply false
id("base")
id("com.github.ben-manes.versions") version "0.42.0"
}

buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath("com.android.tools.build:gradle:${project.extra["gradlePluginVersion"]}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.extra["kotlinVersion"]}")
classpath("com.adarshr:gradle-test-logger-plugin:3.2.0")
}
}

val compileSdkVersion by extra(34)
Expand Down Expand Up @@ -108,31 +89,27 @@ subprojects {
}

afterEvaluate {

val coroutinesVersion: String by project
val firebaseBoMVersion: String by project

dependencies {
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion")
"androidMainImplementation"(platform("com.google.firebase:firebase-bom:$firebaseBoMVersion"))
"commonMainImplementation"(libs.kotlinx.coroutines.core)
"androidMainImplementation"(libs.kotlinx.coroutines.play.services)
"androidMainImplementation"(platform(libs.firebase.bom))
"commonTestImplementation"(kotlin("test-common"))
"commonTestImplementation"(kotlin("test-annotations-common"))
if (this@afterEvaluate.name != "firebase-crashlytics") {
"jvmMainApi"("dev.gitlive:firebase-java-sdk:0.4.3")
"jvmMainApi"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion") {
"jvmMainApi"(libs.gitlive.firebase.java.sdk)
"jvmMainApi"(libs.kotlinx.coroutines.play.services) {
exclude("com.google.android.gms")
}
"jsTestImplementation"(kotlin("test-js"))
"jvmTestImplementation"(kotlin("test-junit"))
"jvmTestImplementation"("junit:junit:4.13.2")
"jvmTestImplementation"(libs.junit)
}
"androidInstrumentedTestImplementation"(kotlin("test-junit"))
"androidUnitTestImplementation"(kotlin("test-junit"))
"androidInstrumentedTestImplementation"("junit:junit:4.13.2")
"androidInstrumentedTestImplementation"("androidx.test:core:1.5.0")
"androidInstrumentedTestImplementation"("androidx.test.ext:junit:1.1.5")
"androidInstrumentedTestImplementation"("androidx.test:runner:1.5.2")
"androidInstrumentedTestImplementation"(libs.junit)
"androidInstrumentedTestImplementation"(libs.androidx.test.core)
"androidInstrumentedTestImplementation"(libs.androidx.test.junit)
"androidInstrumentedTestImplementation"(libs.androidx.test.runner)
}
}

Expand Down
8 changes: 3 additions & 5 deletions firebase-analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
if (name.lowercase().contains("ios")) {
optIn("kotlinx.cinterop.ExperimentalForeignApi")
Expand All @@ -147,7 +145,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-analytics")
api(libs.google.firebase.analytics)
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions firebase-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
if (name.lowercase().contains("ios")) {
optIn("kotlinx.cinterop.ExperimentalForeignApi")
Expand All @@ -142,7 +140,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-common-ktx")
api(libs.google.firebase.common.ktx)
}
}

Expand Down
8 changes: 3 additions & 5 deletions firebase-auth/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
if (name.lowercase().contains("ios")) {
Expand All @@ -157,7 +155,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-auth-ktx")
api(libs.google.firebase.auth.ktx)
}
}
}
Expand Down
12 changes: 4 additions & 8 deletions firebase-common-internal/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("kotlinx.serialization.ExperimentalSerializationApi")
Expand All @@ -122,11 +120,9 @@ kotlin {
}

getByName("commonMain") {
val serializationVersion: String by project

dependencies {
implementation(project(":firebase-common"))
api("org.jetbrains.kotlinx:kotlinx-serialization-core:$serializationVersion")
api(libs.kotlinx.serialization.core)
}
}

Expand All @@ -138,7 +134,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-common-ktx")
api(libs.google.firebase.common.ktx)
}
}

Expand Down
12 changes: 4 additions & 8 deletions firebase-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("kotlinx.serialization.ExperimentalSerializationApi")
Expand All @@ -122,10 +120,8 @@ kotlin {
}

getByName("commonMain") {
val serializationVersion: String by project

dependencies {
api("org.jetbrains.kotlinx:kotlinx-serialization-core:$serializationVersion")
api(libs.kotlinx.serialization.core)
}
}

Expand All @@ -137,7 +133,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-common-ktx")
api(libs.google.firebase.common.ktx)
}
}

Expand Down
8 changes: 3 additions & 5 deletions firebase-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
if (name.lowercase().contains("ios")) {
Expand All @@ -153,7 +151,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-config-ktx")
api(libs.google.firebase.config.ktx)
}
}

Expand Down
8 changes: 3 additions & 5 deletions firebase-crashlytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
if (name.lowercase().contains("ios")) {
Expand All @@ -127,7 +125,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-crashlytics-ktx")
api(libs.google.firebase.crashlytics.ktx)
}
}

Expand Down
8 changes: 3 additions & 5 deletions firebase-database/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("kotlinx.coroutines.FlowPreview")
Expand Down Expand Up @@ -160,7 +158,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-database-ktx")
api(libs.google.firebase.database.ktx)
}
}
getByName("jvmMain") {
Expand Down
8 changes: 3 additions & 5 deletions firebase-firestore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("kotlinx.serialization.InternalSerializationApi")
Expand Down Expand Up @@ -169,7 +167,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-firestore")
api(libs.google.firebase.firestore)
}
}

Expand Down
8 changes: 3 additions & 5 deletions firebase-functions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("kotlinx.serialization.InternalSerializationApi")
Expand All @@ -145,7 +143,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-functions")
api(libs.google.firebase.functions)
}
}

Expand Down
8 changes: 3 additions & 5 deletions firebase-installations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
if (name.lowercase().contains("ios")) {
optIn("kotlinx.cinterop.ExperimentalForeignApi")
Expand All @@ -146,7 +144,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-installations-ktx")
api(libs.google.firebase.installations.ktx)
}
}

Expand Down
8 changes: 3 additions & 5 deletions firebase-messaging/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
if (name.lowercase().contains("ios")) {
Expand All @@ -148,7 +146,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-messaging")
api(libs.google.firebase.messaging)
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions firebase-perf/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@ kotlin {
sourceSets {
all {
languageSettings.apply {
val apiVersion: String by project
val languageVersion: String by project
this.apiVersion = apiVersion
this.languageVersion = languageVersion
this.apiVersion = libs.versions.settings.api.get()
this.languageVersion = libs.versions.settings.language.get()
progressiveMode = true
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
if (name.lowercase().contains("ios")) {
Expand All @@ -139,7 +137,7 @@ kotlin {

getByName("androidMain") {
dependencies {
api("com.google.firebase:firebase-perf-ktx")
api(libs.google.firebase.perf.ktx)
}
}

Expand Down
Loading
Loading