97 lines
2.8 KiB
Kotlin
97 lines
2.8 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
}
|
|
val audiobookApiTokenFile = file("${System.getProperty("user.home")}/.aletheia/audiobook-api-token.txt")
|
|
val audiobookApiToken = if (audiobookApiTokenFile.isFile) {
|
|
audiobookApiTokenFile.readText().trim()
|
|
} else {
|
|
""
|
|
}
|
|
fun quotedBuildConfig(value: String): String =
|
|
"\"${value.replace("\\", "\\\\").replace("\"", "\\\"")}\""
|
|
|
|
android {
|
|
namespace = "com.aletheia.app"
|
|
compileSdk = 36
|
|
|
|
defaultConfig {
|
|
applicationId = "com.aletheia.app"
|
|
minSdk = 24
|
|
targetSdk = 36
|
|
versionCode = 48
|
|
versionName = "2.37"
|
|
|
|
buildConfigField(
|
|
"String",
|
|
"AUDIOBOOK_API_BASE_URL",
|
|
quotedBuildConfig("https://argus.kusoft.xyz/aletheia-tts/")
|
|
)
|
|
buildConfigField("String", "AUDIOBOOK_API_TOKEN", quotedBuildConfig(audiobookApiToken))
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
vectorDrawables {
|
|
useSupportLibrary = true
|
|
}
|
|
ndk {
|
|
abiFilters += "arm64-v8a"
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix = ".kotlin"
|
|
versionNameSuffix = "-kotlin-debug"
|
|
}
|
|
release {
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding = true
|
|
buildConfig = true
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.core:core-ktx:1.15.0")
|
|
implementation("androidx.appcompat:appcompat:1.7.0")
|
|
implementation("com.google.android.material:material:1.12.0")
|
|
implementation("androidx.activity:activity-ktx:1.10.1")
|
|
implementation("androidx.fragment:fragment-ktx:1.8.6")
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7")
|
|
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.7")
|
|
implementation("androidx.recyclerview:recyclerview:1.4.0")
|
|
implementation("androidx.constraintlayout:constraintlayout:2.2.1")
|
|
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
|
implementation("androidx.webkit:webkit:1.12.1")
|
|
|
|
testImplementation("junit:junit:4.13.2")
|
|
testImplementation("org.json:json:20240303")
|
|
androidTestImplementation("androidx.test.ext:junit:1.2.1")
|
|
androidTestImplementation("androidx.test:runner:1.6.2")
|
|
}
|
|
|