Skip to content

Commit

Permalink
build: adopt Gradle Version Catalog (#4777)
Browse files Browse the repository at this point in the history
* Adopt Gradle Version Catalog feature

* Address PR feedback

* Revert version upgrades causing breaking API changes

* Fix duplicate dependency issue by upgrading Iconics

* Revert Iconics, align new and old dependency layout

* Compiles

* build: remove empty workflow file android-feature.yml

* ci: disable the Play Store build for the OFF flavor

ci: disable the Play Store build for the OFF flavor

* build: bundle mlkit only in the playstore flavor (#4807)

Closes #4803

* build: add detekt to android-integration.yml (#4808)

* build: add detekt to android-integration.yml

* fix: error in env var use

* chore: set lines length guides for IDEA

* build(deps): bump toshimaru/auto-author-assign from 1.5.0 to 1.5.1 (#4812)

Bumps [toshimaru/auto-author-assign](https://github.com/toshimaru/auto-author-assign) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/toshimaru/auto-author-assign/releases)
- [Changelog](https://github.com/toshimaru/auto-author-assign/blob/main/CHANGELOG.md)
- [Commits](toshimaru/auto-author-assign@v1.5.0...v1.5.1)

---
updated-dependencies:
- dependency-name: toshimaru/auto-author-assign
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump JamesIves/github-pages-deploy-action (#4813)

Bumps [JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action) from 4.3.4 to 4.4.0.
- [Release notes](https://github.com/JamesIves/github-pages-deploy-action/releases)
- [Commits](JamesIves/github-pages-deploy-action@v4.3.4...v4.4.0)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Adopt Gradle Version Catalog feature

* Address PR feedback

* Revert version upgrades causing breaking API changes

* Fix duplicate dependency issue by upgrading Iconics

* Revert Iconics, align new and old dependency layout

* Compiles

Co-authored-by: VaiTon <[email protected]>
Co-authored-by: Pierre Slamich <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Jul 24, 2022
1 parent 3204046 commit d30e55f
Show file tree
Hide file tree
Showing 4 changed files with 418 additions and 200 deletions.
302 changes: 129 additions & 173 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*/
plugins {
id("com.android.application")
id("de.timfreiheit.resourceplaceholders.plugin")
alias(libs.plugins.resourceplaceholders) apply true
id("org.greenrobot.greendao")
id("kotlin-android")
id("kotlin-parcelize")
id("kotlin-kapt")
id("dagger.hilt.android.plugin")
id("org.jetbrains.dokka") version "1.7.0"
alias(libs.plugins.dokka)
}

fun obtainTestBuildType(): String {
Expand All @@ -33,6 +33,133 @@ fun obtainTestBuildType(): String {
return project.properties.getOrDefault("testBuildType", result) as String
}

dependencies {

// Kotlin coroutines
implementation(libs.bundles.kotlin.coroutines)

// Android KTX
implementation(libs.bundles.android.ktx)

implementation(libs.bundles.android.lifecycle)

// AndroidX
implementation(libs.bundles.androidx)

// ML Kit barcode Scanner
implementation(libs.barcode.scanning)

// Hilt
implementation(libs.hilt.android)
kapt(libs.hilt.compiler)

// Hilt for Android Testing
androidTestImplementation(libs.hilt.android.testing)
androidTestImplementation(libs.dagger)
kaptAndroidTest(libs.hilt.android.compiler)
kaptAndroidTest(libs.dagger.compiler)

// WorkManager with Hilt
implementation(libs.androidx.hilt.work)
kapt(libs.androidx.hilt.compiler)

// Reactive Streams
implementation(libs.bundles.rx)

// Networking
implementation(libs.bundles.networking)

// Logging
implementation(libs.logcat)

// Apache commons
implementation(libs.bundles.apache.commons)

// Serialization/Deserialization
implementation(libs.bundles.jackson)

// Database
implementation(libs.greendao)

// Event bus and index
implementation(libs.eventbus.runtime)
kapt(libs.eventbus.compiler)

// Material design
implementation(libs.material)

// Image Loading
implementation(libs.picasso)

// Image from gallery or camera
implementation(libs.easyimage)

// Barcode and QR Scanner
// TODO: cannot upgrade, requires API 24 or higher
implementation(libs.zxing.core)

implementation(libs.zxing.android.embedded) { isTransitive = false }

// UI Component : ImageView with Zooming
implementation(libs.photoview)

// UI Component : Material Drawer
// https://github.com/mikepenz/MaterialDrawer/commit/3b2cb1db4c3b6afe639b0f3c21c03c1de68648a3
// TODO: We need minSdk 16 to update
implementation(libs.materialdrawer)

// DO NOT UPDATE : RecyclerViewCacheUtil removed, needs rework
implementation(libs.fastadapter.commons) { artifact { type = "aar" } }

// UI Component : Font Icons
// This Font/Icon grouping resists 'bundling' due to (AAR) type specification not being directly supported by Version Catalogs.
implementation(libs.iconics.core) { artifact { type = "aar" } }
implementation(libs.google.material.typeface) { isTransitive = false; artifact { type = "aar" } }
implementation(libs.android.image.cropper)

// UI Component : Chips Input
implementation(libs.nachos)

// Crash analytics
implementation(libs.bundles.crash.analytics)

// ShowCaseView dependency
implementation(libs.showcaseview)

// Unit Testing
testImplementation(libs.bundles.testing)

testImplementation(platform("org.junit:junit-bom:5.8.2"))
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(libs.junit.vintage.engine)

// Instrumented tests
androidTestUtil(libs.orchestrator)


androidTestImplementation(libs.androidx.test.runner) { exclude("junit") }
androidTestImplementation(libs.androidx.test.rules)

androidTestImplementation(libs.androidx.test.ext) { exclude("junit") }

androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.androidx.test.espresso.intents)
androidTestImplementation(libs.androidx.test.espresso.web)
androidTestImplementation(libs.androidx.test.espresso.contrib) {
exclude(group = "com.android.support", module = "appcompat-v7")
exclude(group = "com.android.support", module = "support-v4")
exclude(group = "com.android.support", module = "design")
exclude(module = "recyclerview-v7")
}
androidTestImplementation(libs.falcon)
androidTestImplementation(libs.screengrab)
androidTestImplementation(libs.test.kotlin.coroutines)


resourcePlaceholders { files = listOf("xml/shortcuts.xml") }
}

android {
compileSdk = 31

Expand Down Expand Up @@ -229,177 +356,6 @@ android {
}
}

dependencies {
// Kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib:${rootProject.extra["kotlinVersion"]}")

// Kotlin coroutines
val coroutinesVersion = "1.6.4"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")

// Android KTX
implementation("androidx.fragment:fragment-ktx:1.4.1")
implementation("androidx.activity:activity-ktx:1.4.0")
implementation("androidx.preference:preference-ktx:1.2.0")
implementation("androidx.core:core-ktx:1.8.0")

val lifecycleVer = "2.4.1"
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVer")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVer")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVer")

// AndroidX
implementation("androidx.appcompat:appcompat:1.4.2")
implementation("androidx.browser:browser:1.4.0")
implementation("androidx.concurrent:concurrent-futures:1.1.0")
implementation("androidx.recyclerview:recyclerview:1.2.1")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.annotation:annotation:1.4.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.multidex:multidex:2.0.1")
implementation("androidx.viewpager2:viewpager2:1.0.0")
implementation("androidx.startup:startup-runtime:1.1.1")
implementation("androidx.work:work-runtime-ktx:2.7.1")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")

// ML Kit barcode Scanner
"playstoreImplementation"("com.google.mlkit:barcode-scanning:17.0.0")

// Hilt
implementation("com.google.dagger:hilt-android:${rootProject.extra["hiltVersion"]}")
kapt("com.google.dagger:hilt-compiler:${rootProject.extra["hiltVersion"]}")

// Hilt for Android Testing
androidTestImplementation("com.google.dagger:hilt-android-testing:${rootProject.extra["hiltVersion"]}")
androidTestImplementation("com.google.dagger:dagger:${rootProject.extra["hiltVersion"]}")
kaptAndroidTest("com.google.dagger:hilt-android-compiler:${rootProject.extra["hiltVersion"]}")
kaptAndroidTest("com.google.dagger:dagger-compiler:${rootProject.extra["hiltVersion"]}")

// WorkManager with Hilt
implementation("androidx.hilt:hilt-work:1.0.0")
kapt("androidx.hilt:hilt-compiler:1.0.0")

// Reactive Streams
implementation("io.reactivex.rxjava2:rxkotlin:2.4.0")
implementation("io.reactivex.rxjava2:rxjava:2.2.21")
implementation("io.reactivex.rxjava2:rxandroid:2.1.1")
implementation("com.jakewharton.rxrelay2:rxrelay:2.1.1")

// Networking
implementation("com.squareup.retrofit2:retrofit:2.6.4")
implementation("com.squareup.retrofit2:converter-jackson:2.6.4")
implementation("com.squareup.retrofit2:adapter-rxjava2:2.6.4")
implementation("com.squareup.retrofit2:converter-scalars:2.1.0")
implementation("com.squareup.okhttp3:logging-interceptor:3.12.13")

// Logging
implementation("com.squareup.logcat:logcat:0.1")

// Apache commons
implementation("org.apache.commons:commons-text:1.9")
implementation("org.apache.commons:commons-csv:1.9.0")
implementation("commons-validator:commons-validator:1.7")

// Serialization/Deserialization
implementation("com.fasterxml.jackson.core:jackson-core:${rootProject.extra["jacksonVersion"]}")
implementation("com.fasterxml.jackson.core:jackson-databind:${rootProject.extra["jacksonVersion"]}")
implementation("com.fasterxml.jackson.core:jackson-annotations:${rootProject.extra["jacksonVersion"]}")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:${rootProject.extra["jacksonVersion"]}")

// Database
implementation("org.greenrobot:greendao:${rootProject.extra["greendaoVersion"]}")

// Event bus and index
val eventBusVersion = "3.3.1"
implementation("org.greenrobot:eventbus:$eventBusVersion")
kapt("org.greenrobot:eventbus-annotation-processor:$eventBusVersion")

// Material design
implementation("com.google.android.material:material:1.6.1")

// Image Loading
implementation("com.squareup.picasso:picasso:2.8")

// Image from gallery or camera
implementation("com.github.jkwiecien:EasyImage:1.4.0")

// Barcode and QR Scanner
// TODO: cannot upgrade, requires API 24 or higher
implementation("com.google.zxing:core:3.5.0")

implementation("com.journeyapps:zxing-android-embedded:3.6.0") { isTransitive = false }

// UI Component : ImageView with Zooming
implementation("com.github.chrisbanes:PhotoView:2.3.0")

// UI Component : Material Drawer
// https://github.com/mikepenz/MaterialDrawer/commit/3b2cb1db4c3b6afe639b0f3c21c03c1de68648a3
// TODO: We need minSdk 16 to update
implementation("com.mikepenz:materialdrawer:7.0.0") { isTransitive = true }

// DO NOT UPDATE : RecyclerViewCacheUtil removed, needs rework
implementation("com.mikepenz:fastadapter-commons:3.3.1@aar")

// UI Component : Font Icons
implementation("com.mikepenz:iconics-core:4.0.2@aar")
implementation("com.mikepenz:google-material-typeface:3.0.1.6.original-kotlin@aar")
implementation("com.github.CanHub:Android-Image-Cropper:3.1.3")

// UI Component : Chips Input
implementation("com.github.hootsuite:nachos:1.2.0")

// Crash analytics
implementation("io.sentry:sentry-android:6.2.1")
implementation("com.github.matomo-org:matomo-sdk-android:4.1.4")

// ShowCaseView dependency
implementation("com.github.mreram:showcaseview:1.0.5")

// Unit Testing
testImplementation("androidx.arch.core:core-testing:2.1.0")
testImplementation("junit:junit:4.13.2")
testImplementation("org.robolectric:robolectric:4.8.1")
testImplementation("org.mockito:mockito-core:4.6.1")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0")
testImplementation("org.mockito:mockito-junit-jupiter:4.6.1")
testImplementation("com.google.truth:truth:1.1.3")
testImplementation("com.google.truth.extensions:truth-java8-extension:1.1.3")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${coroutinesVersion}")

val junit5Bom = "5.8.2"
testImplementation(platform("org.junit:junit-bom:$junit5Bom"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")

// Instrumented tests
androidTestUtil("androidx.test:orchestrator:1.4.1")


androidTestImplementation("androidx.test:runner:1.4.0") { exclude("junit") }
androidTestImplementation("androidx.test:rules:1.4.0")

androidTestImplementation("androidx.test.ext:junit:1.1.3") { exclude("junit") }

androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
androidTestImplementation("androidx.test.espresso:espresso-intents:3.4.0")
androidTestImplementation("androidx.test.espresso:espresso-web:3.4.0")
androidTestImplementation("androidx.test.espresso:espresso-contrib:3.4.0") {
exclude(group = "com.android.support", module = "appcompat-v7")
exclude(group = "com.android.support", module = "support-v4")
exclude(group = "com.android.support", module = "design")
exclude(module = "recyclerview-v7")
}
androidTestImplementation("com.jraska:falcon:2.2.0")
androidTestImplementation("tools.fastlane:screengrab:2.1.1")
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${coroutinesVersion}")


resourcePlaceholders { files = listOf("xml/shortcuts.xml") }
}

kapt {
correctErrorTypes = true
arguments {
Expand Down
Loading

0 comments on commit d30e55f

Please sign in to comment.