Files
pezkuwi-wallet-android/feature-dapp-impl/build.gradle
T
Satoshi Qazi Muhammed 5c66cd7f1d feat(dapps): show the bundled DApps catalog until one can be fetched
The DApps catalog lived only in memory and every read waited on first(), so
with the catalog URL unreachable the DApps screen waited forever.

feature-dapp-impl now bundles dapps_full.json at build time. On the first
sync the repository tries the network once and, if that fails, publishes the
bundled catalog so every read returns; the fetched catalog replaces it as
soon as it arrives.

The download task moves to scripts/bundled-config.gradle and serves both
the chain list and the DApps catalog. runtime and feature-dapp-impl unit
tests return defaults for android.util.Log, which the fallback calls.
2026-10-31 00:43:06 +04:00

115 lines
3.2 KiB
Groovy

apply plugin: 'kotlin-parcelize'
apply from: '../tests.gradle'
apply from: "../scripts/secrets.gradle"
apply from: "../scripts/bundled-config.gradle"
android {
defaultConfig {
buildConfigField "String", "DAPP_METADATAS_URL", "\"https://raw.githubusercontent.com/pezkuwichain/pezkuwi-wallet-utils/master/dapps/dapps_dev.json\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "DAPP_METADATAS_URL", "\"https://raw.githubusercontent.com/pezkuwichain/pezkuwi-wallet-utils/master/dapps/dapps_full.json\""
}
}
namespace 'io.novafoundation.nova.feature_dapp_impl'
testOptions {
unitTests {
// android.util.Log.* throws "Method ... not mocked" in plain JVM unit tests; the first-install
// fallback logs the failed fetch it recovers from.
returnDefaultValues = true
}
}
packagingOptions {
resources.excludes.add("META-INF/NOTICE.md")
}
buildFeatures {
viewBinding true
}
}
task actualizeJsScripts(type: Exec) {
workingDir "$rootDir/nova-wallet-dapp-js"
commandLine "yarn", "build"
doLast {
copy {
from "$rootDir/nova-wallet-dapp-js/dist/nova_min.js"
into "$rootDir/feature-dapp-impl/src/main/res/raw"
rename('nova_min.js', 'polkadotjs_min.js')
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':core-db')
implementation project(':common')
implementation project(':feature-onboarding-api')
implementation project(':feature-account-api')
implementation project(':feature-wallet-api')
implementation project(':feature-wallet-connect-api')
implementation project(':feature-dapp-api')
implementation project(':feature-currency-api')
implementation project(':feature-external-sign-api')
implementation project(':feature-banners-api')
implementation project(':runtime')
implementation project(':feature-deep-linking')
implementation kotlinDep
implementation androidDep
implementation materialDep
implementation constraintDep
implementation shimmerDep
implementation coroutinesDep
implementation gsonDep
implementation daggerDep
ksp daggerCompiler
implementation lifecycleDep
ksp lifecycleCompiler
implementation viewModelKtxDep
implementation liveDataKtxDep
implementation lifeCycleKtxDep
implementation navigationFragmentDep
implementation retrofitDep
implementation web3jDep
implementation coroutinesFutureDep
implementation walletConnectCoreDep, withoutTransitiveAndroidX
implementation walletConnectWalletDep, withoutTransitiveAndroidX
testImplementation jUnitDep
testImplementation mockitoDep
}
// The DApps catalog a first install shows when none can be fetched (AssetBundledDappCatalog).
bundleConfigAsset(
"bundleDappsConfig",
"https://raw.githubusercontent.com/pezkuwichain/pezkuwi-wallet-utils/master/dapps/dapps_full.json",
"bundled-config/dapps.json"
) { it instanceof Map && it.dapps instanceof List && !it.dapps.isEmpty() }