From f3a4d51519743a8ea92acde2876e5cb6aef736cb Mon Sep 17 00:00:00 2001 From: Chingiz Date: Thu, 29 Jun 2023 16:26:20 +0600 Subject: [PATCH 1/2] NO-TICKET - Updated libs and moved all them to [Dependencies.kt] --- .scripts/dependencies.gradle | 2 - app/build.gradle.kts | 156 +++++-------- .../history/ui/token/TokenHistoryFragment.kt | 3 + .../ui/token/adapter/HistoryAdapter.kt | 3 + .../home/ui/select/SelectTokenViewHolder.kt | 3 + .../ui/NewTransactionProgressBottomSheet.kt | 6 + .../transaction/ui/ProgressBottomSheet.kt | 9 + build.gradle | 53 ----- build.gradle.kts | 56 +++++ buildSrc/build.gradle.kts | 6 +- buildSrc/src/main/java/Dependencies.kt | 208 ++++++++++++++++-- buildSrc/src/main/java/Versions.kt | 4 +- 12 files changed, 322 insertions(+), 187 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts diff --git a/.scripts/dependencies.gradle b/.scripts/dependencies.gradle index d4b7884771..b032790e6b 100644 --- a/.scripts/dependencies.gradle +++ b/.scripts/dependencies.gradle @@ -5,6 +5,4 @@ ext { // https://github.com/shyiko/ktlint ktlintVersion = '0.45.2' - - kotlinVersion = '1.7.20' } \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index dff3eca9e8..d723e18167 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -92,130 +92,72 @@ dependencies { implementation(files("libs/borshj-0.0.0.jar")) - Dependencies.baseAndroidLibraries.forEach { implementation(it) } - Dependencies.adapterDelegatesLibraries.forEach { implementation(it) } - - implementation("androidx.biometric:biometric:1.1.0") - implementation("androidx.browser:browser:1.4.0") - implementation("org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlinVersion}") - - val coroutinesVersion = "1.6.2" - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion") - - val work_version = "2.7.1" - implementation("androidx.work:work-runtime-ktx:$work_version") - - // https://github.com/dm77/barcodescanner - implementation("me.dm7.barcodescanner:zxing:1.9.8") - // https://github.com/JakeWharton/ThreeTenABP - implementation("com.jakewharton.threetenabp:threetenabp:1.3.0") + implementation(Dependencies.kotlinReflect) - val retrofitVersion = "2.9.0" - implementation("com.squareup.retrofit2:retrofit:$retrofitVersion") - implementation("com.squareup.retrofit2:converter-gson:$retrofitVersion") - implementation("com.squareup.retrofit2:converter-scalars:$retrofitVersion") - - val okHttpVersion = "4.9.3" - implementation("com.squareup.okhttp3:okhttp:$okHttpVersion") - implementation("com.squareup.okhttp3:logging-interceptor:$okHttpVersion") + // Android common + Dependencies.baseAndroidLibraries.forEach { implementation(it) } - // Import the BoM for the Firebase platform - implementation(platform("com.google.firebase:firebase-bom:31.1.1")) + // Adapter delegates + Dependencies.adapterDelegatesLibraries.forEach { implementation(it) } - // Declare the dependencies for the Crashlytics and Analytics libraries - // When using the BoM, you don't specify versions in Firebase library dependencies - implementation("com.google.firebase:firebase-crashlytics") - implementation("com.google.firebase:firebase-analytics-ktx") - implementation("com.google.firebase:firebase-messaging-ktx") - implementation("com.google.firebase:firebase-config") + // Coroutines + Dependencies.coroutineLibraries.forEach { implementation(it) } - implementation("io.intercom.android:intercom-sdk:14.0.0") + // Retrofit + Dependencies.retrofitLibraries.forEach { implementation(it) } - implementation("com.amplitude:android-sdk:2.35.3") + // Room + implementation(Dependencies.roomRuntime) + implementation(Dependencies.roomKtx) + kapt(Dependencies.roomCompiler) - implementation("com.google.android.gms:play-services-base:18.1.0") + // Firebase + implementation(platform(Dependencies.firebaseBom)) + Dependencies.firebaseLibraries.forEach { implementation(it) } - // Debug drawer - val debugDrawerVersion = "0.8.0" - implementation("io.palaima.debugdrawer:debugdrawer-timber:$debugDrawerVersion") + // Google Play + Dependencies.googlePlayLibraries.forEach { implementation(it) } // Glide - implementation("com.github.bumptech.glide:glide:4.12.0") - kapt("com.github.bumptech.glide:compiler:4.12.0") - implementation("com.caverock:androidsvg-aar:1.4") - - // Room - val roomVersion = "2.4.3" - implementation("androidx.room:room-runtime:$roomVersion") - implementation("androidx.room:room-ktx:$roomVersion") - kapt("androidx.room:room-compiler:$roomVersion") + implementation(Dependencies.glide) + implementation(Dependencies.caverockSvg) + kapt(Dependencies.glideCompiler) // Lottie - val lottieVersion = "4.0.0" - implementation("com.airbnb.android:lottie:$lottieVersion") - - + implementation(Dependencies.lottie) // dots indicator - implementation("com.tbuonomo:dotsindicator:4.3") - - // Google Play Auth - implementation("com.google.android.gms:play-services-auth:20.3.0") + implementation(Dependencies.dotsIndicator) // AppsFlyer - implementation("com.appsflyer:af-android-sdk:6.9.0") - implementation("androidx.ads:ads-identifier:1.0.0-alpha04") - implementation("com.android.installreferrer:installreferrer:2.2") - - // TickerView - implementation("com.robinhood.ticker:ticker:2.0.4") - implementation("androidx.core:core-splashscreen:1.0.0") - - implementation("io.michaelrocks:libphonenumber-android:8.12.52") + Dependencies.appsFlyerLibraries.forEach { implementation(it) } // Striga SDK https://developers.sumsub.com/msdk/android/changelog.html - implementation ("com.sumsub.sns:idensic-mobile-sdk:1.25.0") - - // core - testImplementation("androidx.test:core-ktx:1.5.0") - testImplementation("androidx.test.ext:junit-ktx:1.1.5") - testImplementation("androidx.arch.core:core-testing:2.2.0") - // https://github.com/mockk/mockk - testImplementation("io.mockk:mockk:1.12.0") - // https://mvnrepository.com/artifact/junit/junit - testImplementation("junit:junit:4.13.2") - // https://github.com/robolectric/robolectric - testImplementation("org.robolectric:robolectric:4.7.3") - - implementation("com.lokalise.android:sdk:2.1.1") { - isTransitive = true - } - // Coroutines support - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion") - - // Koin Test features - val koinVersion = "3.2.0" - testImplementation("io.insert-koin:koin-test:$koinVersion") - testImplementation("io.insert-koin:koin-test-junit4:$koinVersion") - - testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.25") - testImplementation("org.slf4j:slf4j-nop:1.7.30") - - testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2") - - testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.8.2") { + implementation(Dependencies.strigaSdk) + + // Utils + implementation(Dependencies.libphonenumber) + implementation(Dependencies.lokalise) { isTransitive = true } + implementation(Dependencies.workRuntimeKtx) + implementation(Dependencies.barcodeScanner) + implementation(Dependencies.threetenabp) + implementation(Dependencies.intercom) + implementation(Dependencies.amplitude) + implementation(Dependencies.debugDrawer) + implementation(Dependencies.tickerView) + + // Core testing + Dependencies.coreTestingLibraries.forEach { testImplementation(it) } + + // Koin testing + Dependencies.koinTestingLibraries.forEach { testImplementation(it) } + + // Other testing tools + Dependencies.otherTestingLibraries.forEach { testImplementation(it) } + + // Runtime only testing tools + implementation(Dependencies.junitPlatform) { because("This lib comes shipped with the IDE and it possible that newer versions of JUnit 5 maybe be incompatible with the version of junit-platform-launcher shipped with the IDE.") } - val junitJupiterVersion = "5.8.2" - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion") - testRuntimeOnly("org.junit.vintage:junit-vintage-engine:$junitJupiterVersion") - - // timezone for unit testing - testImplementation("org.threeten:threetenbp:1.6.8") - - // XmlPullParser goes with android.jar and doesn't work in unit tests - testImplementation("xmlpull:xmlpull:1.1.3.4a@jar") - // KXmlParser needs for XmlPullParserFactory - testImplementation("net.sf.kxml:kxml2:2.3.0") + Dependencies.junitRuntimeOnlyLibraries.forEach { testRuntimeOnly(it) } } diff --git a/app/src/main/java/org/p2p/wallet/history/ui/token/TokenHistoryFragment.kt b/app/src/main/java/org/p2p/wallet/history/ui/token/TokenHistoryFragment.kt index 341b4208a9..e3f6cd721e 100644 --- a/app/src/main/java/org/p2p/wallet/history/ui/token/TokenHistoryFragment.kt +++ b/app/src/main/java/org/p2p/wallet/history/ui/token/TokenHistoryFragment.kt @@ -170,6 +170,9 @@ class TokenHistoryFragment : sellAnalytics.logTokenScreenActionClicked() replaceFragment(SellPayloadFragment.create()) } + else -> { + // TODO: WHAT SHOULD BE HERE? + } } } diff --git a/app/src/main/java/org/p2p/wallet/history/ui/token/adapter/HistoryAdapter.kt b/app/src/main/java/org/p2p/wallet/history/ui/token/adapter/HistoryAdapter.kt index b3e6cd774b..adc0effc1d 100644 --- a/app/src/main/java/org/p2p/wallet/history/ui/token/adapter/HistoryAdapter.kt +++ b/app/src/main/java/org/p2p/wallet/history/ui/token/adapter/HistoryAdapter.kt @@ -75,6 +75,9 @@ class HistoryAdapter( is HistoryItem.BridgeSendItem -> { holder.onBind(item) } + else -> { + // TODO: WHAT SHOULD BE HERE? + } } } } diff --git a/app/src/main/java/org/p2p/wallet/home/ui/select/SelectTokenViewHolder.kt b/app/src/main/java/org/p2p/wallet/home/ui/select/SelectTokenViewHolder.kt index 8be90c48d9..256fbe577a 100644 --- a/app/src/main/java/org/p2p/wallet/home/ui/select/SelectTokenViewHolder.kt +++ b/app/src/main/java/org/p2p/wallet/home/ui/select/SelectTokenViewHolder.kt @@ -68,6 +68,9 @@ class SelectTokenViewHolder( is Token.Other -> { endAmountView.isVisible = false } + is Token.Eth -> { + // do nothing + } } } diff --git a/app/src/main/java/org/p2p/wallet/transaction/ui/NewTransactionProgressBottomSheet.kt b/app/src/main/java/org/p2p/wallet/transaction/ui/NewTransactionProgressBottomSheet.kt index 4204f63b21..a63dc863e5 100644 --- a/app/src/main/java/org/p2p/wallet/transaction/ui/NewTransactionProgressBottomSheet.kt +++ b/app/src/main/java/org/p2p/wallet/transaction/ui/NewTransactionProgressBottomSheet.kt @@ -154,6 +154,12 @@ class NewTransactionProgressBottomSheet : BottomSheetDialogFragment() { is TransactionState.ClaimProgress -> handleClaimProgress(state) is TransactionState.BridgeSendSuccess -> handleSendSuccess(state) is TransactionState.Error -> handleError(state) + is TransactionState.JupiterSwapSuccess -> { + // TODO: WHAT SHOULD BE HERE? + } + is TransactionState.JupiterSwapFailed -> { + // TODO: WHAT SHOULD BE HERE? + } } } } diff --git a/app/src/main/java/org/p2p/wallet/transaction/ui/ProgressBottomSheet.kt b/app/src/main/java/org/p2p/wallet/transaction/ui/ProgressBottomSheet.kt index 84add78517..a5ef1a0571 100644 --- a/app/src/main/java/org/p2p/wallet/transaction/ui/ProgressBottomSheet.kt +++ b/app/src/main/java/org/p2p/wallet/transaction/ui/ProgressBottomSheet.kt @@ -99,6 +99,15 @@ class ProgressBottomSheet : NonDraggableBottomSheetDialogFragment() { is TransactionState.SendSuccess -> handleSendSuccess(state) is TransactionState.SwapSuccess -> handleSwapSuccess(state) is TransactionState.Error -> handleError(state) + is TransactionState.JupiterSwapSuccess -> { + // TODO: WHAT SHOULD BE HERE? + } + is TransactionState.JupiterSwapFailed -> { + // TODO: WHAT SHOULD BE HERE? + } + else -> { + // TODO: WHAT SHOULD BE HERE? + } } } } diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 3f5236463d..0000000000 --- a/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -buildscript { - apply from: "$project.rootDir/.scripts/dependencies.gradle" - apply from: "$project.rootDir/.scripts/changelog.gradle" - - - repositories { - google() - mavenCentral() - maven { url "https://maven.google.com/" } - maven { url 'https://jitpack.io' } - } - dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5' - classpath 'com.google.gms:google-services:4.3.15' - } -} - -allprojects { - repositories { - google() - mavenCentral() - maven { url 'https://jitpack.io' } - maven { url "https://maven.google.com/" } - maven { url "https://maven.lokalise.com" } - maven { url "https://maven.sumsub.com/repository/maven-public/" } - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} - -task installGitHook(type: Copy) { - def useGitHooks = use_git_hooks - if (rootProject.file('local.properties').exists()) { - def localProperties = new Properties() - localProperties.load(new FileInputStream(rootProject.file('local.properties'))) - useGitHooks = localProperties.getOrDefault('use_git_hooks', use_git_hooks) - } - - logger.quiet "(GIT_HOOKS): use_git_hooks=$useGitHooks" - if (useGitHooks) { - from rootProject.file('scripts/pre-commit') - into rootProject.file('.git/hooks') - fileMode 0777 - } else { - rootProject.file('.git/hooks/pre-commit').delete() - } -} - -tasks.getByPath(':app:preBuild').dependsOn installGitHook \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000..1bbf526cda --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,56 @@ +apply { + from("${project.rootDir}/.scripts/dependencies.gradle") + from("${project.rootDir}/.scripts/changelog.gradle") +} + +buildscript { + + repositories { + google() + mavenCentral() + maven(url = "https://maven.google.com/") + maven(url = "https://jitpack.io/") + } + + dependencies { + classpath("com.android.tools.build:gradle:${Versions.buildGradleVersion}") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlinGradlePluginVersion}") + classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.6") + classpath("com.google.gms:google-services:4.3.15") + } +} + +allprojects { + repositories { + google() + mavenCentral() + maven(url = "https://jitpack.io/") + maven(url = "https://maven.google.com/") + maven(url = "https://maven.lokalise.com/") + maven(url = "https://maven.sumsub.com/repository/maven-public/") + } +} + +tasks.register("clean", Delete::class) { + delete(rootProject.buildDir) +} + +tasks.register("installGitHook") { + val useGitHooks = extra["use_git_hooks"]?.toString()?.toBoolean() ?: false + + logger.quiet("(GIT_HOOKS): use_git_hooks=$useGitHooks") + if (useGitHooks) { + from(rootProject.file("scripts/pre-commit")) + into(rootProject.file(".git/hooks")) + // Set file mode to executable + rootProject.file(".git/hooks/pre-commit").setExecutable(true) + } else { + rootProject.file(".git/hooks/pre-commit").delete() + } +} + +gradle.projectsEvaluated { + tasks.withType { + dependsOn("installGitHook") + } +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 8af3604196..e6974d09f6 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -25,9 +25,7 @@ tasks.withType().configureEach { dependencies { implementation(gradleApi()) - implementation("com.android.tools.build:gradle:7.3.0") - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21") + implementation("com.android.tools.build:gradle:7.3.1") + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10") implementation("com.google.firebase:firebase-appdistribution-gradle:3.2.0") - implementation("com.google.firebase:perf-plugin:1.4.2") } diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index d7cda371c0..5ea08d1e5b 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -1,39 +1,177 @@ object Dependencies { - private const val androidxCoreKtxVersion = "1.9.0" + // Kotlin + const val kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlinVersion}" + const val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlinVersion}" + const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlinVersion}" + + private const val androidxCoreKtxVersion = "1.10.1" private const val appCompatVersion = "1.6.0" private const val materialDesignVersion = "1.8.0" private const val recyclerviewVersion = "1.2.1" private const val activityKtxVersion = "1.6.0" private const val fragmentKtxVersion = "1.4.1" - private const val adapterDelegatesVersion = "4.3.2" - private const val androidBuildToolsVersion = "7.4.1" + private const val coreKtx = "androidx.core:core-ktx:$androidxCoreKtxVersion" + private const val splash = "androidx.core:core-splashscreen:1.0.1" + private const val appCompat = "androidx.appcompat:appcompat:$appCompatVersion" + private const val material = "com.google.android.material:material:$materialDesignVersion" + private const val recyclerView = "androidx.recyclerview:recyclerview:$recyclerviewVersion" + private const val activityKtx = "androidx.activity:activity-ktx:$activityKtxVersion" + private const val fragmentKtx = "androidx.fragment:fragment-ktx:$fragmentKtxVersion" + private const val biometricKtx = "androidx.biometric:biometric:1.1.0" + private const val browser = "androidx.browser:browser:1.5.0" + // coroutines + private const val coroutinesVersion = "1.6.2" + private const val coroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion" + private const val coroutinesAndroid = "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion" - // Kotlin - const val kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlinVersion}" - const val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlinVersion}" - const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlinVersion}" + // retrofit + private const val retrofitVersion = "2.9.0" + private const val retrofit = "com.squareup.retrofit2:retrofit:$retrofitVersion" + private const val retrofitGson = "com.squareup.retrofit2:converter-gson:$retrofitVersion" + private const val retrofitScalars = "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + + private const val okHttpVersion = "4.9.3" + private const val okHttp = "com.squareup.okhttp3:okhttp:$okHttpVersion" + private const val okHttpLoggingInterceptor = "com.squareup.okhttp3:logging-interceptor:$okHttpVersion" + + // Room + private const val roomVersion = "2.4.3" + const val roomRuntime = "androidx.room:room-runtime:$roomVersion" + const val roomKtx = "androidx.room:room-ktx:$roomVersion" + const val roomCompiler = "androidx.room:room-compiler:$roomVersion" + + // firebase + const val firebaseBom = "com.google.firebase:firebase-bom:32.1.1" + private const val firebaseCrashlytics = "com.google.firebase:firebase-crashlytics" + private const val firebaseAnalytics = "com.google.firebase:firebase-analytics-ktx" + private const val firebaseMessaging = "com.google.firebase:firebase-messaging-ktx" + private const val firebaseConfig = "com.google.firebase:firebase-config" + + // google play + private const val googlePlayBase = "com.google.android.gms:play-services-base:18.2.0" + private const val googlePlayAuth = "com.google.android.gms:play-services-auth:20.6.0" - const val coreKtx = "androidx.core:core-ktx:$androidxCoreKtxVersion" - const val appCompat = "androidx.appcompat:appcompat:$appCompatVersion" - const val material = "com.google.android.material:material:$materialDesignVersion" - const val recyclerView = "androidx.recyclerview:recyclerview:$recyclerviewVersion" - const val activityKtx = "androidx.activity:activity-ktx:$activityKtxVersion" - const val fragmentKtx = "androidx.fragment:fragment-ktx:$fragmentKtxVersion" - const val adapterDelegates = "com.hannesdorfmann:adapterdelegates4-kotlin-dsl:$adapterDelegatesVersion" - const val adapterDelegatesBinding = + // glide + private const val glideVersion = "4.15.1" + const val glide = "com.github.bumptech.glide:glide:$glideVersion" + const val glideCompiler = "com.github.bumptech.glide:compiler:$glideVersion" + const val caverockSvg = "com.caverock:androidsvg-aar:1.4" + + // adapter delegates + private const val adapterDelegatesVersion = "4.3.2" + private const val adapterDelegates = "com.hannesdorfmann:adapterdelegates4-kotlin-dsl:$adapterDelegatesVersion" + private const val adapterDelegatesBinding = "com.hannesdorfmann:adapterdelegates4-kotlin-dsl-viewbinding:$adapterDelegatesVersion" - const val androidBuildTools = "com.android.tools.build.gradle:$androidBuildToolsVersion" + + // AppsFlyer + private const val appsFlyerSdk = "com.appsflyer:af-android-sdk:6.9.0" + private const val androidInstallReferrer = "com.android.installreferrer:installreferrer:2.2" + private const val androidAdsIndetifier = "androidx.ads:ads-identifier:1.0.0-alpha05" + + // Striga + const val strigaSdk = "com.sumsub.sns:idensic-mobile-sdk:1.25.0" + + // Utils + const val lokalise = "com.lokalise.android:sdk:2.1.1" + const val libphonenumber = "io.michaelrocks:libphonenumber-android:8.12.52" + const val workRuntimeKtx = "androidx.work:work-runtime-ktx:2.7.1" + const val intercom = "io.intercom.android:intercom-sdk:14.0.0" + const val amplitude = "com.amplitude:android-sdk:2.35.3" + const val lottie = "com.airbnb.android:lottie:4.0.0" + const val dotsIndicator = "com.tbuonomo:dotsindicator:4.3" + const val tickerView = "com.robinhood.ticker:ticker:2.0.4" + + // https://github.com/dm77/barcodescanner + const val barcodeScanner = "me.dm7.barcodescanner:zxing:1.9.8" + + // https://github.com/JakeWharton/ThreeTenABP + const val threetenabp = "com.jakewharton.threetenabp:threetenabp:1.3.0" + const val debugDrawer = "io.palaima.debugdrawer:debugdrawer-timber:0.8.0" + + // timber + private const val timberVersion = "5.0.1" + const val timber = "com.jakewharton.timber:timber:$timberVersion" + + // Unit Testing + // core + private const val coreTestKtx = "androidx.test:core-ktx:1.5.0" + private const val junitKtx = "androidx.test.ext:junit-ktx:1.1.5" + private const val coreTesting = "androidx.arch.core:core-testing:2.2.0" + + // https://github.com/mockk/mockk + private const val mockk = "io.mockk:mockk:1.12.0" + + // https://mvnrepository.com/artifact/junit/junit + private const val junit = "junit:junit:4.13.2" + + // https://github.com/robolectric/robolectric + private const val roboletric = "org.robolectric:robolectric:4.7.3" + + // Coroutines support + private const val coroutinesTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion" + + // Koin Test features + private const val koinVersion = "3.2.0" + private const val koinTest = "io.insert-koin:koin-test:$koinVersion" + private const val koinTestJunit = "io.insert-koin:koin-test-junit4:$koinVersion" + + private const val assertKTest = "com.willowtreeapps.assertk:assertk-jvm:0.25" + private const val slf4jTest = "org.slf4j:slf4j-nop:1.7.30" + private const val jupiterJunit = "org.junit.jupiter:junit-jupiter-api:5.8.2" + + // runtime only + const val junitPlatform = "org.junit.platform:junit-platform-launcher:1.8.2" + private const val junitJupiterVersion = "5.8.2" + private const val junitEngine = "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion" + private const val junitVintageEngine = "org.junit.vintage:junit-vintage-engine:$junitJupiterVersion" + + // timezone for unit testing + private const val threetenTest = "org.threeten:threetenbp:1.6.8" + + // XmlPullParser goes with android.jar and doesn't work in unit tests + private const val xmlPull = "xmlpull:xmlpull:1.1.3.4a@jar" + + // KXmlParser needs for XmlPullParserFactory + private const val kxml = "net.sf.kxml:kxml2:2.3.0" val baseAndroidLibraries = listOf( coreKtx, + splash, appCompat, material, recyclerView, activityKtx, - fragmentKtx + fragmentKtx, + biometricKtx, + browser + ) + + val coroutineLibraries = listOf( + coroutinesCore, + coroutinesAndroid, + ) + + val retrofitLibraries = listOf( + retrofit, + retrofitGson, + retrofitScalars, + okHttp, + okHttpLoggingInterceptor + ) + + val firebaseLibraries = listOf( + firebaseCrashlytics, + firebaseAnalytics, + firebaseMessaging, + firebaseConfig + ) + + val googlePlayLibraries = listOf( + googlePlayBase, + googlePlayAuth, ) val adapterDelegatesLibraries = listOf( @@ -41,8 +179,38 @@ object Dependencies { adapterDelegatesBinding, ) - //Third party libraries version - private const val timberVersion = "5.0.1" - const val timber = "com.jakewharton.timber:timber:$timberVersion" + val appsFlyerLibraries = listOf( + appsFlyerSdk, + androidInstallReferrer, + androidAdsIndetifier + ) + val coreTestingLibraries = listOf( + coreTestKtx, + junitKtx, + coreTesting, + mockk, + junit, + roboletric, + coroutinesTest + ) + + val koinTestingLibraries = listOf( + koinTest, + koinTestJunit + ) + + val junitRuntimeOnlyLibraries = listOf( + junitEngine, + junitVintageEngine + ) + + val otherTestingLibraries = listOf( + assertKTest, + slf4jTest, + jupiterJunit, + threetenTest, + xmlPull, + kxml + ) } diff --git a/buildSrc/src/main/java/Versions.kt b/buildSrc/src/main/java/Versions.kt index f2a3f83d1f..d116c480cc 100644 --- a/buildSrc/src/main/java/Versions.kt +++ b/buildSrc/src/main/java/Versions.kt @@ -25,5 +25,7 @@ object Versions { return "key-app-$VERSION_NAME.$VERSION_PATCH" } - const val kotlinVersion = "1.7.20" + const val kotlinVersion = "1.8.10" + const val kotlinGradlePluginVersion = "1.8.10" + const val buildGradleVersion = "7.3.1" } From 9ba65cd7246e0c1cf065235f3dbd3c5578d44a1e Mon Sep 17 00:00:00 2001 From: Chingiz Date: Thu, 29 Jun 2023 16:32:20 +0600 Subject: [PATCH 2/2] NO-TICKET - minor changes --- .../org/p2p/wallet/history/ui/token/TokenHistoryFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/p2p/wallet/history/ui/token/TokenHistoryFragment.kt b/app/src/main/java/org/p2p/wallet/history/ui/token/TokenHistoryFragment.kt index e3f6cd721e..07c1402a6e 100644 --- a/app/src/main/java/org/p2p/wallet/history/ui/token/TokenHistoryFragment.kt +++ b/app/src/main/java/org/p2p/wallet/history/ui/token/TokenHistoryFragment.kt @@ -171,7 +171,7 @@ class TokenHistoryFragment : replaceFragment(SellPayloadFragment.create()) } else -> { - // TODO: WHAT SHOULD BE HERE? + // do nothing } } }