2020-10-16 13:17:42 +00:00
|
|
|
import com.github.triplet.gradle.androidpublisher.ResolutionStrategy
|
2020-10-18 02:57:22 +00:00
|
|
|
import com.google.gms.googleservices.GoogleServicesPlugin.GoogleServicesPluginConfig
|
2020-10-16 13:17:42 +00:00
|
|
|
|
2020-06-10 19:16:11 +00:00
|
|
|
plugins {
|
|
|
|
id("com.android.application")
|
|
|
|
id("kotlin-android")
|
|
|
|
id("kotlin-kapt")
|
2021-11-04 03:01:46 +00:00
|
|
|
id("kotlin-parcelize")
|
2020-06-10 19:16:11 +00:00
|
|
|
id("com.google.firebase.appdistribution")
|
2021-06-10 23:44:48 +00:00
|
|
|
id("com.github.triplet.play")
|
2020-10-18 02:57:22 +00:00
|
|
|
id("com.google.gms.google-services")
|
2021-11-16 16:06:19 +00:00
|
|
|
kotlin("kapt")
|
|
|
|
id("dagger.hilt.android.plugin")
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2022-10-01 20:14:45 +00:00
|
|
|
namespace = "io.homeassistant.companion.android"
|
|
|
|
|
2022-09-05 13:58:13 +00:00
|
|
|
compileSdk = 33
|
2020-06-10 19:16:11 +00:00
|
|
|
|
2021-07-25 19:33:59 +00:00
|
|
|
ndkVersion = "21.3.6528147"
|
2020-07-05 21:48:00 +00:00
|
|
|
|
2020-06-10 19:16:11 +00:00
|
|
|
defaultConfig {
|
|
|
|
applicationId = "io.homeassistant.companion.android"
|
2021-10-13 03:35:05 +00:00
|
|
|
minSdk = 21
|
2022-10-19 18:43:15 +00:00
|
|
|
targetSdk = 33
|
2020-06-10 19:16:11 +00:00
|
|
|
|
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"
|
2022-12-31 01:34:20 +00:00
|
|
|
manifestPlaceholders["sentryDsn"] = System.getenv("SENTRY_DSN") ?: ""
|
2022-11-22 18:59:24 +00:00
|
|
|
|
|
|
|
bundle {
|
|
|
|
language {
|
|
|
|
enableSplit = false
|
|
|
|
}
|
|
|
|
}
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
2020-06-11 17:15:50 +00:00
|
|
|
buildFeatures {
|
|
|
|
viewBinding = true
|
2021-10-22 16:19:11 +00:00
|
|
|
compose = true
|
|
|
|
}
|
|
|
|
|
|
|
|
composeOptions {
|
2023-03-03 19:49:18 +00:00
|
|
|
kotlinCompilerExtensionVersion = "1.4.3"
|
2021-10-22 16:19:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "1.8"
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
2021-08-07 01:41:30 +00:00
|
|
|
sourceCompatibility(JavaVersion.VERSION_11)
|
|
|
|
targetCompatibility(JavaVersion.VERSION_11)
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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") {
|
2020-10-14 15:21:15 +00:00
|
|
|
storeFile = file(System.getenv("KEYSTORE_PATH") ?: "release_keystore.keystore")
|
2020-06-10 19:16:11 +00:00
|
|
|
storePassword = System.getenv("KEYSTORE_PASSWORD") ?: ""
|
|
|
|
keyAlias = System.getenv("KEYSTORE_ALIAS") ?: ""
|
|
|
|
keyPassword = System.getenv("KEYSTORE_ALIAS_PASSWORD") ?: ""
|
2021-10-13 03:35:05 +00:00
|
|
|
enableV1Signing = true
|
|
|
|
enableV2Signing = true
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
named("debug").configure {
|
|
|
|
applicationIdSuffix = ".debug"
|
|
|
|
}
|
|
|
|
named("release").configure {
|
|
|
|
isDebuggable = false
|
|
|
|
isJniDebuggable = false
|
|
|
|
signingConfig = signingConfigs.getByName("release")
|
|
|
|
}
|
|
|
|
}
|
2021-10-14 00:58:14 +00:00
|
|
|
flavorDimensions.add("version")
|
2020-07-31 11:46:54 +00:00
|
|
|
productFlavors {
|
|
|
|
create("minimal") {
|
|
|
|
applicationIdSuffix = ".minimal"
|
|
|
|
versionNameSuffix = "-minimal"
|
|
|
|
}
|
|
|
|
create("full") {
|
|
|
|
applicationIdSuffix = ""
|
|
|
|
versionNameSuffix = "-full"
|
|
|
|
}
|
2021-05-07 01:56:14 +00:00
|
|
|
|
|
|
|
// Generate a list of application ids into BuildConfig
|
|
|
|
val values = productFlavors.joinToString {
|
|
|
|
"\"${it.applicationId ?: defaultConfig.applicationId}${it.applicationIdSuffix}\""
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultConfig.buildConfigField("String[]", "APPLICATION_IDS", "{$values}")
|
2020-07-31 11:46:54 +00:00
|
|
|
}
|
2020-06-10 19:16:11 +00:00
|
|
|
|
2020-08-03 20:45:14 +00:00
|
|
|
playConfigs {
|
|
|
|
register("minimal") {
|
2020-10-16 13:17:42 +00:00
|
|
|
enabled.set(false)
|
2020-08-03 20:45:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-10 19:16:11 +00:00
|
|
|
testOptions {
|
2020-10-20 13:34:45 +00:00
|
|
|
unitTests.isReturnDefaultValues = true
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
2020-10-11 17:38:46 +00:00
|
|
|
tasks.withType<Test>().configureEach {
|
2020-06-10 19:16:11 +00:00
|
|
|
useJUnitPlatform {
|
|
|
|
includeEngines("spek2")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-13 03:35:05 +00:00
|
|
|
lint {
|
2022-01-27 02:07:55 +00:00
|
|
|
abortOnError = false
|
|
|
|
disable += "MissingTranslation"
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
2021-11-27 18:08:26 +00:00
|
|
|
|
|
|
|
kapt {
|
|
|
|
correctErrorTypes = true
|
|
|
|
}
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
play {
|
2020-10-16 13:17:42 +00:00
|
|
|
serviceAccountCredentials.set(file("playStorePublishServiceCredentialsFile.json"))
|
2023-01-11 22:31:53 +00:00
|
|
|
track.set("internal")
|
2020-10-16 13:17:42 +00:00
|
|
|
resolutionStrategy.set(ResolutionStrategy.IGNORE)
|
2021-10-14 03:17:32 +00:00
|
|
|
// We will depend on the wear commit.
|
2021-10-14 03:46:49 +00:00
|
|
|
commit.set(true)
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation(project(":common"))
|
|
|
|
|
2021-07-25 19:33:59 +00:00
|
|
|
implementation("com.github.Dimezis:BlurView:version-1.6.6")
|
2022-12-31 00:53:50 +00:00
|
|
|
implementation("org.altbeacon:android-beacon-library:2.19.5")
|
2021-07-25 19:33:59 +00:00
|
|
|
implementation("com.maltaisn:icondialog:3.3.0")
|
|
|
|
implementation("com.maltaisn:iconpack-community-material:5.3.45")
|
2020-07-05 14:09:17 +00:00
|
|
|
|
2023-02-21 17:55:00 +00:00
|
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.8.10")
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.10")
|
2022-07-17 03:24:38 +00:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
|
2022-07-17 03:32:15 +00:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
|
2022-10-25 21:07:19 +00:00
|
|
|
"fullImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4")
|
2021-07-25 19:33:59 +00:00
|
|
|
|
2023-02-17 14:01:08 +00:00
|
|
|
implementation("com.google.dagger:hilt-android:2.45")
|
2023-02-15 01:35:38 +00:00
|
|
|
kapt("com.google.dagger:hilt-android-compiler:2.45")
|
2021-07-25 19:33:59 +00:00
|
|
|
|
2023-02-21 17:55:00 +00:00
|
|
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
2022-08-03 22:03:14 +00:00
|
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.1")
|
2022-05-30 19:40:54 +00:00
|
|
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
2021-07-26 00:56:58 +00:00
|
|
|
implementation("androidx.recyclerview:recyclerview:1.2.1")
|
2022-05-30 19:40:54 +00:00
|
|
|
implementation("androidx.preference:preference-ktx:1.2.0")
|
2023-02-21 17:55:00 +00:00
|
|
|
implementation("com.google.android.material:material:1.8.0")
|
2023-01-13 16:18:54 +00:00
|
|
|
implementation("androidx.fragment:fragment-ktx:1.5.5")
|
2021-07-25 19:33:59 +00:00
|
|
|
|
2022-01-22 01:44:27 +00:00
|
|
|
implementation("com.squareup.retrofit2:retrofit:2.9.0")
|
2023-01-26 01:32:51 +00:00
|
|
|
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.5")
|
2022-06-14 13:52:56 +00:00
|
|
|
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
2021-07-25 19:33:59 +00:00
|
|
|
implementation("com.squareup.picasso:picasso:2.8")
|
|
|
|
|
2022-11-12 13:24:38 +00:00
|
|
|
"fullImplementation"("com.google.android.gms:play-services-location:21.0.1")
|
2022-12-18 21:37:35 +00:00
|
|
|
"fullImplementation"("com.google.android.gms:play-services-home:16.0.0")
|
2023-03-03 19:49:18 +00:00
|
|
|
"fullImplementation"("com.google.android.gms:play-services-threadnetwork:16.0.0")
|
|
|
|
"fullImplementation"(platform("com.google.firebase:firebase-bom:31.2.3"))
|
2022-09-24 20:04:58 +00:00
|
|
|
"fullImplementation"("com.google.firebase:firebase-messaging")
|
2023-03-03 19:14:30 +00:00
|
|
|
"fullImplementation"("io.sentry:sentry-android:6.15.0")
|
2022-07-17 03:42:40 +00:00
|
|
|
"fullImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4")
|
2022-09-24 20:04:58 +00:00
|
|
|
"fullImplementation"("com.google.android.gms:play-services-wearable:18.0.0")
|
2022-01-21 00:49:25 +00:00
|
|
|
"fullImplementation"("androidx.wear:wear-remote-interactions:1.0.0")
|
2021-07-25 19:33:59 +00:00
|
|
|
|
|
|
|
implementation("androidx.biometric:biometric:1.1.0")
|
2023-02-21 17:55:00 +00:00
|
|
|
implementation("androidx.webkit:webkit:1.6.0")
|
2021-07-25 19:33:59 +00:00
|
|
|
|
2023-03-03 19:49:18 +00:00
|
|
|
implementation("com.google.android.exoplayer:exoplayer-core:2.18.3")
|
|
|
|
implementation("com.google.android.exoplayer:exoplayer-hls:2.18.3")
|
|
|
|
implementation("com.google.android.exoplayer:exoplayer-ui:2.18.3")
|
|
|
|
"fullImplementation"("com.google.android.exoplayer:extension-cronet:2.18.3")
|
|
|
|
"minimalImplementation"("com.google.android.exoplayer:extension-cronet:2.18.3") {
|
2022-01-21 00:49:25 +00:00
|
|
|
exclude(group = "com.google.android.gms", module = "play-services-cronet")
|
|
|
|
}
|
2023-01-13 16:18:54 +00:00
|
|
|
"minimalImplementation"("org.chromium.net:cronet-embedded:108.5359.79")
|
2021-10-22 16:19:11 +00:00
|
|
|
|
2023-02-21 17:55:00 +00:00
|
|
|
implementation(platform("androidx.compose:compose-bom:2023.01.00"))
|
2022-11-03 16:31:35 +00:00
|
|
|
implementation("androidx.compose.animation:animation")
|
2023-03-03 19:49:18 +00:00
|
|
|
implementation("androidx.compose.compiler:compiler:1.4.3")
|
2022-11-03 16:31:35 +00:00
|
|
|
implementation("androidx.compose.foundation:foundation")
|
|
|
|
implementation("androidx.compose.material:material")
|
|
|
|
implementation("androidx.compose.material:material-icons-core")
|
|
|
|
implementation("androidx.compose.material:material-icons-extended")
|
|
|
|
implementation("androidx.compose.runtime:runtime")
|
|
|
|
implementation("androidx.compose.ui:ui")
|
|
|
|
implementation("androidx.compose.ui:ui-tooling")
|
|
|
|
implementation("androidx.activity:activity-compose:1.6.1")
|
|
|
|
implementation("androidx.navigation:navigation-compose:2.5.3")
|
2023-01-16 13:43:02 +00:00
|
|
|
implementation("com.google.accompanist:accompanist-themeadapter-material:0.28.0")
|
2021-10-28 17:50:49 +00:00
|
|
|
|
2022-10-21 17:56:36 +00:00
|
|
|
implementation("com.mikepenz:iconics-core:5.4.0")
|
2022-10-21 17:42:10 +00:00
|
|
|
implementation("com.mikepenz:iconics-compose:5.4.0")
|
2022-10-21 17:57:15 +00:00
|
|
|
implementation("com.mikepenz:community-material-typeface:7.0.96.0-kotlin@aar")
|
|
|
|
|
2022-11-22 19:02:47 +00:00
|
|
|
"fullImplementation"("org.burnoutcrew.composereorderable:reorderable:0.9.6")
|
2022-01-25 02:16:11 +00:00
|
|
|
implementation("com.github.AppDevNext:ChangeLog:3.4")
|
2023-01-11 22:31:53 +00:00
|
|
|
|
|
|
|
"fullImplementation"("androidx.car.app:app:1.3.0-rc01")
|
2020-06-10 19:16:11 +00:00
|
|
|
}
|
|
|
|
|
2020-10-18 02:57:22 +00:00
|
|
|
// Disable to fix memory leak and be compatible with the configuration cache.
|
|
|
|
configure<GoogleServicesPluginConfig> {
|
|
|
|
disableVersionCheck = true
|
|
|
|
}
|