Simple-Calculator/app/build.gradle.kts

120 lines
3.6 KiB
Plaintext
Raw Normal View History

2023-06-26 19:22:56 +02:00
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)
2023-09-13 12:35:38 +02:00
base
}
base {
archivesName.set("calculator")
2023-06-26 19:22:56 +02:00
}
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 {
2023-07-24 15:27:39 +02:00
applicationId = libs.versions.app.version.appId.get()
2023-06-26 19:22:56 +02:00
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()
2023-09-13 12:35:38 +02:00
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
2023-06-26 19:22:56 +02:00
}
signingConfigs {
if (keystorePropertiesFile.exists()) {
register("release") {
keyAlias = keystoreProperties.getProperty("keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword")
storeFile = file(keystoreProperties.getProperty("storeFile"))
storePassword = keystoreProperties.getProperty("storePassword")
}
}
}
buildTypes {
debug {
applicationIdSuffix = ".debug"
}
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
if (keystorePropertiesFile.exists()) {
signingConfig = signingConfigs.getByName("release")
}
}
}
buildFeatures {
viewBinding = true
compose = true
2023-06-27 21:42:59 +02:00
buildConfig = true
2023-06-26 19:22:56 +02:00
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
flavorDimensions.add("variants")
productFlavors {
register("core")
register("fdroid")
register("prepaid")
}
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()
kotlinOptions.freeCompilerArgs = listOf(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-Xcontext-receivers"
)
}
sourceSets {
getByName("main").java.srcDirs("src/main/kotlin")
}
lint {
checkReleaseBuilds = false
abortOnError = false
}
2023-06-27 21:42:59 +02:00
namespace = "com.simplemobiletools.calculator"
2023-06-26 19:22:56 +02:00
}
dependencies {
implementation(libs.simple.tools.commons)
implementation(libs.auto.fit.text.view)
implementation(libs.exp4j)
implementation(libs.bundles.lifecycle)
2023-06-26 19:22:56 +02:00
implementation(libs.bundles.compose)
debugImplementation(libs.bundles.compose.preview)
2023-06-26 19:22:56 +02:00
implementation(libs.bundles.room)
ksp(libs.androidx.room.compiler)
}