Simple-Clock/app/build.gradle.kts
Ensar Sarajčić 8e713bb68c Migrate to viewbinding and kotlin gradle scripts
- Updated to viewbinding and kotlin gradle scripts
- Updated kotlin to 1.9.0
- Updated Android Gradle Plugin to 8.1.0
- Updated `androidx.lifecycle` to 2.6.1
- Updated `room` to 2.6.0-alpha02
- Updated `androidx.work` to 2.8.1
- Updated `kotlinx.coroutines` to 1.7.3
- Updated `stetho` to 1.6.0
2023-08-04 16:19:11 +02:00

109 lines
3.3 KiB
Text

import java.io.FileInputStream
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.konan.properties.Properties
plugins {
alias(libs.plugins.android)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.ksp)
}
val keystorePropertiesFile: File = rootProject.file("keystore.properties")
val keystoreProperties = Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}
android {
compileSdk = project.libs.versions.app.build.compileSDKVersion.get().toInt()
defaultConfig {
applicationId = libs.versions.app.version.appId.get()
minSdk = project.libs.versions.app.build.minimumSDK.get().toInt()
targetSdk = project.libs.versions.app.build.targetSDK.get().toInt()
versionName = project.libs.versions.app.version.versionName.get()
versionCode = project.libs.versions.app.version.versionCode.get().toInt()
setProperty("archivesBaseName", "clock")
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
}
signingConfigs {
if (keystorePropertiesFile.exists()) {
register("release") {
keyAlias = keystoreProperties.getProperty("keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword")
storeFile = file(keystoreProperties.getProperty("storeFile"))
storePassword = keystoreProperties.getProperty("storePassword")
}
}
}
buildFeatures {
viewBinding = true
buildConfig = true
}
buildTypes {
debug {
applicationIdSuffix = ".debug"
}
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
if (keystorePropertiesFile.exists()) {
signingConfig = signingConfigs.getByName("release")
}
}
}
flavorDimensions.add("variants")
productFlavors {
register("core")
register("fdroid")
register("prepaid")
}
sourceSets {
getByName("main").java.srcDirs("src/main/kotlin")
}
compileOptions {
val currentJavaVersionFromLibs = JavaVersion.valueOf(libs.versions.app.build.javaVersion.get().toString())
sourceCompatibility = currentJavaVersionFromLibs
targetCompatibility = currentJavaVersionFromLibs
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = project.libs.versions.app.build.kotlinJVMTarget.get()
}
namespace = libs.versions.app.version.appId.get()
lint {
checkReleaseBuilds = false
abortOnError = false
}
}
dependencies {
implementation(libs.simple.tools.commons)
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation(libs.bundles.lifecycle)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.preference)
implementation(libs.androidx.work)
implementation(libs.kotlinx.coroutines)
implementation(libs.stetho)
implementation(libs.numberpicker)
implementation(libs.autofittextview)
implementation(libs.eventbus)
implementation(libs.bundles.room)
ksp(libs.androidx.room.compiler)
}