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

[LD-144] Migrate to version catalog #168

Merged
merged 17 commits into from
Nov 22, 2023
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
57 changes: 19 additions & 38 deletions app-shared-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'com.android.library'
id 'kotlin-kapt'
id 'org.jetbrains.kotlin.android'
id 'org.jlleitschuh.gradle.ktlint' version '11.6.1'
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ktlint.gradle)
}

java {
Expand Down Expand Up @@ -60,52 +60,33 @@ android {
dependencies {
implementation(project(":app"))

// koin
api "io.insert-koin:koin-core:$koin_version"
api "io.insert-koin:koin-test:$koin_version"
api "io.insert-koin:koin-test-junit4:$koin_version"
api "io.insert-koin:koin-android:$koin_version"
api "io.insert-koin:koin-android-test:$koin_version"
api "io.insert-koin:koin-androidx-compose:$koin_version"
// Koin
api(libs.bundles.koin)

// assertion library
// cannot use 0.34.0 due to an existing bug
// https://github.com/robfletcher/strikt/issues/259
api 'io.strikt:strikt-core:0.33.0'
api 'io.strikt:strikt-mockk:0.34.1'
// Assertion Library
api(libs.bundles.strikt)

// Setup Junit4 and Junit5
api(platform("org.junit:junit-bom:5.10.0"))
api("org.junit.jupiter:junit-jupiter") {
api(platform(libs.junit.bom))
api(libs.jupiter) {
because 'allows to write and run Jupiter tests'
}
api("junit:junit:4.13.2")
runtimeOnly("org.junit.vintage:junit-vintage-engine") {
api(libs.junit)
runtimeOnly(libs.junit.vintage) {
because 'allows JUnit 3 and JUnit 4 tests to run'
}
runtimeOnly("org.junit.platform:junit-platform-launcher") {
runtimeOnly(libs.junit.platform) {
because 'allows tests to run from IDEs that bundle older version of launcher'
}

//testing
api 'androidx.test:core-ktx:1.5.0'
api 'org.robolectric:robolectric:4.10.3'
api 'androidx.test.ext:junit-ktx:1.1.5'

api "io.mockk:mockk:1.13.5"

api "com.squareup.okhttp3:mockwebserver:4.11.0"

api 'androidx.test.ext:junit:1.1.5'
api 'androidx.test.espresso:espresso-core:3.5.1'
api "androidx.compose.ui:ui-test-junit4:1.5.3"

api 'androidx.test.espresso:espresso-intents:3.5.1'
// Testing
api(libs.bundles.androidxTesting)
api(libs.robolectric)
api(libs.bundles.mock)

// Firebase instrumentation lib
api 'com.google.firebase:testlab-instr-lib:0.2'
api 'dev.samstevens.totp:totp:1.7.1'
api(libs.bundles.firebase)

// ktlint
// Ktlint
ktlintRuleset project(":custom-ktlint-rules")
}
114 changes: 50 additions & 64 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
plugins {
id 'com.android.application'
id 'kotlin-kapt'
id 'org.jetbrains.kotlin.android'
id 'jacoco'
id 'org.jlleitschuh.gradle.ktlint' version '11.6.1'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.0'
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ktlint.gradle)
alias(libs.plugins.kotlin.serialization)
}

def fileName = "../app/google-services.json"

if (project.file(fileName).exists()) {
apply plugin: 'com.google.gms.google-services'
apply {
plugin(libs.plugins.google.services.get().getPluginId())
}
}

java {
Expand Down Expand Up @@ -145,77 +146,62 @@ tasks.register('codeCoverage', JacocoReport) {

dependencies {
api project(':components')
//Desugaring for use of java.time in api lower then 26
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'

//Base android deps
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
implementation 'androidx.activity:activity-compose:1.8.0'
// Desugaring for use of java.time in api lower then 26
coreLibraryDesugaring(libs.desugar)

// Base android deps
implementation(libs.bundles.androidx)

// Orchestrator
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestUtil 'androidx.test:orchestrator:1.4.2'

//Compose
def composeBom = platform('androidx.compose:compose-bom:2023.10.01')
implementation composeBom
androidTestImplementation composeBom
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.material:material'
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation "androidx.navigation:navigation-compose:2.7.4"
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'

//Showkase
implementation "com.airbnb.android:showkase:1.0.2"
kapt "com.airbnb.android:showkase-processor:1.0.2"

// koin
api "io.insert-koin:koin-core:$koin_version"
api "io.insert-koin:koin-test:$koin_version"
api "io.insert-koin:koin-test-junit4:$koin_version"
api "io.insert-koin:koin-android:$koin_version"
api "io.insert-koin:koin-android-test:$koin_version"
api "io.insert-koin:koin-androidx-compose:$koin_version"

//coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.2'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3"

// ktor
implementation "io.ktor:ktor-client-core:$ktor_version"
implementation "io.ktor:ktor-client-okhttp:$ktor_version"
implementation "io.ktor:ktor-client-content-negotiation:$ktor_version"
implementation "io.ktor:ktor-serialization-kotlinx-json:$ktor_version"
testImplementation("io.ktor:ktor-client-mock:$ktor_version")

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.1")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
testImplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")

//retrofit & okhttp
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
androidTestImplementation(libs.androidx.test.runner)
androidTestUtil(libs.androidx.test.orchestartor)

// Compose
def composeBom = platform(libs.compose.bom)
implementation(composeBom)
androidTestImplementation(composeBom)
implementation(libs.bundles.compose)
implementation(libs.compose.navigation)
debugImplementation(libs.bundles.composeDebug)

// Showkase
implementation(libs.showkase)
kapt(libs.showkase.processor)

// Koin
api(libs.bundles.koin)

// Coroutines
implementation(libs.coroutines.android)
testImplementation(libs.coroutines.test)

// Ktor
implementation(libs.bundles.ktor)
testImplementation(libs.ktor.client.mock)

// Util
implementation(libs.bundles.kotlinx)
testImplementation(libs.kotlinx.datetime)

// OkHttp
implementation(libs.bundles.okhttp)

// Testing
testImplementation project(":app-shared-tests")
androidTestImplementation(project(":app-shared-tests")) {
exclude group: 'org.robolectric', module: 'robolectric'
}

androidTestImplementation "io.mockk:mockk-android:1.13.3"
androidTestImplementation('androidx.test.uiautomator:uiautomator:2.3.0-alpha03')
androidTestImplementation(libs.mockk)
androidTestImplementation(libs.androidx.test.uiautomator)

// ktlint
// Ktlint
ktlintRuleset project(":custom-ktlint-rules")

// Firebase
implementation(platform("com.google.firebase:firebase-bom:32.4.0"))
implementation("com.google.firebase:firebase-analytics-ktx")
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
}

tasks.withType(Test) {
Expand All @@ -224,4 +210,4 @@ tasks.withType(Test) {

kapt {
correctErrorTypes true
}
}
21 changes: 7 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
buildscript {
ext {
compose_version = '1.3.3'
ktor_version = '2.3.6'
koin_version = '3.5.0'
}
}

plugins {
id 'app.cash.paparazzi' version '1.3.1' apply false
id 'com.android.application' version '8.1.2' apply false
id 'com.android.library' version '8.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
id 'org.jetbrains.kotlin.jvm' version '1.9.0' apply false
id 'com.google.gms.google-services' version '4.4.0' apply false
alias(libs.plugins.paparazzi) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.google.services) apply false
}
47 changes: 22 additions & 25 deletions components/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'app.cash.paparazzi'
id 'kotlin-kapt'
id 'org.jlleitschuh.gradle.ktlint' version '11.6.1'
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.paparazzi)
alias(libs.plugins.ktlint.gradle)
alias(libs.plugins.kotlin.kapt)
}

java {
Expand Down Expand Up @@ -40,26 +40,23 @@ android {
}

dependencies {
implementation platform('androidx.compose:compose-bom:2023.10.01')
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.material:material'
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-tooling-preview'
debugImplementation 'androidx.compose.ui:ui-tooling'

//Showkase
implementation "com.airbnb.android:showkase:1.0.2"
kapt "com.airbnb.android:showkase-processor:1.0.2"
testImplementation "com.google.testparameterinjector:test-parameter-injector:1.8"
kaptTest "com.airbnb.android:showkase-processor:1.0.2"

//Lottie - Compose
implementation("com.airbnb.android:lottie-compose:5.2.0")

implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
implementation(platform(libs.compose.bom))
implementation(libs.bundles.compose)
debugImplementation libs.compose.ui.tooling

// Showkase
implementation libs.showkase
kapt libs.showkase.processor
testImplementation libs.test.parameter.injector
kaptTest libs.showkase.processor

// Lottie - Compose
implementation(libs.lottie.compose)

implementation libs.androidx.ktx
implementation libs.androidx.appcompat
testImplementation libs.junit
androidTestImplementation libs.androidx.junit

// ktlint
ktlintRuleset project(":custom-ktlint-rules")
Expand Down
23 changes: 12 additions & 11 deletions custom-ktlint-rules/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'java-library'
id 'org.jetbrains.kotlin.jvm'
alias libs.plugins.kotlin.jvm
}

java {
Expand All @@ -10,15 +10,16 @@ java {
}

dependencies {
compileOnly 'com.pinterest.ktlint:ktlint-rule-engine-core:1.0.1'
compileOnly 'com.pinterest.ktlint:ktlint-ruleset-standard:1.0.1'
testImplementation 'junit:junit:4.13.2'
implementation 'org.slf4j:slf4j-api:2.0.7'
// assertion library
// cannot use 0.34.0 due to an existing bug
compileOnly(libs.bundles.ktlint)

testImplementation libs.junit
implementation libs.slf4j.api

// Assertion Library
// Cannot use 0.34.0 due to an existing bug.
// https://github.com/robfletcher/strikt/issues/259
testImplementation 'io.strikt:strikt-core:0.33.0'
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'com.pinterest.ktlint:ktlint-rule-engine-core:1.0.1'
testImplementation 'com.pinterest.ktlint:ktlint-test:1.0.1'
testImplementation libs.strikt.core

testImplementation libs.assertj.core
testImplementation libs.bundles.ktlintTesting
}
Loading
Loading