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 {
|
2020-04-21 08:24:24 +00:00
|
|
|
outputFileName = "aps_${defaultConfig.versionName}.apk"
|
2019-12-15 21:49:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-10 19:37:49 +00:00
|
|
|
viewBinding.enabled = true
|
|
|
|
|
2019-11-06 14:11:15 +00:00
|
|
|
defaultConfig {
|
2019-12-31 15:27:38 +00:00
|
|
|
applicationId versions.packageName
|
2020-04-21 08:31:40 +00:00
|
|
|
versionCode 10701
|
|
|
|
versionName '1.8.0-SNAPSHOT'
|
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
|
2020-04-06 20:56:52 +00:00
|
|
|
implementation deps.androidx.activity_ktx
|
2019-11-26 18:18:18 +00:00
|
|
|
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-04-06 20:56:52 +00:00
|
|
|
implementation deps.androidx.fragment_ktx
|
|
|
|
implementation deps.androidx.lifecycle_livedata_ktx
|
2020-04-10 11:18:42 +00:00
|
|
|
implementation deps.androidx.lifecycle_viewmodel_ktx
|
2020-03-05 15:35:50 +00:00
|
|
|
implementation deps.androidx.local_broadcast_manager
|
|
|
|
implementation deps.androidx.material
|
2019-11-26 18:18:18 +00:00
|
|
|
implementation deps.androidx.preference
|
2020-04-10 11:18:42 +00:00
|
|
|
implementation deps.androidx.recycler_view
|
|
|
|
implementation deps.androidx.recycler_view_selection
|
2020-04-17 13:06:07 +00:00
|
|
|
implementation deps.androidx.security
|
|
|
|
implementation deps.androidx.swiperefreshlayout
|
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
|
2020-03-24 13:03:40 +00:00
|
|
|
implementation deps.third_party.publicsuffixlist
|
2019-11-26 18:18:18 +00:00
|
|
|
implementation deps.third_party.ssh_auth
|
2020-01-26 06:05:10 +00:00
|
|
|
implementation deps.third_party.timber
|
2020-03-24 13:03:40 +00:00
|
|
|
implementation deps.third_party.timberkt
|
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
|
2020-04-15 15:12:28 +00:00
|
|
|
androidTestImplementation deps.testing.kotlin_test_junit
|
2019-11-26 18:18:18 +00:00
|
|
|
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
|
|
|
}
|