Skip to content

Commit

Permalink
[#586] Migrate to version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-conway committed Nov 4, 2024
1 parent cc18919 commit cd4325e
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 230 deletions.
69 changes: 20 additions & 49 deletions template-compose/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import org.jetbrains.kotlin.konan.properties.loadProperties

plugins {
id(Plugins.ANDROID_APPLICATION)
id(Plugins.KOTLIN_ANDROID)
id(Plugins.KOTLIN_KAPT)
id(Plugins.KOTLIN_PARCELIZE)
id(Plugins.HILT_ANDROID)
id(Plugins.KOVER)
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.hilt)
alias(libs.plugins.kover)
}

val signingProperties = loadProperties("$rootDir/signing.properties")
Expand Down Expand Up @@ -133,54 +133,25 @@ dependencies {

implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))

with(Dependencies.AndroidX) {
implementation(CORE_KTX)
implementation(LIFECYCLE_RUNTIME_KTX)
implementation(LIFECYCLE_RUNTIME_COMPOSE)
implementation(DATASTORE_PREFERENCES)
}

with(Dependencies.Compose) {
implementation(platform(BOM))
implementation(UI)
debugImplementation(UI_TOOLING)
implementation(UI_TOOLING_PREVIEW)
implementation(MATERIAL)
implementation(NAVIGATION)

implementation(ACCOMPANIST_PERMISSIONS)
}
implementation(libs.bundles.androidx)

with(Dependencies.Hilt) {
implementation(ANDROID)
implementation(NAVIGATION_COMPOSE)
kapt(COMPILER)
}
implementation(platform(libs.compose.bom))
implementation(libs.bundles.compose)
debugImplementation(libs.compose.ui.tooling)

with(Dependencies.Log) {
implementation(TIMBER)
implementation(libs.bundles.hilt)
kapt(libs.hilt.compiler)

debugImplementation(CHUCKER)
releaseImplementation(CHUCKER_NO_OP)
}
implementation(libs.timber)
debugImplementation(libs.chucker)
releaseImplementation(libs.chucker.no.op)

with(Dependencies.Util) {
implementation(COMMON_KTX)
}
implementation(libs.nimble.common)

with(Dependencies.Test) {
// Unit test
testImplementation(COROUTINES)
testImplementation(JUNIT)
testImplementation(KOTEST)
testImplementation(MOCKK)
testImplementation(TURBINE)

// UI test with Robolectric
testImplementation(platform(Dependencies.Compose.BOM))
testImplementation(COMPOSE_UI_TEST_JUNIT)
testImplementation(ROBOLECTRIC)
}
testImplementation(libs.bundles.unitTest)
testImplementation(libs.test.turbine)
testImplementation(platform(libs.compose.bom))
testImplementation(libs.bundles.implementationTest)
}

