2025-01-22 23:52:23 +05:30
|
|
|
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
|
|
|
|
2022-07-11 15:42:04 +05:30
|
|
|
plugins {
|
2025-01-23 00:16:56 +05:30
|
|
|
alias(libs.plugins.android.application)
|
|
|
|
alias(libs.plugins.kotlin.android)
|
|
|
|
alias(libs.plugins.ksp)
|
|
|
|
alias(libs.plugins.hilt)
|
|
|
|
alias(libs.plugins.kotlin.serialization)
|
2024-03-23 00:06:55 +05:30
|
|
|
alias(libs.plugins.kotlin.parcelize)
|
2022-07-11 15:42:04 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
2025-02-28 19:26:04 +05:30
|
|
|
val latestVersionName = "0.6.5"
|
2023-10-21 16:43:54 +05:30
|
|
|
namespace = "com.looker.droidify"
|
2025-01-23 00:16:56 +05:30
|
|
|
buildToolsVersion = "35.0.0"
|
|
|
|
compileSdk = 35
|
2023-10-21 16:43:54 +05:30
|
|
|
defaultConfig {
|
2025-01-23 00:16:56 +05:30
|
|
|
minSdk = 23
|
|
|
|
targetSdk = 35
|
|
|
|
applicationId = "com.looker.droidify"
|
2025-02-28 19:26:04 +05:30
|
|
|
versionCode = 650
|
2025-01-23 00:16:56 +05:30
|
|
|
versionName = latestVersionName
|
2023-10-21 16:43:54 +05:30
|
|
|
vectorDrawables.useSupportLibrary = true
|
2025-01-29 08:32:54 +05:30
|
|
|
testInstrumentationRunner = "com.looker.droidify.TestRunner"
|
2024-07-05 12:59:14 +05:30
|
|
|
}
|
2022-11-11 12:36:41 +05:30
|
|
|
|
2025-01-23 00:16:56 +05:30
|
|
|
compileOptions {
|
2025-01-27 12:02:57 +05:30
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
2025-01-23 00:16:56 +05:30
|
|
|
isCoreLibraryDesugaringEnabled = true
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
2025-01-27 12:02:57 +05:30
|
|
|
jvmTarget = "17"
|
2025-01-23 00:16:56 +05:30
|
|
|
freeCompilerArgs = listOf(
|
|
|
|
"-opt-in=kotlin.RequiresOptIn",
|
|
|
|
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
|
|
|
"-opt-in=kotlinx.coroutines.FlowPreview",
|
|
|
|
"-Xcontext-receivers"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2025-01-27 10:37:00 +05:30
|
|
|
ksp {
|
|
|
|
arg("room.schemaLocation", "$projectDir/schemas")
|
|
|
|
arg("room.generateKotlin", "true")
|
|
|
|
}
|
|
|
|
|
2024-07-05 12:59:14 +05:30
|
|
|
androidResources {
|
|
|
|
generateLocaleConfig = true
|
2023-10-21 16:43:54 +05:30
|
|
|
}
|
2022-07-11 15:42:04 +05:30
|
|
|
|
2023-10-21 16:43:54 +05:30
|
|
|
buildTypes {
|
2025-02-16 11:46:45 +05:30
|
|
|
debug {
|
2023-10-21 16:43:54 +05:30
|
|
|
applicationIdSuffix = ".debug"
|
|
|
|
resValue("string", "application_name", "Droid-ify-Debug")
|
|
|
|
}
|
2025-02-16 11:46:45 +05:30
|
|
|
release {
|
2023-10-21 16:43:54 +05:30
|
|
|
isMinifyEnabled = true
|
|
|
|
isShrinkResources = true
|
|
|
|
resValue("string", "application_name", "Droid-ify")
|
|
|
|
proguardFiles(
|
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
|
|
"proguard.pro"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
create("alpha") {
|
|
|
|
initWith(getByName("debug"))
|
|
|
|
applicationIdSuffix = ".alpha"
|
|
|
|
resValue("string", "application_name", "Droid-ify Alpha")
|
|
|
|
proguardFiles(
|
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
|
|
"proguard.pro"
|
|
|
|
)
|
|
|
|
isDebuggable = true
|
|
|
|
isMinifyEnabled = true
|
|
|
|
}
|
|
|
|
all {
|
|
|
|
buildConfigField(
|
|
|
|
type = "String",
|
|
|
|
name = "VERSION_NAME",
|
2025-01-23 00:16:56 +05:30
|
|
|
value = "\"v$latestVersionName\""
|
2023-10-21 16:43:54 +05:30
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
packaging {
|
|
|
|
resources {
|
|
|
|
excludes += listOf(
|
|
|
|
"/DebugProbesKt.bin",
|
|
|
|
"/kotlin/**.kotlin_builtins",
|
|
|
|
"/kotlin/**.kotlin_metadata",
|
|
|
|
"/META-INF/**.kotlin_module",
|
|
|
|
"/META-INF/**.pro",
|
|
|
|
"/META-INF/**.version",
|
2025-02-19 10:53:09 +05:30
|
|
|
"/META-INF/{AL2.0,LGPL2.1,LICENSE*}",
|
|
|
|
"/META-INF/versions/9/previous-**.bin",
|
2023-10-21 16:43:54 +05:30
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buildFeatures {
|
2024-07-05 12:59:14 +05:30
|
|
|
resValues = true
|
2023-10-21 16:43:54 +05:30
|
|
|
viewBinding = true
|
|
|
|
buildConfig = true
|
|
|
|
}
|
2025-02-16 11:46:45 +05:30
|
|
|
dependenciesInfo {
|
|
|
|
includeInApk = false
|
|
|
|
includeInBundle = false
|
|
|
|
}
|
2022-07-11 15:42:04 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2025-01-23 00:16:56 +05:30
|
|
|
coreLibraryDesugaring(libs.desugaring)
|
2022-07-13 18:39:31 +05:30
|
|
|
|
2024-12-26 08:24:08 +05:30
|
|
|
implementation(libs.material)
|
|
|
|
implementation(libs.core.ktx)
|
|
|
|
implementation(libs.activity)
|
|
|
|
implementation(libs.appcompat)
|
|
|
|
implementation(libs.fragment.ktx)
|
|
|
|
implementation(libs.lifecycle.viewModel)
|
|
|
|
implementation(libs.recyclerview)
|
|
|
|
implementation(libs.sqlite.ktx)
|
2025-01-23 00:16:56 +05:30
|
|
|
|
2023-10-29 13:27:57 +05:30
|
|
|
implementation(libs.image.viewer)
|
2025-02-16 14:51:27 +05:30
|
|
|
implementation(libs.bundles.coil)
|
2024-07-12 20:45:32 +05:30
|
|
|
|
2025-01-22 23:52:23 +05:30
|
|
|
implementation(libs.datastore.core)
|
|
|
|
implementation(libs.datastore.proto)
|
|
|
|
|
2025-01-23 00:16:56 +05:30
|
|
|
implementation(libs.kotlin.stdlib)
|
|
|
|
implementation(libs.datetime)
|
|
|
|
|
2025-01-26 18:59:01 +05:30
|
|
|
implementation(libs.bundles.coroutines)
|
2025-01-23 00:16:56 +05:30
|
|
|
|
2025-01-22 21:16:03 +05:30
|
|
|
implementation(libs.libsu.core)
|
2025-01-26 18:59:01 +05:30
|
|
|
implementation(libs.bundles.shizuku)
|
2025-01-22 21:16:03 +05:30
|
|
|
|
2025-01-23 00:16:56 +05:30
|
|
|
implementation(libs.jackson.core)
|
|
|
|
implementation(libs.serialization)
|
|
|
|
|
2025-01-26 18:59:01 +05:30
|
|
|
implementation(libs.bundles.ktor)
|
2025-01-27 10:37:00 +05:30
|
|
|
implementation(libs.bundles.room)
|
|
|
|
ksp(libs.room.compiler)
|
2025-01-22 23:52:23 +05:30
|
|
|
|
2025-01-23 00:16:56 +05:30
|
|
|
implementation(libs.work.ktx)
|
|
|
|
|
|
|
|
implementation(libs.hilt.core)
|
|
|
|
implementation(libs.hilt.android)
|
|
|
|
implementation(libs.hilt.ext.work)
|
|
|
|
ksp(libs.hilt.compiler)
|
|
|
|
ksp(libs.hilt.ext.compiler)
|
|
|
|
|
2025-01-22 23:52:23 +05:30
|
|
|
testImplementation(platform(libs.junit.bom))
|
2025-01-23 00:16:56 +05:30
|
|
|
testImplementation(libs.bundles.test.unit)
|
2025-01-22 23:52:23 +05:30
|
|
|
testRuntimeOnly(libs.junit.platform)
|
2025-01-29 08:32:54 +05:30
|
|
|
androidTestImplementation(libs.hilt.test)
|
2025-01-27 10:37:00 +05:30
|
|
|
androidTestImplementation(libs.room.test)
|
2024-12-28 23:23:46 +05:30
|
|
|
androidTestImplementation(libs.bundles.test.android)
|
2025-01-29 08:32:54 +05:30
|
|
|
kspAndroidTest(libs.hilt.compiler)
|
2024-12-28 23:23:46 +05:30
|
|
|
|
2024-07-13 09:46:50 +05:30
|
|
|
// debugImplementation(libs.leakcanary)
|
2023-08-23 03:27:10 +09:00
|
|
|
}
|
2025-01-22 23:52:23 +05:30
|
|
|
|
|
|
|
// 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.sorted().joinToString(",") { "\"${it}\"" }}}"
|
|
|
|
android.defaultConfig.buildConfigField("String[]", "DETECTED_LOCALES", langsListString)
|
|
|
|
}
|
|
|
|
tasks.preBuild.dependsOn("detectAndroidLocals")
|