Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Modularization and fixes (#3092)
Browse files Browse the repository at this point in the history
* Add a script to generate the modules graph

* Fix unnecessary commas in `ExportCsvUseCase`

* Fix the number formatting (not tested)

* Fix build errors and remove Kover config

* Fix build errors

* WIP: Simplify the `:shared` modules

* Fix Detekt errors

* Update Paparazzi snapshots

* Fix the modules graph script

* Fix Detekt

* Add Compose Stability baseline

* Make a class `@Immutable`
  • Loading branch information
ILIYANGERMANOV authored Apr 5, 2024
1 parent 82010c3 commit a041a13
Show file tree
Hide file tree
Showing 979 changed files with 1,998 additions and 434 deletions.
204 changes: 204 additions & 0 deletions all_modules.gv
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
digraph G {
":app" -> ":screen:attributions"
":app" -> ":screen:balance"
":app" -> ":screen:budgets"
":app" -> ":screen:categories"
":app" -> ":screen:contributors"
":app" -> ":screen:edit-transaction" [color=red style=bold]
":app" -> ":screen:exchange-rates"
":app" -> ":screen:features"
":app" -> ":screen:home"
":app" -> ":screen:import-data"
":app" -> ":screen:loans"
":app" -> ":screen:main"
":app" -> ":screen:onboarding"
":app" -> ":screen:piechart"
":app" -> ":screen:planned-payments"
":app" -> ":screen:releases"
":app" -> ":screen:reports"
":app" -> ":screen:search"
":app" -> ":screen:settings"
":app" -> ":screen:transactions"
":app" -> ":shared:base"
":app" -> ":shared:data"
":app" -> ":shared:domain"
":app" -> ":shared:ui:navigation"
":app" -> ":temp:legacy-code"
":app" -> ":temp:old-design"
":app" -> ":widget:add-transaction"
":app" -> ":widget:balance"
":screen:attributions" -> ":shared:base"
":screen:attributions" -> ":shared:domain"
":screen:attributions" -> ":shared:ui:core"
":screen:attributions" -> ":shared:ui:navigation"
":screen:balance" -> ":shared:base"
":screen:balance" -> ":shared:domain"
":screen:balance" -> ":shared:ui:core"
":screen:balance" -> ":shared:ui:navigation"
":screen:balance" -> ":temp:legacy-code"
":screen:balance" -> ":temp:old-design"
":screen:budgets" -> ":shared:base"
":screen:budgets" -> ":shared:data"
":screen:budgets" -> ":shared:domain"
":screen:budgets" -> ":shared:ui:core"
":screen:budgets" -> ":shared:ui:navigation"
":screen:budgets" -> ":temp:legacy-code"
":screen:budgets" -> ":temp:old-design"
":screen:categories" -> ":shared:base"
":screen:categories" -> ":shared:data"
":screen:categories" -> ":shared:domain"
":screen:categories" -> ":shared:ui:core"
":screen:categories" -> ":shared:ui:navigation"
":screen:categories" -> ":temp:legacy-code"
":screen:categories" -> ":temp:old-design"
":screen:contributors" -> ":shared:base"
":screen:contributors" -> ":shared:domain"
":screen:contributors" -> ":shared:ui:core"
":screen:contributors" -> ":shared:ui:navigation"
":screen:edit-transaction" -> ":shared:base"
":screen:edit-transaction" -> ":shared:data"
":screen:edit-transaction" -> ":shared:domain"
":screen:edit-transaction" -> ":shared:ui:core"
":screen:edit-transaction" -> ":shared:ui:navigation"
":screen:edit-transaction" -> ":temp:legacy-code"
":screen:edit-transaction" -> ":temp:old-design"
":screen:edit-transaction" -> ":widget:balance" [color=red style=bold]
":screen:exchange-rates" -> ":shared:base"
":screen:exchange-rates" -> ":shared:data"
":screen:exchange-rates" -> ":shared:domain"
":screen:exchange-rates" -> ":shared:ui:core"
":screen:exchange-rates" -> ":shared:ui:navigation"
":screen:exchange-rates" -> ":temp:legacy-code"
":screen:exchange-rates" -> ":temp:old-design"
":screen:features" -> ":shared:base"
":screen:features" -> ":shared:domain"
":screen:features" -> ":shared:ui:core"
":screen:features" -> ":shared:ui:navigation"
":screen:home" -> ":shared:base"
":screen:home" -> ":shared:data"
":screen:home" -> ":shared:domain"
":screen:home" -> ":shared:ui:core"
":screen:home" -> ":shared:ui:navigation"
":screen:home" -> ":temp:legacy-code"
":screen:home" -> ":temp:old-design"
":screen:home" -> ":widget:add-transaction"
":screen:import-data" -> ":screen:onboarding"
":screen:import-data" -> ":shared:base"
":screen:import-data" -> ":shared:data"
":screen:import-data" -> ":shared:domain"
":screen:import-data" -> ":shared:ui:core"
":screen:import-data" -> ":shared:ui:navigation"
":screen:import-data" -> ":temp:legacy-code"
":screen:import-data" -> ":temp:old-design"
":screen:loans" -> ":shared:base"
":screen:loans" -> ":shared:data"
":screen:loans" -> ":shared:domain"
":screen:loans" -> ":shared:ui:core"
":screen:loans" -> ":shared:ui:navigation"
":screen:loans" -> ":temp:legacy-code"
":screen:loans" -> ":temp:old-design"
":screen:main" -> ":screen:accounts"
":screen:main" -> ":screen:home"
":screen:main" -> ":shared:base"
":screen:main" -> ":shared:data"
":screen:main" -> ":shared:domain"
":screen:main" -> ":shared:ui:core"
":screen:main" -> ":shared:ui:navigation"
":screen:main" -> ":temp:legacy-code"
":screen:main" -> ":temp:old-design"
":screen:onboarding" -> ":shared:base"
":screen:onboarding" -> ":shared:data"
":screen:onboarding" -> ":shared:domain"
":screen:onboarding" -> ":shared:ui:core"
":screen:onboarding" -> ":shared:ui:navigation"
":screen:onboarding" -> ":temp:legacy-code"
":screen:onboarding" -> ":temp:old-design"
":screen:piechart" -> ":shared:base"
":screen:piechart" -> ":shared:data"
":screen:piechart" -> ":shared:domain"
":screen:piechart" -> ":shared:ui:core"
":screen:piechart" -> ":shared:ui:navigation"
":screen:piechart" -> ":temp:legacy-code"
":screen:piechart" -> ":temp:old-design"
":screen:planned-payments" -> ":shared:base"
":screen:planned-payments" -> ":shared:data"
":screen:planned-payments" -> ":shared:domain"
":screen:planned-payments" -> ":shared:ui:core"
":screen:planned-payments" -> ":shared:ui:navigation"
":screen:planned-payments" -> ":temp:legacy-code"
":screen:planned-payments" -> ":temp:old-design"
":screen:releases" -> ":shared:base"
":screen:releases" -> ":shared:domain"
":screen:releases" -> ":shared:ui:core"
":screen:releases" -> ":shared:ui:navigation"
":screen:reports" -> ":shared:base"
":screen:reports" -> ":shared:data"
":screen:reports" -> ":shared:domain"
":screen:reports" -> ":shared:ui:core"
":screen:reports" -> ":shared:ui:navigation"
":screen:reports" -> ":temp:legacy-code"
":screen:reports" -> ":temp:old-design"
":screen:search" -> ":shared:base"
":screen:search" -> ":shared:data"
":screen:search" -> ":shared:domain"
":screen:search" -> ":shared:ui:core"
":screen:search" -> ":shared:ui:navigation"
":screen:search" -> ":temp:legacy-code"
":screen:search" -> ":temp:old-design"
":screen:settings" -> ":shared:base"
":screen:settings" -> ":shared:data"
":screen:settings" -> ":shared:domain"
":screen:settings" -> ":shared:ui:core"
":screen:settings" -> ":shared:ui:navigation"
":screen:settings" -> ":temp:legacy-code"
":screen:settings" -> ":temp:old-design"
":screen:settings" -> ":widget:balance"
":screen:transactions" -> ":shared:base"
":screen:transactions" -> ":shared:data"
":screen:transactions" -> ":shared:domain"
":screen:transactions" -> ":shared:ui:core"
":screen:transactions" -> ":shared:ui:navigation"
":screen:transactions" -> ":temp:legacy-code"
":screen:transactions" -> ":temp:old-design"
":shared:data" -> ":shared:base" [color=red style=bold]
":shared:domain" -> ":shared:base"
":shared:domain" -> ":shared:data" [color=red style=bold]
":shared:ui:navigation" -> ":shared:base"
":shared:ui:navigation" -> ":shared:domain"
":shared:ui:navigation" -> ":shared:ui:core" [color=red style=bold]
":temp:legacy-code" -> ":shared:base"
":temp:legacy-code" -> ":shared:data"
":temp:legacy-code" -> ":shared:domain"
":temp:legacy-code" -> ":shared:ui:core"
":temp:legacy-code" -> ":shared:ui:navigation" [color=red style=bold]
":temp:legacy-code" -> ":temp:old-design"
":temp:old-design" -> ":shared:base"
":temp:old-design" -> ":shared:ui:core"
":temp:old-design" -> ":shared:domain"
":widget:add-transaction" -> ":shared:base"
":widget:add-transaction" -> ":shared:domain"
":widget:add-transaction" -> ":shared:ui:core"
":widget:add-transaction" -> ":shared:ui:navigation"
":widget:add-transaction" -> ":widget:shared-base"
":widget:balance" -> ":shared:base"
":widget:balance" -> ":shared:domain"
":widget:balance" -> ":shared:ui:core"
":widget:balance" -> ":shared:ui:navigation"
":widget:balance" -> ":temp:old-design"
":widget:balance" -> ":widget:shared-base"
":widget:balance" -> ":temp:legacy-code" [color=red style=bold]
":shared:ui:core" -> ":shared:domain" [color=red style=bold]
":screen:accounts" -> ":shared:base"
":screen:accounts" -> ":shared:data"
":screen:accounts" -> ":shared:domain"
":screen:accounts" -> ":shared:ui:core"
":screen:accounts" -> ":shared:ui:navigation"
":screen:accounts" -> ":temp:legacy-code"
":screen:accounts" -> ":temp:old-design"
":widget:shared-base" -> ":shared:base"
":widget:shared-base" -> ":shared:domain"
":ci-actions:compose-stability" -> ":ci-actions:base"
":ci-actions:issue-assign" -> ":ci-actions:base"
":ci-actions:issue-create-comment" -> ":ci-actions:base"
":shared:ui:testing" -> ":shared:ui:core"
}
53 changes: 6 additions & 47 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ plugins {
id("dagger.hilt.android.plugin")
id("org.jetbrains.kotlin.plugin.serialization")
id("com.google.devtools.ksp")

id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
}
Expand Down Expand Up @@ -125,15 +124,13 @@ android {
}

dependencies {
implementation(projects.shared.base)
implementation(projects.shared.data)
implementation(projects.shared.domain)
implementation(projects.shared.navigation)

implementation(projects.screen.attributions)
implementation(projects.screen.balance)
implementation(projects.screen.budgets)
implementation(projects.screen.categories)
implementation(projects.screen.contributors)
implementation(projects.screen.editTransaction)
implementation(projects.screen.exchangeRates)
implementation(projects.screen.features)
implementation(projects.screen.home)
Expand All @@ -147,8 +144,11 @@ dependencies {
implementation(projects.screen.reports)
implementation(projects.screen.search)
implementation(projects.screen.settings)
implementation(projects.screen.editTransaction)
implementation(projects.screen.transactions)
implementation(projects.shared.base)
implementation(projects.shared.data)
implementation(projects.shared.domain)
implementation(projects.shared.ui.navigation)
implementation(projects.temp.legacyCode)
implementation(projects.temp.oldDesign)
implementation(projects.widget.addTransaction)
Expand Down Expand Up @@ -184,44 +184,3 @@ dependencies {

lintChecks(libs.slack.lint.compose)
}

dependencies {
koverReport {
defaults {
mergeWith("debug")
html {
onCheck = false
setReportDir(layout.buildDirectory.dir("artifacts/reports/kover/coverageResults"))
}
}
}

kover(projects.shared.base)
kover(projects.shared.data)
kover(projects.shared.domain)
kover(projects.shared.navigation)
kover(projects.shared.resources)
kover(projects.widget.sharedBase)
kover(projects.screen.attributions)
kover(projects.screen.balance)
kover(projects.screen.budgets)
kover(projects.screen.categories)
kover(projects.screen.contributors)
kover(projects.screen.exchangeRates)
kover(projects.screen.features)
kover(projects.screen.home)
kover(projects.screen.importData)
kover(projects.screen.loans)
kover(projects.screen.main)
kover(projects.screen.onboarding)
kover(projects.screen.piechart)
kover(projects.screen.plannedPayments)
kover(projects.screen.releases)
kover(projects.screen.reports)
kover(projects.screen.search)
kover(projects.screen.settings)
kover(projects.screen.editTransaction)
kover(projects.screen.transactions)
kover(projects.widget.addTransaction)
kover(projects.widget.balance)
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/ivy/wallet/RootActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import com.ivy.legacy.utils.simpleActivityForResultLauncher
import com.ivy.legacy.utils.timeNowLocal
import com.ivy.navigation.Navigation
import com.ivy.navigation.NavigationRoot
import com.ivy.resources.R
import com.ivy.ui.R
import com.ivy.wallet.ui.applocked.AppLockedScreen
import com.ivy.widget.balance.WalletBalanceWidgetReceiver
import com.ivy.widget.transaction.AddTransactionWidget
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/ivy/wallet/RootViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.ivy.navigation.EditTransactionScreen
import com.ivy.navigation.MainScreen
import com.ivy.navigation.Navigation
import com.ivy.navigation.OnboardingScreen
import com.ivy.resources.R
import com.ivy.ui.R
import com.ivy.wallet.domain.deprecated.logic.notification.TransactionReminderLogic
import com.ivy.wallet.migrations.MigrationsManager
import dagger.hilt.android.lifecycle.HiltViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import com.ivy.design.l0_system.UI
import com.ivy.design.l0_system.style
import com.ivy.legacy.IvyWalletPreview
import com.ivy.legacy.utils.hasLockScreen
import com.ivy.resources.R
import com.ivy.ui.R
import com.ivy.wallet.ui.theme.Gray
import com.ivy.wallet.ui.theme.White
import com.ivy.wallet.ui.theme.components.IvyButton
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
// ./gradlew detekt // Simple report in the console
// ./gradlew detektFormat // To check with enabled auto-correction
id("ivy.detekt")
id("com.jraska.module.graph.assertion")

alias(libs.plugins.gradleWrapperUpgrade)

Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies {
implementation(libs.cashapp.molecule.plugin)
implementation(libs.room.plugin)
implementation(libs.paparazzi.plugin)
implementation(libs.module.graph.plugin)

// Make version catalog available in precompiled scripts
// https://github.com/gradle/gradle/issues/15383#issuecomment-1567461389
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ com.ivy.legacy.utils.formatLocalTime
com.ivy.legacy.utils.rememberSwipeListenerState
com.ivy.legacy.utils.keyboardVisibleState
com.ivy.legacy.utils.UiText.asString
com.ivy.ui.rememberScrollPositionListState
com.ivy.navigation.navigation
com.ivy.navigation.screenScopedViewModel
com.ivy.common.ui.rememberScrollPositionListState
com.ivy.data.datastore.datastore
com.ivy.domain.features.BoolFeature.asEnabledState
com.ivy.importdata.csv.ImportUI
Expand All @@ -101,11 +101,11 @@ com.ivy.onboarding.steps.Accounts
com.ivy.onboarding.steps.OnboardingCategories
com.ivy.onboarding.steps.Categories
com.ivy.reports.FilterOverlay
com.ivy.reports.OthersFilter
com.ivy.reports.TypeFilter
com.ivy.reports.TypeFilterCheckbox
com.ivy.reports.PeriodFilter
com.ivy.reports.AccountsFilter
com.ivy.reports.CategoriesFilter
com.ivy.reports.AmountFilter
com.ivy.reports.KeywordsFilter
com.ivy.reports.OthersFilter
com.ivy.reports.KeywordsFilter
Loading

0 comments on commit a041a13

Please sign in to comment.