/*
Expand Down
18 changes: 10 additions & 8 deletions template-compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id(Plugins.ANDROID_APPLICATION) version Versions.GRADLE apply false
id(Plugins.ANDROID_LIBRARY) version Versions.GRADLE apply false
id(Plugins.KOTLIN_JVM) version Versions.KOTLIN apply false
id(Plugins.KOTLIN_ANDROID) version Versions.KOTLIN apply false
id(Plugins.HILT_ANDROID) version Versions.HILT apply false
id(Plugins.DETEKT) version Versions.DETEKT
id(Plugins.KOVER) version Versions.KOVER
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.detekt)
alias(libs.plugins.kover)
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}

detekt {
toolVersion = Versions.DETEKT
toolVersion = libs.versions.detekt.get()

source = files(
"app/src/main/java",
Expand Down
71 changes: 0 additions & 71 deletions template-compose/buildSrc/src/main/java/Dependencies.kt

This file was deleted.

16 changes: 0 additions & 16 deletions template-compose/buildSrc/src/main/java/Plugins.kt

This file was deleted.

39 changes: 0 additions & 39 deletions template-compose/buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,5 @@ object Versions {
const val ANDROID_VERSION_CODE = 1
const val ANDROID_VERSION_NAME = "1.0.0"

const val ACCOMPANIST = "0.30.1"

const val CHUCKER = "3.5.2"
const val COMMON_KTX = "0.1.1"
const val COMPOSE_BOM = "2023.09.02"
const val COMPOSE_COMPILER = "1.5.3"
const val COMPOSE_NAVIGATION = "2.5.3"
const val CORE = "1.4.0"
const val CORE_KTX = "1.10.1"

const val DATASTORE_PREFERENCES = "1.0.0"
const val DETEKT = "1.21.0"

const val GRADLE = "8.1.2"

const val HILT = "2.48"
const val HILT_NAVIGATION_COMPOSE = "1.0.0"

const val JAVAX_INJECT = "1"
const val JUNIT = "4.13.2"

const val KOTEST = "5.6.2"
const val KOTLIN = "1.9.10"
const val KOTLIN_COROUTINES = "1.7.1"
const val KOVER = "0.7.3"

const val LIFECYCLE = "2.6.1"

const val MOCKK = "1.13.5"
const val MOSHI = "1.12.0"

const val OKHTTP = "4.11.0"

const val RETROFIT = "2.9.0"
const val ROBOLECTRIC = "4.10.2"

const val SECURITY_CRYPTO = "1.0.0"

const val TIMBER = "4.7.1"
const val TURBINE = "0.13.0"
}
45 changes: 14 additions & 31 deletions template-compose/data/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id(Plugins.ANDROID_LIBRARY)
id(Plugins.KOTLIN_ANDROID)
id(Plugins.KOVER)
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kover)
}

android {
Expand Down Expand Up @@ -46,35 +46,18 @@ android {
dependencies {
implementation(project(Modules.DOMAIN))

with(Dependencies.AndroidX) {
implementation(CORE_KTX)
implementation(DATASTORE_PREFERENCES)
implementation(SECURITY_CRYPTO)
}

with(Dependencies.Hilt) {
implementation(JAVAX_INJECT)
}
implementation(libs.androidx.core)
implementation(libs.androidx.datastorePreferences)
implementation(libs.androidx.securityCrypto)

with(Dependencies.Network) {
api(RETROFIT)
api(RETROFIT_CONVERTER_MOSHI)
implementation(libs.javax.inject)

api(OKHTTP)
api(OKHTTP_LOGGING_INTERCEPTOR)
api(libs.bundles.retrofit)
api(libs.bundles.okhttp)
api(libs.moshi)
implementation(libs.bundles.moshi)

api(MOSHI)
implementation(MOSHI_ADAPTERS)
implementation(MOSHI_KOTLIN)
}

with(Dependencies.Test) {
testImplementation(COROUTINES)
testImplementation(JUNIT)
testImplementation(KOTEST)
testImplementation(MOCKK)
testImplementation(ROBOLECTRIC)
testImplementation(TEST_CORE)
testImplementation(TURBINE)
}
testImplementation(libs.bundles.unitTest)
testImplementation(libs.test.turbine)
testImplementation(libs.test.robolectric)
}
22 changes: 6 additions & 16 deletions template-compose/domain/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id(Plugins.JAVA_LIBRARY)
id(Plugins.KOTLIN_JVM)
id(Plugins.KOVER)
id(libs.plugins.javaLibrary.get().pluginId)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kover)
}

java {
Expand All @@ -10,18 +10,8 @@ java {
}

dependencies {
with(Dependencies.Kotlin) {
implementation(COROUTINES_CORE)
}
implementation(libs.kotlin.coroutines.core)
implementation(libs.javax.inject)

with(Dependencies.Hilt) {
implementation(JAVAX_INJECT)
}

with(Dependencies.Test) {
testImplementation(COROUTINES)
testImplementation(JUNIT)
testImplementation(KOTEST)
testImplementation(MOCKK)
}
testImplementation(libs.bundles.unitTest)
}
Loading

0 comments on commit cd4325e

Please sign in to comment.