2020-06-10 19:16:11 +00:00
|
|
|
plugins {
|
|
|
|
id("com.android.application")
|
|
|
|
id("kotlin-android")
|
|
|
|
id("kotlin-kapt")
|
|
|
|
id("kotlin-android-extensions")
|
|
|
|
id("com.google.firebase.appdistribution")
|
|
|
|
id("com.github.triplet.play") version "2.7.5"
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion(Config.Android.compileSdk)
|
|
|
|
|
2020-07-05 21:48:00 +00:00
|
|
|
ndkVersion = Config.Android.ndk
|
|
|
|
|
2020-06-10 19:16:11 +00:00
|
|
|
defaultConfig {
|
|
|
|
applicationId = "io.homeassistant.companion.android"
|
|
|
|
minSdkVersion(Config.Android.minSdk)
|
|
|
|
targetSdkVersion(Config.Android.targetSdk)
|
|
|
|
|
2020-08-29 22:23:58 +00:00
|
|
|
versionName = System.getenv("VERSION") ?: "LOCAL"
|
|
|
|
versionCode = System.getenv("VERSION_CODE")?.toIntOrNull() ?: 1
|
2020-08-30 19:19:20 +00:00
|
|
|
|
|
|
|
manifestPlaceholders["sentryRelease"] = "$applicationId@$versionName"
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
2020-06-11 17:15:50 +00:00
|
|
|
buildFeatures {
|
|
|
|
viewBinding = true
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
firebaseAppDistribution {
|
|
|
|
serviceCredentialsFile = "firebaseAppDistributionServiceCredentialsFile.json"
|
2020-09-02 04:34:19 +00:00
|
|
|
releaseNotesFile = "./app/build/outputs/changelogBeta"
|
2020-06-10 19:16:11 +00:00
|
|
|
groups = "continuous-deployment"
|
|
|
|
}
|
|
|
|
|
|
|
|
signingConfigs {
|
|
|
|
create("release") {
|
|
|
|
storeFile = file("release_keystore.keystore")
|
|
|
|
storePassword = System.getenv("KEYSTORE_PASSWORD") ?: ""
|
|
|
|
keyAlias = System.getenv("KEYSTORE_ALIAS") ?: ""
|
|
|
|
keyPassword = System.getenv("KEYSTORE_ALIAS_PASSWORD") ?: ""
|
|
|
|
isV1SigningEnabled = true
|
|
|
|
isV2SigningEnabled = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
named("debug").configure {
|
|
|
|
applicationIdSuffix = ".debug"
|
2020-08-02 18:40:44 +00:00
|
|
|
manifestPlaceholders["sentryEnabled"] = "false"
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
named("release").configure {
|
|
|
|
isDebuggable = false
|
|
|
|
isJniDebuggable = false
|
|
|
|
isZipAlignEnabled = true
|
|
|
|
signingConfig = signingConfigs.getByName("release")
|
2020-08-02 18:40:44 +00:00
|
|
|
manifestPlaceholders["sentryEnabled"] = "true"
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
}
|
2020-07-31 11:46:54 +00:00
|
|
|
flavorDimensions("version")
|
|
|
|
productFlavors {
|
|
|
|
create("minimal") {
|
|
|
|
applicationIdSuffix = ".minimal"
|
|
|
|
versionNameSuffix = "-minimal"
|
|
|
|
}
|
|
|
|
create("full") {
|
|
|
|
applicationIdSuffix = ""
|
|
|
|
versionNameSuffix = "-full"
|
|
|
|
}
|
|
|
|
}
|
2020-06-10 19:16:11 +00:00
|
|
|
|
2020-08-03 20:45:14 +00:00
|
|
|
playConfigs {
|
|
|
|
register("minimal") {
|
|
|
|
isEnabled = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-10 19:16:11 +00:00
|
|
|
testOptions {
|
|
|
|
unitTests.apply { isReturnDefaultValues = true }
|
|
|
|
}
|
|
|
|
|
2020-10-11 17:38:46 +00:00
|
|
|
tasks.withType<Test>().configureEach {
|
2020-06-10 19:16:11 +00:00
|
|
|
useJUnitPlatform {
|
|
|
|
includeEngines("spek2")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
disable("MissingTranslation")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
play {
|
|
|
|
serviceAccountCredentials = file("playStorePublishServiceCredentialsFile.json")
|
|
|
|
track = "beta"
|
|
|
|
resolutionStrategy = "ignore"
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation(project(":common"))
|
|
|
|
|
2020-07-05 14:09:17 +00:00
|
|
|
implementation(Config.Dependency.Misc.blurView)
|
2020-08-17 02:18:20 +00:00
|
|
|
implementation(Config.Dependency.Misc.iconDialog)
|
|
|
|
implementation(Config.Dependency.Misc.iconDialogMaterial)
|
2020-08-17 01:57:47 +00:00
|
|
|
implementation(Config.Dependency.Misc.emoji) {
|
|
|
|
exclude(group = "org.json", module = "json")
|
|
|
|
}
|
2020-07-05 14:09:17 +00:00
|
|
|
|
2020-06-10 19:16:11 +00:00
|
|
|
implementation(Config.Dependency.Kotlin.core)
|
|
|
|
implementation(Config.Dependency.Kotlin.coroutines)
|
|
|
|
implementation(Config.Dependency.Kotlin.coroutinesAndroid)
|
|
|
|
|
|
|
|
implementation(Config.Dependency.Google.dagger)
|
|
|
|
kapt(Config.Dependency.Google.daggerCompiler)
|
|
|
|
|
|
|
|
implementation(Config.Dependency.AndroidX.appcompat)
|
|
|
|
implementation(Config.Dependency.AndroidX.lifecycle)
|
|
|
|
implementation(Config.Dependency.AndroidX.constraintlayout)
|
|
|
|
implementation(Config.Dependency.AndroidX.recyclerview)
|
|
|
|
implementation(Config.Dependency.AndroidX.preference)
|
2020-08-11 14:37:43 +00:00
|
|
|
implementation(Config.Dependency.AndroidX.navigationFragment)
|
|
|
|
implementation(Config.Dependency.AndroidX.navigationUi)
|
2020-06-10 19:16:11 +00:00
|
|
|
implementation(Config.Dependency.Google.material)
|
|
|
|
|
2020-07-07 19:50:37 +00:00
|
|
|
implementation(Config.Dependency.AndroidX.roomRuntime)
|
|
|
|
implementation(Config.Dependency.AndroidX.roomKtx)
|
|
|
|
kapt(Config.Dependency.AndroidX.roomCompiler)
|
|
|
|
|
2020-07-07 19:58:51 +00:00
|
|
|
implementation(Config.Dependency.Misc.jackson)
|
2020-07-31 11:46:54 +00:00
|
|
|
implementation(Config.Dependency.Square.okhttp)
|
2020-10-13 16:13:50 +00:00
|
|
|
implementation(Config.Dependency.Square.picasso)
|
2020-07-31 11:46:54 +00:00
|
|
|
|
|
|
|
"fullImplementation"(Config.Dependency.Play.location)
|
|
|
|
"fullImplementation"(Config.Dependency.Firebase.core)
|
|
|
|
"fullImplementation"(Config.Dependency.Firebase.iid)
|
|
|
|
"fullImplementation"(Config.Dependency.Firebase.messaging)
|
2020-08-01 13:36:37 +00:00
|
|
|
"fullImplementation"(Config.Dependency.Misc.sentry)
|
2020-07-31 11:46:54 +00:00
|
|
|
"fullImplementation"(Config.Dependency.Kotlin.coroutinesPlayServices)
|
2020-06-10 19:16:11 +00:00
|
|
|
|
|
|
|
implementation(Config.Dependency.AndroidX.workManager)
|
|
|
|
implementation(Config.Dependency.AndroidX.biometric)
|
2020-08-09 14:25:17 +00:00
|
|
|
implementation(Config.Dependency.AndroidX.webKit)
|
2020-06-10 19:16:11 +00:00
|
|
|
|
|
|
|
testImplementation(Config.Dependency.Testing.spek2Jvm)
|
|
|
|
testImplementation(Config.Dependency.Testing.spek2JUnit)
|
|
|
|
testImplementation(Config.Dependency.Testing.assertJ)
|
|
|
|
testImplementation(Config.Dependency.Testing.mockk)
|
|
|
|
testImplementation(Config.Dependency.Kotlin.coroutinesTest)
|
2020-08-25 14:38:51 +00:00
|
|
|
|
|
|
|
implementation(Config.Dependency.Misc.exoCore)
|
|
|
|
implementation(Config.Dependency.Misc.exoHls)
|
|
|
|
implementation(Config.Dependency.Misc.exoUi)
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// This plugin must stay at the bottom
|
|
|
|
// https://developers.google.com/android/guides/google-services-plugin
|
2020-06-11 17:15:50 +00:00
|
|
|
apply(plugin = "com.google.gms.google-services")
|