Skip to content

Commit

Permalink
chore: move dependencies to toml file
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltchuang committed Oct 25, 2024
1 parent 121e520 commit 1a0804e
Show file tree
Hide file tree
Showing 7 changed files with 198 additions and 156 deletions.
109 changes: 52 additions & 57 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "io.gitlab.arturbosch.detekt" version "$detekt_version"
id "io.gitlab.arturbosch.detekt" version(libs.versions.detekt)
id "com.android.application"
id "com.google.gms.google-services"
id "com.google.firebase.crashlytics"
Expand Down Expand Up @@ -171,94 +171,89 @@ dependencies {

implementation project(':wallet-sdk')
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${libVersions.coroutines}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${libVersions.coroutines}"
implementation libs.kotlinx.coroutines.core
implementation libs.kotlinx.coroutines.android

implementation "com.google.android.material:material:${libVersions.material}"
implementation "com.google.android.flexbox:flexbox:${libVersions.flexbox}"
implementation "androidx.appcompat:appcompat:${libVersions.appCompat}"
implementation "androidx.legacy:legacy-support-v4:${libVersions.legacySupport}"
implementation "androidx.lifecycle:lifecycle-extensions:${libVersions.lifecycleExt}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${libVersions.lifecycle}"
implementation "androidx.lifecycle:lifecycle-common-java8:${libVersions.lifecycle}"
implementation "androidx.constraintlayout:constraintlayout:${libVersions.constraintLayout}"
implementation "androidx.core:core-ktx:${libVersions.coreKtx}"
implementation libs.material
implementation libs.flexbox
implementation libs.appcompat
implementation libs.legacy.support.v4
implementation libs.lifecycle.extensions
implementation libs.lifecycle.viewmodel.ktx
implementation libs.lifecycle.common.java8
implementation libs.constraintlayout
implementation libs.core.ktx

implementation platform("com.google.firebase:firebase-bom:${libVersions.firebaseBom}")
implementation platform(libs.firebase.bom)
implementation libs.bundles.firebase

implementation "com.google.firebase:firebase-analytics"
implementation "com.google.firebase:firebase-messaging"
implementation "com.google.firebase:firebase-crashlytics"
implementation "com.google.firebase:firebase-perf"
implementation libs.biometric

implementation "androidx.biometric:biometric:${libVersions.biometric}"
implementation libs.zxing.android.embedded

implementation "com.journeyapps:zxing-android-embedded:${libVersions.zxing}"
implementation libs.room.runtime
implementation libs.room.ktx
kapt libs.room.compiler

implementation "androidx.room:room-runtime:${libVersions.room}"
implementation "androidx.room:room-ktx:${libVersions.room}"
kapt "androidx.room:room-compiler:${libVersions.room}"
implementation libs.navigation.fragment.ktx
implementation libs.navigation.ui.ktx

implementation "androidx.navigation:navigation-fragment-ktx:${libVersions.navigation}"
implementation "androidx.navigation:navigation-ui-ktx:${libVersions.navigation}"
implementation libs.ble

implementation "no.nordicsemi.android:ble-ktx:${libVersions.ble}"
implementation libs.fragment.ktx

implementation "androidx.fragment:fragment-ktx:${libVersions.fragment}"
implementation libs.multidex

implementation "androidx.multidex:multidex:${libVersions.multidex}"
implementation libs.browser

implementation "androidx.browser:browser:${libVersions.browser}"
implementation libs.paging.runtime.ktx

implementation "androidx.paging:paging-runtime-ktx:${libVersions.paging}"
implementation libs.tink.android

implementation "com.google.crypto.tink:tink-android:${libVersions.tink}"
implementation libs.review.ktx

implementation "com.google.android.play:review-ktx:${libVersions.review}"
implementation libs.hilt.android.dagger
kapt libs.hilt.android.compiler
kapt libs.hilt.androidx

implementation "com.google.dagger:hilt-android:$dagger_gradle_version"
kapt "com.google.dagger:hilt-android-compiler:$dagger_gradle_version"
implementation libs.glide.image
kapt libs.glide.compiler

kapt "androidx.hilt:hilt-compiler:${libVersions.hiltCompiler}"
implementation libs.lottie

implementation "com.github.bumptech.glide:glide:${libVersions.glide}"
kapt "com.github.bumptech.glide:compiler:${libVersions.glide}"

implementation "com.airbnb.android:lottie:${libVersions.lottie}"

implementation "com.squareup.retrofit2:retrofit:${libVersions.retrofit}"
implementation "com.squareup.retrofit2:converter-gson:${libVersions.retrofit}"
implementation "com.squareup.okhttp3:logging-interceptor:${libVersions.okhttp}"
implementation libs.retrofit
implementation libs.converter.gson
implementation libs.logging.interceptor

// Chart
implementation "com.github.PhilJay:MPAndroidChart:${libVersions.mpAndroidChart}"
implementation libs.mpandroidchart

coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:${libVersions.desugar}"
coreLibraryDesugaring libs.desugar.jdk

// Wallet Connect v1
implementation "org.java-websocket:Java-WebSocket:${libVersions.javaWebSocket}"
implementation "com.github.komputing:khex:${libVersions.khex}"
implementation "com.squareup.moshi:moshi:${libVersions.moshi}"
implementation "com.squareup.moshi:moshi-kotlin:${libVersions.moshi}"
implementation libs.java.websocket
implementation libs.khex
implementation libs.moshi.core
implementation libs.moshi.kotlin

// Wallet Connect v2
implementation(platform("com.walletconnect:android-bom:${libVersions.walletConnectBom}"))
implementation("com.walletconnect:android-core") {
implementation(platform(libs.walletconnect))
implementation(libs.android.core) {
exclude group: 'com.jakewharton.timber', module: 'timber'
}
implementation "com.walletconnect:sign"
implementation "com.walletconnect:web3wallet"
implementation libs.sign
implementation libs.web3wallet

// ExoPlayer
implementation "com.google.android.exoplayer:exoplayer:${libVersions.exoPlayer}"
implementation libs.exoplayer

implementation(libs.algosdk) {
exclude group: 'org.bouncycastle'
}

// Test
testImplementation "junit:junit:${testLibVersions.junit}"
androidTestImplementation "androidx.room:room-testing:${libVersions.room}"
androidTestImplementation "androidx.test:runner:${testLibVersions.runner}"
androidTestImplementation "androidx.test.espresso:espresso-core:${testLibVersions.espresso}"
testImplementation libs.junit
androidTestImplementation libs.room.testing
androidTestImplementation libs.runner
androidTestImplementation libs.espresso.core
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,9 @@ class AccountDetailUseCase @Inject constructor(
}

fun isAssetBalanceZero(publicKey: String, assetId: Long): Boolean? {
getCachedAccountDetail(publicKey)?.let { account ->
account.data?.getAssetHoldingOrNull(assetId)?.let {
return it.amount == BigInteger.ZERO
}
} ?: return null
val account = getCachedAccountDetail(publicKey) ?: return null
val assetHolding = account.data?.getAssetHoldingOrNull(assetId) ?: return null
return assetHolding.amount == BigInteger.ZERO
}

fun isAssetOwnedByAnyAccount(assetId: Long): Boolean {
Expand Down
43 changes: 0 additions & 43 deletions build.gradle

This file was deleted.

34 changes: 34 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath(libs.gradle)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.navigation.safe.args.gradle.plugin)
classpath(libs.google.services)
classpath(libs.firebase.crashlytics.gradle)
classpath(libs.hilt.android.gradle.plugin)
classpath(libs.perf.plugin)
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

apply(from = "versions.gradle")

allprojects {
repositories {
google()
mavenCentral()
maven(url = "https://jitpack.io")
}
}

tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
}
111 changes: 106 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,123 @@
[versions]
algosdk = "2.5.0"
appCompat = "1.7.0"
biometric = "1.1.0"
ble = "2.8.0"
browser = "1.8.0"
constraintLayout = "2.1.4"
converterGson = "2.11.0"
coreKtx = "1.13.1"
coroutines = "1.9.0"
dagger = "2.50"
desugar = "2.1.2"
detekt = "1.23.7"
espresso = "3.6.1"
exoPlayer = "2.19.1"
firebaseBom = "33.5.1"
firebaseCrashlyticsGradle = "3.0.2"
firebasePerformance = "1.4.2"
flexbox = "3.0.0"
fragmentKtx = "1.8.4"
glide = "4.16.0"
googleServicesVersion = "4.4.2"
gradleVersion = "8.7.1"
hiltCompiler = "1.2.0"
javaWebSocket = "1.5.6"
junit = "4.13.2"
khex = "1.1.2"
kotlin = "1.9.24"
kotlinfixture = "1.2.0"
mockk = "1.13.13"
coroutines = "1.9.0"
kotlinTest = "1.5.31"
legacySupport = "1.0.0"
lifecycle = "2.8.6"
lifecycleExt = "2.2.0"
lottie = "6.4.1"
material = "1.12.0"
mockk = "1.13.13"
moshi = "1.15.1"
mpAndroidChart = "3.1.0"
multidex = "2.0.1"
navigation = "2.8.3"
okhttp = "4.12.0"
paging = "3.3.2"
retrofit = "2.11.0"
review = "2.0.2"
room = "2.6.1"
runner = "1.6.2"
safeargs = "2.8.3"
tink = "1.14.0"
walletConnectBom = "1.34.1"
zxing = "4.3.0"

[libraries]
algosdk = { module = "com.algorand:algosdk", version.ref = "algosdk" }
android-core = { module = "com.walletconnect:android-core" }
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appCompat" }
biometric = { module = "androidx.biometric:biometric", version.ref = "biometric" }
ble = { module = "no.nordicsemi.android:ble", version.ref = "ble" }
browser = { module = "androidx.browser:browser", version.ref = "browser" }
constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintLayout" }
converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "converterGson" }
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
desugar-jdk = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugar" }
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
exoplayer = { module = "com.google.android.exoplayer:exoplayer", version.ref = "exoPlayer" }
firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebaseBom" }
firebase-analytics = { module = "com.google.firebase:firebase-analytics" }
firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" }
firebase-crashlytics-gradle = { module = "com.google.firebase:firebase-crashlytics-gradle", version.ref = "firebaseCrashlyticsGradle" }
firebase-messaging = { module = "com.google.firebase:firebase-messaging" }
firebase-perf = { module = "com.google.firebase:firebase-perf" }
flexbox = { module = "com.google.android.flexbox:flexbox", version.ref = "flexbox" }
fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragmentKtx" }
glide-image = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glide" }
google-services = { module = "com.google.gms:google-services", version.ref = "googleServicesVersion" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradleVersion" }
hilt-android-dagger = { module = "com.google.dagger:hilt-android", version.ref = "dagger" }
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "dagger" }
hilt-android-gradle-plugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "dagger" }
hilt-androidx = { module = "androidx.hilt:hilt-compiler", version.ref = "hiltCompiler" }
java-websocket = { module = "org.java-websocket:Java-WebSocket", version.ref = "javaWebSocket" }
junit = { module = "junit:junit", version.ref = "junit" }
khex = { module = "com.github.komputing:khex", version.ref = "khex" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
junit = { module = "junit:junit", version.ref = "junit" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
kotlinfixture = { module = "com.appmattus.fixture:fixture", version.ref = "kotlinfixture" }
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlinTest" }
legacy-support-v4 = { module = "androidx.legacy:legacy-support-v4", version.ref = "legacySupport" }
lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "lifecycle" }
lifecycle-extensions = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "lifecycleExt" }
lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" }
logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
lottie = { module = "com.airbnb.android:lottie", version.ref = "lottie" }
material = { module = "com.google.android.material:material", version.ref = "material" }
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
moshi-core = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
mpandroidchart = { module = "com.github.PhilJay:MPAndroidChart", version.ref = "mpAndroidChart" }
multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigation" }
navigation-safe-args-gradle-plugin = { module = "androidx.navigation:navigation-safe-args-gradle-plugin", version.ref = "safeargs" }
navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigation" }
paging-runtime-ktx = { module = "androidx.paging:paging-runtime-ktx", version.ref = "paging" }
perf-plugin = { module = "com.google.firebase:perf-plugin", version.ref = "firebasePerformance" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
review-ktx = { module = "com.google.android.play:review-ktx", version.ref = "review" }
room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
room-testing = { module = "androidx.room:room-testing", version.ref = "room" }
runner = { module = "androidx.test:runner", version.ref = "runner" }
sign = { module = "com.walletconnect:sign" }
tink-android = { module = "com.google.crypto.tink:tink-android", version.ref = "tink" }
walletconnect = { module = "com.walletconnect:android-bom", version.ref = "walletConnectBom" }
web3wallet = { module = "com.walletconnect:web3wallet" }
zxing-android-embedded = { module = "com.journeyapps:zxing-android-embedded", version.ref = "zxing" }

[bundles]
firebase = ["firebase-analytics", "firebase-crashlytics", "firebase-messaging", "firebase-perf"]

[plugins]
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jan 22 14:01:57 CET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 1a0804e

Please sign in to comment.