2023-06-26 17:22:56 +00: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 10:35:38 +00:00
|
|
|
base
|
|
|
|
}
|
|
|
|
|
|
|
|
base {
|
|
|
|
archivesName.set("calculator")
|
2023-06-26 17:22:56 +00: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 13:27:39 +00:00
|
|
|
applicationId = libs.versions.app.version.appId.get()
|
2023-06-26 17:22:56 +00: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 10:35:38 +00:00
|
|
|
ksp {
|
|
|
|
arg("room.schemaLocation", "$projectDir/schemas")
|
|
|
|
}
|
2023-06-26 17:22:56 +00: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 19:42:59 +00:00
|
|
|
buildConfig = true
|
2023-06-26 17:22:56 +00: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 19:42:59 +00:00
|
|
|
namespace = "com.simplemobiletools.calculator"
|
2023-06-26 17:22:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation(libs.simple.tools.commons)
|
|
|
|
implementation(libs.auto.fit.text.view)
|
|
|
|
implementation(libs.exp4j)
|
2023-07-06 18:16:52 +00:00
|
|
|
implementation(libs.bundles.lifecycle)
|
2023-06-26 17:22:56 +00:00
|
|
|
implementation(libs.bundles.compose)
|
2023-07-06 18:16:52 +00:00
|
|
|
debugImplementation(libs.bundles.compose.preview)
|
2023-06-26 17:22:56 +00:00
|
|
|
|
|
|
|
implementation(libs.bundles.room)
|
|
|
|
ksp(libs.androidx.room.compiler)
|
|
|
|
|
|
|
|
}
|