Neo-Store/build.gradle.kts

227 lines
7.6 KiB
Plaintext
Raw Permalink Normal View History

import com.android.build.gradle.internal.tasks.factory.dependsOn
2023-12-22 01:39:07 +01:00
val vActivity = "1.8.2"
2023-11-15 03:25:07 +01:00
val vCoil = "2.5.0"
2024-01-01 23:14:15 +01:00
val vComposeCompiler = "1.5.7"
val vCompose = "1.6.0-beta03"
val vComposeAccompanist = "0.33.2-alpha"
2023-12-22 01:39:07 +01:00
val vComposeHtml = "1.6.0"
2024-01-01 23:14:15 +01:00
val vComposeMaterial3 = "1.2.0-beta01"
2023-10-31 02:21:44 +01:00
val vCoroutines = "1.7.3"
2024-01-01 23:14:15 +01:00
val vJackson = "2.16.1"
2023-12-22 01:39:07 +01:00
val vKoin = "3.5.3"
2023-10-31 02:21:44 +01:00
val vKoinKsp = "1.3.0"
2023-12-22 01:39:07 +01:00
val vKotlin = "1.9.21"
val vKSP = "1.0.16"
val vKtor = "2.3.7"
2024-01-08 01:43:28 +01:00
val vLibsu = "5.2.2"
2023-10-31 02:21:44 +01:00
val vLifecycle = "2.6.2"
2023-12-22 01:39:07 +01:00
val vMarkdown = "0.6.1"
val vMaterial = "1.11.0"
2023-10-31 02:21:44 +01:00
val vMoshi = "1.15.0"
2023-12-22 01:39:07 +01:00
val vNavigation = "2.7.6"
val vOkhttp = "5.0.0-alpha.12"
2023-11-15 03:25:07 +01:00
val vPreference = "1.2.1"
2024-03-06 20:43:43 +01:00
val vRealm = "1.13.0"
2023-12-22 01:39:07 +01:00
val vRoom = "2.6.1"
val vSerialization = "1.6.2"
2023-10-31 02:21:44 +01:00
val vSimpleStorage = "1.5.5"
2023-12-22 01:39:07 +01:00
val vWork = "2.9.0"
2023-11-15 03:08:11 +01:00
val vZXing = "3.5.2"
2022-04-21 01:20:00 +05:30
plugins {
2024-01-08 01:42:33 +01:00
id("com.android.application") version ("8.2.1")
2023-12-22 01:39:07 +01:00
kotlin("android") version ("1.9.21")
kotlin("plugin.serialization") version ("1.9.21")
id("com.google.devtools.ksp") version ("1.9.21-1.0.16")
2024-03-06 20:43:43 +01:00
id("io.realm.kotlin") version ("1.13.0")
}
android {
namespace = "com.machiav3lli.fdroid"
2023-07-04 02:05:02 +02:00
compileSdk = 34
defaultConfig {
applicationId = "com.machiav3lli.fdroid"
2023-06-10 16:09:03 +02:00
minSdk = 24
2023-11-14 01:52:24 +01:00
targetSdk = 34
2024-01-08 02:04:33 +01:00
versionCode = 1009
versionName = "1.0.0-beta03"
buildConfigField("String", "KEY_API_EXODUS", "\"81f30e4903bde25023857719e71c94829a41e6a5\"")
}
2022-06-30 12:02:16 +05:30
sourceSets.forEach { source ->
val javaDir = source.java.srcDirs.find { it.name == "java" }
source.java {
srcDir(File(javaDir?.parentFile, "kotlin"))
}
}
compileOptions {
2023-04-23 02:02:50 +02:00
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
2023-08-09 09:24:42 +02:00
jvmTarget = JavaVersion.VERSION_17.toString()
freeCompilerArgs = listOf("-Xjvm-default=all-compatibility")
}
buildFeatures {
2023-04-23 02:02:50 +02:00
buildConfig = true
compose = true
}
composeOptions {
2023-10-31 02:21:44 +01:00
kotlinCompilerExtensionVersion = vComposeCompiler
}
2023-06-21 17:01:52 +02:00
applicationVariants.all { variant ->
2023-11-17 23:01:11 +01:00
variant.outputs
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
.forEach { output ->
output.outputFileName = "Neo_Store_${variant.name}_${variant.versionName}.apk"
}
2023-06-21 17:01:52 +02:00
true
}
buildTypes {
named("debug") {
isMinifyEnabled = false
isShrinkResources = false
applicationIdSuffix = ".debug"
resValue("string", "application_name", "Neo Store-Debug")
}
create("neo") {
isMinifyEnabled = false
isShrinkResources = false
applicationIdSuffix = ".neo"
2022-06-06 03:01:12 +02:00
resValue("string", "application_name", "Neo Store-beta")
}
named("release") {
isMinifyEnabled = true
isShrinkResources = true
resValue("string", "application_name", "Neo Store")
}
all {
isCrunchPngs = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard.pro"
)
}
}
2023-04-23 02:26:00 +02:00
packaging {
jniLibs {
excludes += listOf("/okhttp3/internal/publicsuffix/*")
}
resources {
excludes += listOf(
"/DebugProbesKt.bin",
"/kotlin/**.kotlin_builtins",
"/kotlin/**.kotlin_metadata",
"/META-INF/**.kotlin_module",
"/META-INF/**.pro",
"/META-INF/**.version",
"/okhttp3/internal/publicsuffix/*"
)
}
}
lint {
disable += "InvalidVectorPath"
warning += "InvalidPackage"
}
}
dependencies {
// Core
2023-10-31 02:21:44 +01:00
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$vKotlin")
implementation("com.google.devtools.ksp:symbol-processing-api:$vKotlin-$vKSP")
2023-11-15 03:25:07 +01:00
implementation("androidx.preference:preference-ktx:$vPreference")
2023-10-31 02:21:44 +01:00
implementation("androidx.activity:activity-compose:$vActivity")
2023-12-25 00:10:07 +01:00
// use the new WorkInfo.stopReason (report stopReason), setNextScheduleTimeOverride (Precise scheduling), Configuration.Builder.setContentUriTriggerWorkersLimit (limit for content uri workers)
2023-11-15 03:25:07 +01:00
implementation("androidx.work:work-runtime:$vWork")
// Material3
2023-10-31 02:21:44 +01:00
implementation("com.google.android.material:material:$vMaterial")
// Coil
2023-10-31 02:21:44 +01:00
implementation("io.coil-kt:coil:$vCoil")
implementation("io.coil-kt:coil-compose:$vCoil")
2023-11-15 03:08:11 +01:00
// ZXing
implementation("com.google.zxing:core:$vZXing")
2023-06-16 13:44:21 +02:00
// Koin
2023-10-31 02:21:44 +01:00
implementation("io.insert-koin:koin-android:$vKoin")
implementation("io.insert-koin:koin-androidx-workmanager:$vKoin")
implementation("io.insert-koin:koin-annotations:$vKoinKsp")
ksp("io.insert-koin:koin-ksp-compiler:$vKoinKsp")
2023-06-16 13:44:21 +02:00
2023-06-21 17:01:52 +02:00
// Ktor
2023-10-31 02:21:44 +01:00
implementation("io.ktor:ktor-client-core:$vKtor")
implementation("io.ktor:ktor-client-okhttp:$vKtor")
implementation("io.ktor:ktor-client-logging:$vKtor")
2023-06-21 17:01:52 +02:00
// OkHttps
2023-10-31 02:21:44 +01:00
implementation("com.squareup.okhttp3:okhttp:$vOkhttp")
implementation("com.squareup.okhttp3:logging-interceptor:$vOkhttp")
// LibSu
2023-10-31 02:21:44 +01:00
implementation("com.github.topjohnwu.libsu:core:$vLibsu")
// JSON
2023-10-31 02:21:44 +01:00
implementation("com.fasterxml.jackson.core:jackson-core:$vJackson")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$vSerialization")
// Markdown
2023-10-31 02:21:44 +01:00
implementation("org.jetbrains:markdown:$vMarkdown")
implementation("de.charlex.compose:html-text:$vComposeHtml")
2023-02-27 01:51:44 +01:00
// Storage
2023-10-31 02:21:44 +01:00
implementation("com.anggrayudi:storage:$vSimpleStorage")
2023-02-27 01:51:44 +01:00
// Coroutines / Lifecycle
2023-10-31 02:21:44 +01:00
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$vLifecycle")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$vCoroutines")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$vCoroutines")
// Room
2024-03-06 20:43:43 +01:00
//implementation("androidx.room:room-runtime:$vRoom")
//implementation("androidx.room:room-ktx:$vRoom")
//ksp("androidx.room:room-compiler:$vRoom")
implementation("io.realm.kotlin:library-base:$vRealm")
// Compose
2023-10-31 02:21:44 +01:00
implementation("androidx.compose.runtime:runtime:$vCompose")
implementation("androidx.compose.ui:ui:$vCompose")
implementation("androidx.compose.foundation:foundation:$vCompose")
implementation("androidx.compose.material3:material3:$vComposeMaterial3")
implementation("androidx.compose.animation:animation:$vCompose")
implementation("androidx.navigation:navigation-compose:$vNavigation")
implementation("com.google.accompanist:accompanist-permissions:$vComposeAccompanist")
debugImplementation("androidx.compose.ui:ui-tooling:$vCompose")
debugImplementation("androidx.compose.ui:ui-tooling-preview:$vCompose")
}
// using a task as a preBuild dependency instead of a function that takes some time insures that it runs
task("detectAndroidLocals") {
val langsList: MutableSet<String> = HashSet()
// in /res are (almost) all languages that have a translated string is saved. this is safer and saves some time
fileTree("src/main/res").visit {
if (this.file.path.endsWith("strings.xml")
&& this.file.canonicalFile.readText().contains("<string")
) {
var languageCode = this.file.parentFile.name.replace("values-", "")
languageCode = if (languageCode == "values") "en" else languageCode
langsList.add(languageCode)
}
}
val langsListString = "{${langsList.joinToString(",") { "\"${it}\"" }}}"
android.defaultConfig.buildConfigField("String[]", "DETECTED_LOCALES", langsListString)
}
tasks.preBuild.dependsOn("detectAndroidLocals")