import cash.z.ecc.android.Deps
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.github.ben-manes.versions'
archivesBaseName = 'hush-android-wallet'
group = 'hush.android'
version = Deps . versionName
android {
ndkVersion "21.1.6352462"
compileSdkVersion Deps . compileSdkVersion
defaultConfig {
applicationId Deps . packageName
minSdkVersion Deps . minSdkVersion
targetSdkVersion Deps . targetSdkVersion
versionCode = Deps . versionCode
versionName = Deps . versionName
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
if ( Boolean . parseBoolean ( isUseTestOrchestrator ) ) {
testInstrumentationRunnerArguments clearPackageData: 'true'
}
multiDexEnabled true
resValue 'string' , 'bugsnag_api_key' , "${(project.findProperty('BUGSNAG_API_KEY') ?: System.getenv('BUGSNAG_API_KEY')) ?: ''}"
// this setting allows using color resources in vector drawables, rather than hardcoded values (note: only works when minApi is 21)
// per https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.VectorDrawablesOptions.html: If set to an empty collection, all special handling of vector drawables will be disabled.
vectorDrawables . generatedDensities = [ ]
}
splits {
abi {
enable true
reset ( )
universalApk true
include "armeabi-v7a" , "x86" , "arm64-v8a" , "x86_64"
}
}
buildFeatures {
viewBinding true
}
flavorDimensions 'network'
productFlavors {
// would rather name them "testnet" and "mainnet" but product flavor names cannot start with the word "test"
zcashtestnet {
dimension 'network'
applicationId 'cash.z.ecc.android.testnet'
buildConfigField "String" , "DEFAULT_SERVER_URL" , '"lite2.hushpool.is"'
matchingFallbacks = [ 'zcashtestnet' , 'debug' ]
}
zcashmainnet {
dimension 'network'
buildConfigField "String" , "DEFAULT_SERVER_URL" , '"lite2.hushpool.is"'
matchingFallbacks = [ 'zcashmainnet' , 'release' ]
}
}
signingConfigs {
placeholder {
storeFile file ( "${rootProject.projectDir}/placeholder.keystore" )
keyAlias "androiddebugkey"
keyPassword "android"
storePassword "android"
}
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile ( 'proguard-android-optimize.txt' ) , 'proguard-rules.pro'
signingConfig signingConfigs . placeholder
}
debug {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile ( 'proguard-android-optimize.txt' ) , 'proguard-rules.pro'
}
// builds for testing only in the wallet team, typically unfinished features
// this flavor can be installed alongside the others
qa {
initWith debug
debuggable true
applicationIdSuffix ".internal"
matchingFallbacks = [ 'debug' ]
signingConfig signingConfigs . placeholder
}
}
compileOptions {
// enable support for new language APIs but also fix the issue with zxing on API < 24
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion . VERSION_1_8
targetCompatibility JavaVersion . VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs + = "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
freeCompilerArgs + = "-opt-in=kotlin.time.ExperimentalTime"
// freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.ObsoleteCoroutinesApi"
// freeCompilerArgs += "-Xopt-in=kotlinx.coroutines.FlowPreview"
}
testOptions {
if ( Boolean . parseBoolean ( isUseTestOrchestrator ) ) {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
}
kapt {
arguments {
arg 'dagger.fastInit' , 'enabled'
arg 'dagger.fullBindingGraphValidation' , 'ERROR'
}
}
packagingOptions {
resources {
excludes + = [ 'META-INF/AL2.0' , 'META-INF/LGPL2.1' ]
}
}
namespace 'cash.z.ecc.android'
applicationVariants . all { variant - >
variant . outputs . all { output - >
outputFileName = "$archivesBaseName-v${Deps.versionName}-${variant.buildType.name}-${output.getFilter(" ABI ")}.apk"
}
}
}
dependencies {
implementation fileTree ( dir: 'libs' , include: [ '*.jar' ] )
implementation project ( ':qrecycler' )
implementation project ( ':feedback' )
implementation project ( ':mnemonic' )
implementation project ( ':lockbox' )
// Zcash
implementation Deps . Zcash . ANDROID_WALLET_PLUGINS
implementation Deps . Zcash . SDK
// Kotlin
implementation Deps . Kotlin . STDLIB
// Android
implementation Deps . AndroidX . ANNOTATION
implementation Deps . AndroidX . APPCOMPAT
implementation Deps . AndroidX . BIOMETRICS
implementation Deps . AndroidX . CONSTRAINT_LAYOUT
implementation Deps . AndroidX . CORE_KTX
implementation Deps . AndroidX . FRAGMENT_KTX
implementation Deps . AndroidX . LEGACY
implementation Deps . AndroidX . PAGING
implementation Deps . AndroidX . RECYCLER
def camerax_version = "1.1.0"
implementation "androidx.camera:camera-core:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
implementation "androidx.camera:camera-view:${camerax_version}"
//WindowManager
implementation "androidx.window:window:1.1.0-alpha01"
implementation Deps . AndroidX . Lifecycle . LIFECYCLE_RUNTIME_KTX
implementation Deps . AndroidX . Navigation . FRAGMENT_KTX
implementation Deps . AndroidX . Navigation . UI_KTX
implementation Deps . AndroidX . Room . ROOM_KTX
kapt Deps . AndroidX . Room . ROOM_COMPILER
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
// Google
implementation Deps . Google . GUAVA
implementation Deps . Google . MATERIAL
// grpc-java
implementation Deps . Grpc . ANDROID
implementation Deps . Grpc . OKHTTP
implementation Deps . Grpc . PROTOBUG
implementation Deps . Grpc . STUB
implementation 'com.squareup.okio:okio:2.8.0'
implementation Deps . JavaX . JAVA_ANNOTATION
// Misc.
implementation Deps . Misc . LOTTIE
implementation Deps . Misc . CHIPS
implementation Deps . Misc . Plugins . QR_SCANNER
// Tests
testImplementation Deps . Test . JUNIT
testImplementation Deps . Test . MOKITO
testImplementation Deps . Test . MOKITO_KOTLIN
androidTestImplementation Deps . Kotlin . REFLECT
androidTestImplementation ( Deps . Kotlin . Coroutines . TEST )
androidTestImplementation Deps . Test . Android . JUNIT
androidTestImplementation Deps . Test . Android . CORE
androidTestImplementation Deps . Test . Android . FRAGMENT
androidTestImplementation Deps . Test . Android . ESPRESSO
androidTestImplementation Deps . Test . Android . ESPRESSO_INTENTS
androidTestImplementation Deps . Test . Android . NAVIGATION
// androidTestImplementation is preferred, but then the androidx.fragment.app.testing.FragmentScenario$EmptyFragmentActivity isn't available
debugImplementation Deps . Test . Android . FRAGMENT
}
defaultTasks 'clean' , 'assembleZcashmainnetRelease'