Skip to content

Commit

Permalink
Develop (Ivy-Apps#2644)
Browse files Browse the repository at this point in the history
* WIP: Get rid of `Gson` and restructure `:ivy-core`

* Fix build errors caused by the `:ivy-core` restructure

* Move `Constants` from `:ivy-core` to `temp-legacy-code`

* Fix the KotlinxSerialization gradle setup

* WIP: Configure KotlinxSerialization

* WIP: Configure KotlinxSerialization

* KotlinxSerialization seems working

* Remove the Gson dependency

* Get rid of DangerJS

* Fix Detekt errors

* Re-structure `:ivy-core`

* Add a simple `IvyFeatures` API to turn on/off user settings

* Add empty `:ivy-core-ui` module

* WIP: Features screen

* Fix Detekt errors
  • Loading branch information
ILIYANGERMANOV authored Sep 17, 2023
1 parent 2e9b782 commit 99337c6
Show file tree
Hide file tree
Showing 301 changed files with 1,183 additions and 2,147 deletions.
9 changes: 0 additions & 9 deletions .danger/apk.md

This file was deleted.

43 changes: 0 additions & 43 deletions .danger/danger_apk.ts

This file was deleted.

32 changes: 0 additions & 32 deletions .danger/danger_detekt.ts

This file was deleted.

18 changes: 0 additions & 18 deletions .danger/danger_pr.ts

This file was deleted.

9 changes: 0 additions & 9 deletions .danger/detekt.md

This file was deleted.

14 changes: 0 additions & 14 deletions .danger/pr.md

This file was deleted.

8 changes: 0 additions & 8 deletions .github/workflows/apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,3 @@ jobs:
-F "reply_to_message_id=16118" \
-F "caption=$CAPTION" \
https://api.telegram.org/bot${{ secrets.BOTFATHER_TELEGRAM_BOT_TOKEN }}/sendDocument
- name: Comment APK on the PR with Danger
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: danger/[email protected]
with:
args: "--dangerfile .danger/danger_apk.ts"
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.IVYWALLET_BOT_GITHUB_PAT }}
20 changes: 0 additions & 20 deletions .github/workflows/danger_pr.yml

This file was deleted.

11 changes: 1 addition & 10 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,4 @@ jobs:
with:
name: detekt-report.html
path: build/reports/detekt/detekt.html
#------------------------------------------------------------------

- name: Comment Detekt results on the PR with Danger
if: (success() || failure()) && (github.event.pull_request.head.repo.full_name == github.repository)
uses: danger/[email protected]
with:
args: "--dangerfile .danger/danger_detekt.ts"
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.IVYWALLET_BOT_GITHUB_PAT }}

