2021-09-25 05:13:14 -07:00
|
|
|
plugins {
|
|
|
|
id("com.android.library")
|
2022-01-26 04:27:04 -08:00
|
|
|
id("org.jetbrains.kotlin.android")
|
2022-06-06 13:46:59 -07:00
|
|
|
id("zcash-sdk.android-conventions")
|
2022-06-21 04:57:04 -07:00
|
|
|
|
2021-09-25 05:13:14 -07:00
|
|
|
id("org.jetbrains.kotlin.plugin.allopen")
|
|
|
|
id("org.jetbrains.dokka")
|
2022-08-16 05:53:23 -07:00
|
|
|
|
2022-06-21 04:57:04 -07:00
|
|
|
id("wtf.emulator.gradle")
|
|
|
|
id("zcash-sdk.emulator-wtf-conventions")
|
2022-08-16 05:53:23 -07:00
|
|
|
|
|
|
|
id("maven-publish")
|
|
|
|
id("signing")
|
2023-02-01 11:44:21 -08:00
|
|
|
id("zcash-sdk.publishing-conventions")
|
2021-09-25 05:13:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// Publishing information
|
2023-02-01 11:44:21 -08:00
|
|
|
|
2022-08-16 05:53:23 -07:00
|
|
|
val myVersion = project.property("LIBRARY_VERSION").toString()
|
|
|
|
val myArtifactId = "zcash-android-sdk"
|
2021-09-25 05:13:14 -07:00
|
|
|
publishing {
|
|
|
|
publications {
|
2023-02-01 11:44:21 -08:00
|
|
|
publications.withType<MavenPublication>().all {
|
2022-06-16 03:48:44 -07:00
|
|
|
artifactId = myArtifactId
|
2021-09-25 05:13:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2022-09-19 05:06:15 -07:00
|
|
|
namespace = "cash.z.ecc.android.sdk"
|
|
|
|
|
2021-09-25 05:13:14 -07:00
|
|
|
useLibrary("android.test.runner")
|
|
|
|
|
|
|
|
defaultConfig {
|
2021-11-22 07:14:21 -08:00
|
|
|
consumerProguardFiles("proguard-consumer.txt")
|
2021-09-25 05:13:14 -07:00
|
|
|
}
|
|
|
|
|
2023-06-09 06:18:11 -07:00
|
|
|
buildFeatures {
|
|
|
|
buildConfig = true
|
|
|
|
}
|
|
|
|
|
2021-09-25 05:13:14 -07:00
|
|
|
buildTypes {
|
|
|
|
getByName("debug").apply {
|
|
|
|
// test builds exceed the dex limit because they pull in large test libraries
|
|
|
|
isMinifyEnabled = false
|
|
|
|
}
|
|
|
|
getByName("release").apply {
|
2021-11-22 07:14:21 -08:00
|
|
|
isMinifyEnabled = project.property("IS_MINIFY_SDK_ENABLED").toString().toBoolean()
|
2021-09-25 05:13:14 -07:00
|
|
|
proguardFiles.addAll(
|
|
|
|
listOf(
|
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
2021-11-22 07:14:21 -08:00
|
|
|
File("proguard-project.txt")
|
2021-09-25 05:13:14 -07:00
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
2022-12-13 05:25:09 -08:00
|
|
|
create("benchmark") {
|
|
|
|
// We provide the extra benchmark build type just for benchmarking purposes
|
|
|
|
initWith(buildTypes.getByName("release"))
|
|
|
|
matchingFallbacks += listOf("release")
|
|
|
|
}
|
2021-09-25 05:13:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
2022-08-23 06:49:00 -07:00
|
|
|
// Tricky: fix: By default, the kotlin_module name will not include the version (in classes.jar/META-INF).
|
|
|
|
// Instead it has a colon, which breaks compilation on Windows. This is one way to set it explicitly to the
|
|
|
|
// proper value. See https://github.com/zcash/zcash-android-wallet-sdk/issues/222 for more info.
|
2022-08-16 05:53:23 -07:00
|
|
|
freeCompilerArgs += listOf("-module-name", "$myArtifactId-${myVersion}_release")
|
2021-09-25 05:13:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
lint {
|
2022-01-26 04:27:04 -08:00
|
|
|
baseline = File("lint-baseline.xml")
|
2021-09-25 05:13:14 -07:00
|
|
|
}
|
2023-02-01 02:14:55 -08:00
|
|
|
}
|
|
|
|
|
2021-09-25 05:13:14 -07:00
|
|
|
allOpen {
|
|
|
|
// marker for classes that we want to be able to extend in debug builds for testing purposes
|
|
|
|
annotation("cash.z.ecc.android.sdk.annotation.OpenClass")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.dokkaHtml.configure {
|
|
|
|
dokkaSourceSets {
|
|
|
|
configureEach {
|
|
|
|
outputDirectory.set(file("build/docs/rtd"))
|
|
|
|
displayName.set("Zcash Android SDK")
|
|
|
|
includes.from("packages.md")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-02-01 02:14:55 -08:00
|
|
|
api(projects.lightwalletClientLib)
|
2023-05-18 04:36:15 -07:00
|
|
|
implementation(projects.backendLib)
|
2023-02-01 02:14:55 -08:00
|
|
|
|
2021-09-25 06:44:31 -07:00
|
|
|
implementation(libs.androidx.annotation)
|
|
|
|
implementation(libs.androidx.appcompat)
|
2021-09-25 05:13:14 -07:00
|
|
|
|
|
|
|
// Architecture Components: Lifecycle
|
2021-09-25 06:44:31 -07:00
|
|
|
implementation(libs.androidx.lifecycle.runtime)
|
|
|
|
implementation(libs.androidx.lifecycle.common)
|
2021-09-25 05:13:14 -07:00
|
|
|
|
2022-10-19 13:52:54 -07:00
|
|
|
// For direct database access
|
|
|
|
// TODO [#703]: Eliminate this dependency
|
|
|
|
// https://github.com/zcash/zcash-android-wallet-sdk/issues/703
|
|
|
|
implementation(libs.androidx.sqlite)
|
|
|
|
implementation(libs.androidx.sqlite.framework)
|
|
|
|
|
2021-09-25 05:13:14 -07:00
|
|
|
// Kotlin
|
2021-09-25 06:44:31 -07:00
|
|
|
implementation(libs.kotlin.stdlib)
|
|
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
|
|
implementation(libs.kotlinx.coroutines.android)
|
2021-09-25 05:13:14 -07:00
|
|
|
|
|
|
|
// Tests
|
2021-09-25 06:44:31 -07:00
|
|
|
testImplementation(libs.kotlin.reflect)
|
2022-06-21 16:34:42 -07:00
|
|
|
testImplementation(libs.kotlin.test)
|
2021-09-25 06:44:31 -07:00
|
|
|
testImplementation(libs.bundles.junit)
|
2021-09-25 05:13:14 -07:00
|
|
|
|
|
|
|
// NOTE: androidTests will use JUnit4, while src/test/java tests will leverage Junit5
|
|
|
|
// Attempting to use JUnit5 via https://github.com/mannodermaus/android-junit5 was painful. The plugin configuration
|
|
|
|
// was buggy, crashing in several places. It also would require a separate test flavor because it's minimum API 26
|
|
|
|
// because "JUnit 5 uses Java 8-specific APIs that didn't exist on Android before the Oreo release."
|
2021-09-25 06:44:31 -07:00
|
|
|
androidTestImplementation(libs.androidx.multidex)
|
|
|
|
androidTestImplementation(libs.mockito.kotlin)
|
|
|
|
androidTestImplementation(libs.mockito.android)
|
|
|
|
androidTestImplementation(libs.androidx.test.runner)
|
|
|
|
androidTestImplementation(libs.androidx.test.junit)
|
|
|
|
androidTestImplementation(libs.androidx.test.core)
|
|
|
|
androidTestImplementation(libs.coroutines.okhttp)
|
2022-08-17 06:48:02 -07:00
|
|
|
androidTestImplementation(libs.kotlin.test)
|
2022-08-12 08:05:00 -07:00
|
|
|
androidTestImplementation(libs.kotlinx.coroutines.test)
|
2021-09-25 05:13:14 -07:00
|
|
|
|
|
|
|
// sample mnemonic plugin
|
2021-09-25 06:44:31 -07:00
|
|
|
androidTestImplementation(libs.zcashwalletplgn)
|
|
|
|
androidTestImplementation(libs.bip39)
|
2021-09-25 05:13:14 -07:00
|
|
|
}
|
|
|
|
|
2021-09-30 04:39:22 -07:00
|
|
|
fun MinimalExternalModuleDependency.asCoordinateString() =
|
|
|
|
"${module.group}:${module.name}:${versionConstraint.displayName}"
|