2019-11-06 14:11:15 +00:00
|
|
|
/*
|
2020-01-29 19:30:20 +00:00
|
|
|
* Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
2019-11-06 14:11:15 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
*/
|
|
|
|
plugins {
|
|
|
|
id 'kotlin-android'
|
|
|
|
id 'kotlin-android-extensions'
|
|
|
|
}
|
|
|
|
|
2019-12-15 21:49:18 +00:00
|
|
|
final def keystorePropertiesFile = rootProject.file 'keystore.properties'
|
|
|
|
|
|
|
|
final def gitHash = { ->
|
|
|
|
final def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine 'git', 'describe', '--tags'
|
|
|
|
standardOutput = stdout
|
|
|
|
}
|
|
|
|
stdout.toString().trim()
|
|
|
|
}
|
|
|
|
|
|
|
|
static final def isSnapshot() {
|
|
|
|
return System.env['GITHUB_WORKFLOW'] != null && System.env['SNAPSHOT'] != null
|
|
|
|
}
|
|
|
|
|
2019-11-06 14:11:15 +00:00
|
|
|
android {
|
2019-12-15 21:49:18 +00:00
|
|
|
if (isSnapshot()) {
|
|
|
|
android.applicationVariants.all { final variant ->
|
|
|
|
variant.outputs.all {
|
|
|
|
outputFileName = "aps_${versions.versionName}.apk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-06 14:11:15 +00:00
|
|
|
defaultConfig {
|
2019-12-31 15:27:38 +00:00
|
|
|
applicationId versions.packageName
|
2019-11-06 14:11:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
abortOnError = true // make sure build fails with lint errors!
|
|
|
|
disable 'MissingTranslation', 'PluralsCandidate'
|
|
|
|
}
|
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
exclude '.readme'
|
|
|
|
exclude 'META-INF/LICENSE.txt'
|
|
|
|
exclude 'META-INF/NOTICE.txt'
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled = true
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
2020-01-27 17:54:04 +00:00
|
|
|
buildConfigField 'boolean', 'ENABLE_DEBUG_FEATURES', isSnapshot() ? 'true' : 'false'
|
2019-11-06 14:11:15 +00:00
|
|
|
}
|
|
|
|
debug {
|
|
|
|
applicationIdSuffix = '.debug'
|
|
|
|
versionNameSuffix = '-debug'
|
|
|
|
minifyEnabled = false
|
2020-01-27 17:54:04 +00:00
|
|
|
buildConfigField 'boolean', 'ENABLE_DEBUG_FEATURES', 'true'
|
2019-11-06 14:11:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-15 21:49:18 +00:00
|
|
|
if (keystorePropertiesFile.exists()) {
|
|
|
|
final def keystoreProperties = new Properties()
|
|
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
2019-11-06 14:11:15 +00:00
|
|
|
signingConfigs {
|
|
|
|
release {
|
2019-12-15 21:49:18 +00:00
|
|
|
keyAlias = keystoreProperties['keyAlias']
|
|
|
|
keyPassword = keystoreProperties['keyPassword']
|
|
|
|
storeFile = rootProject.file keystoreProperties['storeFile']
|
|
|
|
storePassword = keystoreProperties['storePassword']
|
2019-11-06 14:11:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
buildTypes.release.signingConfig = signingConfigs.release
|
2019-12-15 21:49:18 +00:00
|
|
|
buildTypes.debug.signingConfig = signingConfigs.release
|
2019-11-06 14:11:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2019-11-26 18:18:18 +00:00
|
|
|
implementation deps.androidx.annotation
|
|
|
|
implementation deps.androidx.appcompat
|
|
|
|
implementation deps.androidx.biometric
|
|
|
|
implementation deps.androidx.constraint_layout
|
2020-03-05 15:35:50 +00:00
|
|
|
implementation deps.androidx.core_ktx
|
2019-11-26 18:18:18 +00:00
|
|
|
implementation deps.androidx.documentfile
|
2020-03-05 15:35:50 +00:00
|
|
|
implementation deps.androidx.lifecycle_runtime_ktx
|
|
|
|
implementation deps.androidx.local_broadcast_manager
|
|
|
|
implementation deps.androidx.material
|
2019-11-26 18:18:18 +00:00
|
|
|
implementation deps.androidx.preference
|
2020-02-29 20:50:09 +00:00
|
|
|
implementation deps.androidx.swiperefreshlayout
|
2020-03-07 12:15:18 +00:00
|
|
|
implementation(deps.androidx.recycler_view)
|
2020-01-30 14:31:06 +00:00
|
|
|
|
|
|
|
implementation deps.kotlin.coroutines.android
|
|
|
|
implementation deps.kotlin.coroutines.core
|
|
|
|
|
2019-11-26 18:18:18 +00:00
|
|
|
implementation deps.third_party.commons_io
|
|
|
|
implementation deps.third_party.commons_codec
|
2020-01-26 06:19:45 +00:00
|
|
|
implementation deps.third_party.fastscroll
|
2019-11-26 18:18:18 +00:00
|
|
|
implementation(deps.third_party.jgit) {
|
2019-11-06 14:11:15 +00:00
|
|
|
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
|
|
|
|
}
|
2019-11-26 18:18:18 +00:00
|
|
|
implementation deps.third_party.jsch
|
|
|
|
implementation deps.third_party.openpgp_ktx
|
|
|
|
implementation deps.third_party.ssh_auth
|
2020-01-26 06:05:10 +00:00
|
|
|
implementation deps.third_party.timber
|
2020-01-27 17:54:04 +00:00
|
|
|
implementation deps.third_party.whatthestack
|
|
|
|
|
|
|
|
if (isSnapshot()) {
|
|
|
|
implementation deps.third_party.leakcanary
|
|
|
|
} else {
|
|
|
|
debugImplementation deps.third_party.leakcanary
|
|
|
|
}
|
2019-11-06 14:11:15 +00:00
|
|
|
|
|
|
|
// Testing-only dependencies
|
2019-11-26 18:18:18 +00:00
|
|
|
androidTestImplementation deps.testing.junit
|
|
|
|
androidTestImplementation deps.testing.androidx.runner
|
|
|
|
androidTestImplementation deps.testing.androidx.rules
|
|
|
|
androidTestImplementation deps.testing.androidx.junit
|
|
|
|
androidTestImplementation deps.testing.androidx.espresso_core
|
|
|
|
androidTestImplementation deps.testing.androidx.espresso_intents
|
2019-11-06 14:11:15 +00:00
|
|
|
}
|