#------------------------------------------------------------------
3 changes: 1 addition & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ dependencies {
implementation(projects.screenSearch)
implementation(projects.screenTest)
implementation(projects.screenBalance)
implementation(projects.screenFeatures)

implementation(libs.bundles.kotlin)
implementation(libs.bundles.ktor)
Expand All @@ -165,8 +166,6 @@ dependencies {
implementation(libs.androidx.security)
implementation(libs.androidx.biometrics)

implementation(libs.gson)

implementation(libs.bundles.hilt)
kapt(libs.hilt.compiler)

Expand Down
18 changes: 1 addition & 17 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
-dontwarn com.google.errorprone.**
-dontwarn org.slf4j.impl.**

# Json serialization (GSON fixes)
-keepattributes Signature
-keep class com.google.gson.reflect.TypeToken { *; }
-keep class * extends com.google.gson.reflect.TypeToken
-keep class com.google.gson.** { *; }

# Keep inherited services.
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface * extends <1>
Expand All @@ -26,14 +20,4 @@

# R8 full mode strips generic signatures from return types if not kept.
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>

# If a class is used in some way by the application, and has fields annotated with @SerializedName
# and a no-args constructor, keep those fields and the constructor
# Based on https://issuetracker.google.com/issues/150189783#comment11
# See also https://github.com/google/gson/pull/2420#discussion_r1241813541 for a more detailed explanation
-if class *
-keepclasseswithmembers,allowobfuscation,allowoptimization class <1> {
<init>();
@com.google.gson.annotations.SerializedName <fields>;
}
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
8 changes: 6 additions & 2 deletions app/src/main/java/com/ivy/IvyNavGraph.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.ivy.balance.BalanceScreen
import com.ivy.budgets.BudgetScreen
import com.ivy.categories.CategoriesScreen
import com.ivy.exchangerates.ExchangeRatesScreen
import com.ivy.features.FeaturesScreenImpl
import com.ivy.importdata.csv.CSVScreen
import com.ivy.importdata.csvimport.ImportCSVScreen
import com.ivy.loans.loan.LoansScreen
Expand All @@ -19,6 +20,7 @@ import com.ivy.navigation.CategoriesScreen
import com.ivy.navigation.EditPlannedScreen
import com.ivy.navigation.EditTransactionScreen
import com.ivy.navigation.ExchangeRatesScreen
import com.ivy.navigation.FeaturesScreen
import com.ivy.navigation.ImportScreen
import com.ivy.navigation.ItemStatisticScreen
import com.ivy.navigation.LoanDetailsScreen
Expand Down Expand Up @@ -49,6 +51,9 @@ import com.ivy.wallet.ui.main.MainScreen
@Composable
fun BoxWithConstraintsScope.IvyNavGraph(screen: Screen?) {
when (screen) {
null -> {
// show nothing
}
is MainScreen -> MainScreen(screen = screen)
is OnboardingScreen -> OnboardingScreen(screen = screen)
is ExchangeRatesScreen -> ExchangeRatesScreen()
Expand All @@ -68,7 +73,6 @@ fun BoxWithConstraintsScope.IvyNavGraph(screen: Screen?) {
is LoanDetailsScreen -> LoanDetailsScreen(screen = screen)
is SearchScreen -> SearchScreen(screen = screen)
is CSVScreen -> CSVScreen(screen = screen)
null -> {
}
FeaturesScreen -> FeaturesScreenImpl()
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/ivy/wallet/IvyAppStarter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.ivy.wallet
import android.content.Context
import android.content.Intent
import com.ivy.core.AppStarter
import com.ivy.core.data.db.entity.TransactionType
import com.ivy.core.db.entity.TransactionType
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject

Expand Down
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 @@ -39,7 +39,7 @@ import com.google.android.gms.common.api.ApiException
import com.google.android.gms.tasks.Task
import com.google.android.play.core.review.ReviewManagerFactory
import com.ivy.IvyNavGraph
import com.ivy.core.Constants
import com.ivy.legacy.Constants
import com.ivy.core.RootScreen
import com.ivy.core.util.toEpochMilli
import com.ivy.design.api.IvyUI
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/ivy/wallet/RootViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.content.Intent
import androidx.biometric.BiometricPrompt
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.ivy.core.data.db.entity.TransactionType
import com.ivy.core.data.db.read.SettingsDao
import com.ivy.core.db.entity.TransactionType
import com.ivy.core.db.read.SettingsDao
import com.ivy.core.util.stringRes
import com.ivy.design.l0_system.Theme
import com.ivy.frp.test.TestIdlingResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import dagger.hilt.components.SingletonComponent

@Module
@InstallIn(SingletonComponent::class)
abstract class AppModuleBindings {
abstract class AppBindingsModule {
@Binds
abstract fun appStarter(appStarter: IvyAppStarter): AppStarter
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.ivy.wallet.migrations
import android.content.Context
import androidx.datastore.preferences.core.booleanPreferencesKey
import androidx.datastore.preferences.core.edit
import com.ivy.core.data.dataStore
import com.ivy.core.datastore.dataStore
import com.ivy.wallet.migrations.impl.DisableGitHubAutoBackupMigration
import dagger.Lazy
import dagger.hilt.android.qualifiers.ApplicationContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.ivy.wallet.migrations.impl
import android.content.Context
import androidx.datastore.preferences.core.edit
import androidx.work.WorkManager
import com.ivy.core.data.DatastoreKeys
import com.ivy.core.data.dataStore
import com.ivy.core.datastore.DatastoreKeys
import com.ivy.core.datastore.dataStore
import com.ivy.wallet.migrations.Migration
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/ivy/wallet/ui/main/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.ivy.home.HomeTab
import com.ivy.navigation.EditPlannedScreen
import com.ivy.navigation.EditTransactionScreen
import com.ivy.navigation.MainScreen
import com.ivy.core.data.db.entity.TransactionType
import com.ivy.core.db.entity.TransactionType
import com.ivy.wallet.domain.deprecated.logic.model.CreateAccountData
import com.ivy.wallet.ui.theme.modal.edit.AccountModal
import com.ivy.wallet.ui.theme.modal.edit.AccountModalData
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/ivy/wallet/ui/main/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.ivy.wallet.ui.main
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.ivy.core.data.db.read.SettingsDao
import com.ivy.core.db.read.SettingsDao
import com.ivy.core.event.AccountUpdatedEvent
import com.ivy.core.event.EventBus
import com.ivy.frp.test.TestIdlingResource
Expand Down
5 changes: 4 additions & 1 deletion buildSrc/src/main/kotlin/ivy.module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
plugins {
id("com.android.library")
id("kotlin-android")
id("kotlin-kapt") // TODO: Remove
id("kotlin-kapt") // TODO: Remove when we migrate to KSP
id("org.jetbrains.kotlin.android")
id("dagger.hilt.android.plugin")
id("com.google.devtools.ksp")
id("org.jetbrains.kotlin.plugin.serialization")
}

kotlin {
Expand Down Expand Up @@ -53,6 +54,8 @@ dependencies {
// TODO: Migrate to KSP when supported
kapt(catalog.library("hilt-compiler"))

implementation(catalog.library("kotlinx-serialization-json"))

testImplementation(libs.bundles.kotest)
testImplementation(catalog.bundle("kotlin-test"))
testImplementation(catalog.library("hilt-testing"))
Expand Down
Loading

0 comments on commit 99337c6

Please sign in to comment.