zcash-android-wallet-sdk/demo-app/build.gradle.kts

155 lines
5.0 KiB
Plaintext
Raw Normal View History

plugins {
id("com.android.application")
2022-01-26 04:27:04 -08:00
id("org.jetbrains.kotlin.android")
id("zcash-sdk.android-conventions")
id("kotlin-parcelize")
id("androidx.navigation.safeargs")
2022-02-06 06:55:03 -08:00
id("com.osacky.fladle")
}
android {
2022-09-19 05:06:15 -07:00
namespace = "cash.z.ecc.android.sdk.demoapp"
defaultConfig {
applicationId = "cash.z.ecc.android.sdk.demoapp"
minSdk = 19
versionCode = 1
versionName = "1.0"
multiDexEnabled = true
vectorDrawables.useSupportLibrary = true
}
buildFeatures {
viewBinding = true
}
2022-08-31 08:17:47 -07:00
val releaseKeystorePath = project.property("ZCASH_RELEASE_KEYSTORE_PATH").toString()
val releaseKeystorePassword = project.property("ZCASH_RELEASE_KEYSTORE_PASSWORD").toString()
val releaseKeyAlias = project.property("ZCASH_RELEASE_KEY_ALIAS").toString()
val releaseKeyAliasPassword =
project.property("ZCASH_RELEASE_KEY_ALIAS_PASSWORD").toString()
val isReleaseSigningConfigured = listOf(
releaseKeystorePath,
releaseKeystorePassword,
releaseKeyAlias,
releaseKeyAliasPassword
).all { it.isNotBlank() }
signingConfigs {
if (isReleaseSigningConfigured) {
// If this block doesn't execute, the output will be unsigned
create("release").apply {
storeFile = File(releaseKeystorePath)
storePassword = releaseKeystorePassword
keyAlias = releaseKeyAlias
keyPassword = releaseKeyAliasPassword
}
}
}
flavorDimensions.add("network")
productFlavors {
// would rather name them "testnet" and "mainnet" but product flavor names cannot start with the word "test"
create("zcashtestnet") {
dimension = "network"
applicationId = "cash.z.ecc.android.sdk.demoapp.testnet"
matchingFallbacks.addAll(listOf("zcashtestnet", "debug"))
}
create("zcashmainnet") {
dimension = "network"
applicationId = "cash.z.ecc.android.sdk.demoapp.mainnet"
matchingFallbacks.addAll(listOf("zcashmainnet", "release"))
}
}
buildTypes {
getByName("release").apply {
isMinifyEnabled = project.property("IS_MINIFY_APP_ENABLED").toString().toBoolean()
proguardFiles.addAll(
listOf(
getDefaultProguardFile("proguard-android-optimize.txt"),
File("proguard-project.txt")
)
)
2022-08-31 08:17:47 -07:00
if (isReleaseSigningConfigured) {
signingConfig = signingConfigs.getByName("release")
}
}
}
lint {
2022-01-26 04:27:04 -08:00
baseline = File("lint-baseline.xml")
}
}
dependencies {
// SDK
implementation(projects.sdkLib)
// sample mnemonic plugin
implementation(libs.zcashwalletplgn)
implementation(libs.bip39)
// Android
implementation(libs.androidx.core)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.multidex)
implementation(libs.androidx.navigation.fragment)
implementation(libs.androidx.navigation.ui)
implementation(libs.material)
androidTestImplementation(libs.bundles.androidx.test)
implementation(libs.bundles.grpc)
}
2022-02-06 06:55:03 -08:00
fladle {
2022-02-06 06:55:03 -08:00
// Firebase Test Lab has min and max values that might differ from our project's
// These are determined by `gcloud firebase test android models list`
@Suppress("MagicNumber", "PropertyName", "VariableNaming")
2022-08-31 08:17:47 -07:00
val FIREBASE_TEST_LAB_MIN_API = 19
2022-02-06 06:55:03 -08:00
@Suppress("MagicNumber", "PropertyName", "VariableNaming")
2022-08-31 08:17:47 -07:00
val FIREBASE_TEST_LAB_MAX_API = 33
2022-02-06 06:55:03 -08:00
val minSdkVersion = run {
val buildMinSdk =
project.properties["ANDROID_MIN_SDK_VERSION"].toString().toInt()
buildMinSdk.coerceAtLeast(FIREBASE_TEST_LAB_MIN_API).toString()
}
val targetSdkVersion = run {
val buildTargetSdk =
project.properties["ANDROID_TARGET_SDK_VERSION"].toString().toInt()
buildTargetSdk.coerceAtMost(FIREBASE_TEST_LAB_MAX_API).toString()
}
val firebaseTestLabKeyPath = project.properties["ZCASH_FIREBASE_TEST_LAB_API_KEY_PATH"].toString()
val firebaseProject = project.properties["ZCASH_FIREBASE_TEST_LAB_PROJECT"].toString()
if (firebaseTestLabKeyPath.isNotEmpty()) {
2022-02-06 06:55:03 -08:00
serviceAccountCredentials.set(File(firebaseTestLabKeyPath))
} else if (firebaseProject.isNotEmpty()) {
projectId.set(firebaseProject)
}
2022-02-06 06:55:03 -08:00
configs {
create("sanityConfig") {
clearPropertiesForSanityRobo()
2022-02-06 06:55:03 -08:00
debugApk.set(
project.provider {
"${buildDir}/outputs/apk/zcashmainnet/release/demo-app-zcashmainnet-release.apk"
}
)
2022-02-06 06:55:03 -08:00
testTimeout.set("5m")
2022-02-06 06:55:03 -08:00
devices.addAll(
2022-08-31 08:17:47 -07:00
mapOf("model" to "Nexus5", "version" to minSdkVersion),
mapOf("model" to "Pixel2.arm", "version" to targetSdkVersion)
)
2022-04-05 05:05:32 -07:00
flankVersion.set(libs.versions.flank.get())
2022-02-06 06:55:03 -08:00
}
}
}