2020-09-25 15:23:32 +02:00
|
|
|
plugins {
|
2023-03-27 10:15:48 +02:00
|
|
|
id 'com.android.application'
|
|
|
|
id 'org.jetbrains.kotlin.android'
|
|
|
|
id 'org.jlleitschuh.gradle.ktlint'
|
2020-09-25 15:23:32 +02:00
|
|
|
}
|
2018-11-08 04:04:37 +01:00
|
|
|
|
2020-10-23 15:25:44 +02:00
|
|
|
def gitDescribe = { ->
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine 'git', 'describe', '--always', '--tags', '--dirty=-dirty'
|
|
|
|
standardOutput = stdout
|
|
|
|
}
|
|
|
|
return stdout.toString().trim()
|
|
|
|
}
|
|
|
|
|
2018-11-08 04:04:37 +01:00
|
|
|
android {
|
2023-08-02 17:52:41 +02:00
|
|
|
namespace 'com.stevesoltys.seedvault'
|
2023-08-02 17:49:20 +02:00
|
|
|
compileSdk rootProject.ext.compileSdk
|
2019-06-03 17:23:09 +02:00
|
|
|
|
|
|
|
defaultConfig {
|
2023-08-02 17:49:20 +02:00
|
|
|
minSdk 32 // leave at 32 for robolectric tests
|
|
|
|
targetSdk rootProject.ext.targetSdk
|
2020-10-23 15:25:44 +02:00
|
|
|
versionNameSuffix "-$gitDescribe"
|
2019-08-06 08:16:37 +02:00
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
2019-12-18 17:14:25 +01:00
|
|
|
testInstrumentationRunnerArguments disableAnalytics: 'true'
|
2019-06-03 17:23:09 +02:00
|
|
|
}
|
2018-11-08 04:04:37 +01:00
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-02 18:41:27 +02:00
|
|
|
lint {
|
2021-10-07 18:44:55 +02:00
|
|
|
disable "DialogFragmentCallbacksDetector",
|
|
|
|
"InvalidFragmentVersionForActivityResult",
|
|
|
|
"CheckedExceptions"
|
2020-09-14 22:47:01 +02:00
|
|
|
abortOnError true
|
2018-11-08 04:04:37 +01:00
|
|
|
}
|
|
|
|
compileOptions {
|
2022-08-19 17:42:42 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
|
|
targetCompatibility = JavaVersion.VERSION_11
|
2018-11-08 04:04:37 +01:00
|
|
|
}
|
2020-01-18 19:39:53 +01:00
|
|
|
kotlinOptions {
|
2022-08-19 17:42:42 +02:00
|
|
|
jvmTarget = JavaVersion.VERSION_11.toString()
|
2023-03-27 09:42:56 +02:00
|
|
|
languageVersion = "1.7"
|
2020-01-18 19:39:53 +01:00
|
|
|
}
|
2019-07-09 19:22:24 +02:00
|
|
|
testOptions {
|
|
|
|
unitTests.all {
|
|
|
|
useJUnitPlatform()
|
|
|
|
testLogging {
|
|
|
|
events "passed", "skipped", "failed"
|
|
|
|
}
|
|
|
|
}
|
2019-12-18 17:14:25 +01:00
|
|
|
unitTests {
|
|
|
|
includeAndroidResources = true
|
|
|
|
}
|
2019-07-09 19:22:24 +02:00
|
|
|
}
|
2019-06-03 20:51:58 +02:00
|
|
|
|
2019-08-20 13:04:09 +02:00
|
|
|
sourceSets {
|
|
|
|
test {
|
|
|
|
java.srcDirs += "$projectDir/src/sharedTest/java"
|
|
|
|
}
|
|
|
|
androidTest {
|
|
|
|
java.srcDirs += "$projectDir/src/sharedTest/java"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-19 17:35:47 +01:00
|
|
|
signingConfigs {
|
|
|
|
aosp {
|
|
|
|
// Generated from the AOSP platform key:
|
|
|
|
// https://android.googlesource.com/platform/build/+/refs/tags/android-11.0.0_r29/target/product/security/platform.pk8
|
|
|
|
keyAlias "platform"
|
|
|
|
keyPassword "platform"
|
|
|
|
storeFile file("platform.jks")
|
|
|
|
storePassword "platform"
|
2019-06-03 20:51:58 +02:00
|
|
|
}
|
|
|
|
}
|
2021-02-19 17:35:47 +01:00
|
|
|
|
|
|
|
buildTypes.release.signingConfig = signingConfigs.aosp
|
|
|
|
buildTypes.debug.signingConfig = signingConfigs.aosp
|
2018-11-08 04:04:37 +01:00
|
|
|
}
|
|
|
|
|
2021-01-19 13:14:52 +01:00
|
|
|
dependencies {
|
|
|
|
compileOnly rootProject.ext.aosp_libs
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dependencies in AOSP
|
|
|
|
*
|
|
|
|
* We try to keep the dependencies in sync with what AOSP ships as Seedvault is meant to be built
|
|
|
|
* with the AOSP build system and gradle builds are just for more pleasant development.
|
|
|
|
* Using the AOSP versions in gradle builds allows us to spot issues early on.
|
|
|
|
*/
|
|
|
|
implementation rootProject.ext.kotlin_libs.std
|
|
|
|
// These coroutine libraries get upgraded otherwise to versions incompatible with kotlin version
|
|
|
|
implementation rootProject.ext.kotlin_libs.coroutines
|
|
|
|
|
|
|
|
implementation rootProject.ext.std_libs.androidx_core
|
|
|
|
// A newer version gets pulled in with AOSP via core, so we include fragment here explicitly
|
|
|
|
implementation rootProject.ext.std_libs.androidx_fragment
|
2021-10-07 18:44:55 +02:00
|
|
|
implementation rootProject.ext.std_libs.androidx_activity
|
2021-01-19 13:14:52 +01:00
|
|
|
implementation rootProject.ext.std_libs.androidx_preference
|
|
|
|
implementation rootProject.ext.std_libs.androidx_lifecycle_viewmodel_ktx
|
|
|
|
implementation rootProject.ext.std_libs.androidx_lifecycle_livedata_ktx
|
|
|
|
implementation rootProject.ext.std_libs.androidx_constraintlayout
|
|
|
|
implementation rootProject.ext.std_libs.androidx_documentfile
|
|
|
|
implementation rootProject.ext.std_libs.com_google_android_material
|
|
|
|
|
2021-09-07 17:10:20 +02:00
|
|
|
implementation rootProject.ext.storage_libs.com_google_crypto_tink_android
|
|
|
|
|
2021-01-19 13:14:52 +01:00
|
|
|
/**
|
|
|
|
* Storage Dependencies
|
|
|
|
*/
|
|
|
|
implementation project(':storage:lib')
|
|
|
|
|
|
|
|
/**
|
|
|
|
* External Dependencies
|
|
|
|
*
|
|
|
|
* If the dependencies below are updated,
|
|
|
|
* please make sure to update the prebuilt libraries and the Android.bp files
|
|
|
|
* in the top-level `libs` folder to reflect that.
|
2021-10-07 18:44:55 +02:00
|
|
|
* You can copy these libraries from ~/.gradle/caches/modules-2/files-2.1
|
2021-01-19 13:14:52 +01:00
|
|
|
*/
|
|
|
|
// later versions than 2.1.1 require newer kotlin version
|
2022-08-23 16:22:38 +02:00
|
|
|
// implementation "io.insert-koin:koin-core-jvm:3.2.0"
|
|
|
|
// implementation "io.insert-koin:koin-android:3.2.0"
|
2021-01-19 13:14:52 +01:00
|
|
|
implementation fileTree(include: ['*.jar'], dir: "${rootProject.rootDir}/libs/koin-android")
|
|
|
|
implementation fileTree(include: ['*.aar'], dir: "${rootProject.rootDir}/libs/koin-android")
|
|
|
|
|
2022-08-23 16:22:38 +02:00
|
|
|
// implementation "cash.z.ecc.android:kotlin-bip39:1.0.4"
|
|
|
|
implementation fileTree(include: ['kotlin-bip39-jvm-1.0.4.jar'], dir: "${rootProject.rootDir}/libs")
|
2021-01-19 13:14:52 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test Dependencies (do not concern the AOSP build)
|
|
|
|
*/
|
|
|
|
lintChecks rootProject.ext.lint_libs.exceptions
|
|
|
|
|
|
|
|
// anything less than 'implementation' fails tests run with gradlew
|
|
|
|
testImplementation rootProject.ext.aosp_libs
|
2021-10-07 18:44:55 +02:00
|
|
|
testImplementation 'androidx.test.ext:junit:1.1.3'
|
2022-08-22 08:34:15 +02:00
|
|
|
testImplementation('org.robolectric:robolectric:4.8.1') {
|
2021-01-19 13:14:52 +01:00
|
|
|
// https://github.com/robolectric/robolectric/issues/5245
|
|
|
|
exclude group: "com.google.auto.service", module: "auto-service"
|
|
|
|
}
|
2022-08-22 08:34:15 +02:00
|
|
|
testImplementation 'org.hamcrest:hamcrest:2.2'
|
2021-01-19 13:14:52 +01:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
|
2021-09-02 13:45:56 +02:00
|
|
|
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5_version"
|
2021-01-19 13:14:52 +01:00
|
|
|
testImplementation "io.mockk:mockk:$mockk_version"
|
2021-09-02 13:45:56 +02:00
|
|
|
testImplementation 'org.bitcoinj:bitcoinj-core:0.15.10'
|
2021-01-19 13:14:52 +01:00
|
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5_version"
|
|
|
|
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:$junit5_version"
|
|
|
|
|
2021-10-07 18:44:55 +02:00
|
|
|
androidTestImplementation 'androidx.test:runner:1.4.0'
|
|
|
|
androidTestImplementation 'androidx.test:rules:1.4.0'
|
|
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
2021-01-19 13:14:52 +01:00
|
|
|
androidTestImplementation "io.mockk:mockk-android:$mockk_version"
|
|
|
|
}
|
2020-09-15 22:16:22 +02:00
|
|
|
|
2021-03-03 20:06:26 +01:00
|
|
|
apply from: "${rootProject.rootDir}/gradle/ktlint.gradle"
|
2020-09-25 15:23:32 +02:00
|
|
|
|
2018-11-08 04:04:37 +01:00
|
|
|
gradle.projectsEvaluated {
|
|
|
|
tasks.withType(JavaCompile) {
|
|
|
|
options.compilerArgs.add('-Xbootclasspath/p:app/libs/android.jar:app/libs/libcore.jar')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-15 22:16:22 +02:00
|
|
|
configurations {
|
|
|
|
all {
|
|
|
|
resolutionStrategy {
|
|
|
|
failOnNonReproducibleResolution()
|
|
|
|
}
|
2020-09-14 19:04:40 +02:00
|
|
|
}
|
2018-11-08 04:04:37 +01:00
|
|
|
}
|