mirror of
https://github.com/NeoApplications/Neo-Store.git
synced 2025-03-14 10:17:08 +00:00
203 lines
7.1 KiB
Plaintext
203 lines
7.1 KiB
Plaintext
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
|
|
|
val composeVersion = "1.3.1"
|
|
val composeCompilerVersion = "1.4.0"
|
|
val roomVersion = "2.5.0"
|
|
val navigationVersion = "2.5.3"
|
|
val accompanistVersion = "0.28.0"
|
|
val hiltVersion = "2.44.2"
|
|
val retrofitVersion = "2.9.0"
|
|
|
|
plugins {
|
|
id("com.android.application") version ("7.4.0")
|
|
kotlin("android") version ("1.8.0")
|
|
kotlin("kapt") version ("1.8.0")
|
|
kotlin("plugin.serialization") version ("1.8.0")
|
|
id("com.google.devtools.ksp") version ("1.8.0-1.0.8")
|
|
id("com.google.dagger.hilt.android") version ("2.44.2")
|
|
}
|
|
|
|
android {
|
|
namespace = "com.machiav3lli.fdroid"
|
|
compileSdk = 33
|
|
|
|
defaultConfig {
|
|
applicationId = "com.machiav3lli.fdroid"
|
|
minSdk = 23
|
|
targetSdk = 33
|
|
versionCode = 924
|
|
versionName = "0.9.13"
|
|
vectorDrawables.useSupportLibrary = true
|
|
buildConfigField("String", "KEY_API_EXODUS", "\"81f30e4903bde25023857719e71c94829a41e6a5\"")
|
|
|
|
javaCompileOptions {
|
|
annotationProcessorOptions {
|
|
ksp {
|
|
arg("room.schemaLocation", "$projectDir/schemas")
|
|
arg("room.incremental", "true")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
sourceSets.forEach { source ->
|
|
val javaDir = source.java.srcDirs.find { it.name == "java" }
|
|
source.java {
|
|
srcDir(File(javaDir?.parentFile, "kotlin"))
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = compileOptions.sourceCompatibility.toString()
|
|
freeCompilerArgs = listOf("-Xjvm-default=compatibility")
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
dataBinding = true
|
|
}
|
|
|
|
composeOptions {
|
|
kotlinCompilerExtensionVersion = composeCompilerVersion
|
|
}
|
|
|
|
buildTypes {
|
|
named("debug") {
|
|
isMinifyEnabled = false
|
|
isShrinkResources = false
|
|
applicationIdSuffix = ".debug"
|
|
resValue("string", "application_name", "Neo Store-Debug")
|
|
}
|
|
create("neo") {
|
|
isMinifyEnabled = false
|
|
isShrinkResources = false
|
|
applicationIdSuffix = ".neo"
|
|
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"
|
|
)
|
|
}
|
|
}
|
|
packagingOptions {
|
|
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
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0")
|
|
implementation("com.google.devtools.ksp:symbol-processing-api:1.8.0-1.0.8")
|
|
implementation("androidx.preference:preference-ktx:1.2.0")
|
|
implementation("androidx.work:work-runtime-ktx:2.8.0-rc01")
|
|
|
|
// Material3
|
|
implementation("com.google.android.material:material:1.8.0-rc01")
|
|
|
|
// Coil
|
|
implementation("io.coil-kt:coil:2.2.2")
|
|
implementation("io.coil-kt:coil-compose:2.2.2")
|
|
|
|
// Dagger Hilt
|
|
kapt("com.google.dagger:hilt-compiler:$hiltVersion")
|
|
implementation("com.google.dagger:hilt-android:$hiltVersion")
|
|
|
|
// OkHttps
|
|
implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.9")
|
|
implementation("com.squareup.retrofit2:retrofit:$retrofitVersion")
|
|
implementation("com.squareup.retrofit2:converter-moshi:$retrofitVersion")
|
|
|
|
// RxJava
|
|
implementation("io.reactivex.rxjava3:rxjava:3.1.6")
|
|
implementation("io.reactivex.rxjava3:rxandroid:3.0.2")
|
|
|
|
// LibSu
|
|
implementation("com.github.topjohnwu.libsu:core:5.0.3")
|
|
|
|
// JSON
|
|
implementation("com.fasterxml.jackson.core:jackson-core:2.14.1")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
|
|
|
|
// Markdown
|
|
implementation("org.jetbrains:markdown:0.3.5")
|
|
implementation("de.charlex.compose:html-text:1.4.1")
|
|
|
|
// Coroutines / Lifecycle
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.1")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
|
|
|
|
// Room
|
|
implementation("androidx.room:room-runtime:$roomVersion")
|
|
implementation("androidx.room:room-ktx:$roomVersion")
|
|
ksp("androidx.room:room-compiler:$roomVersion")
|
|
|
|
// Compose
|
|
implementation("androidx.compose.runtime:runtime:$composeVersion")
|
|
implementation("androidx.compose.ui:ui:$composeVersion")
|
|
implementation("androidx.compose.foundation:foundation:$composeVersion")
|
|
implementation("androidx.compose.runtime:runtime-livedata:$composeVersion")
|
|
implementation("androidx.compose.material3:material3:1.0.1")
|
|
implementation("androidx.compose.animation:animation:$composeVersion")
|
|
implementation("androidx.navigation:navigation-compose:$navigationVersion")
|
|
implementation("com.google.accompanist:accompanist-navigation-animation:$accompanistVersion")
|
|
implementation("com.google.accompanist:accompanist-flowlayout:$accompanistVersion")
|
|
implementation("com.google.accompanist:accompanist-pager:$accompanistVersion")
|
|
implementation("com.google.accompanist:accompanist-permissions:$accompanistVersion")
|
|
|
|
debugImplementation("androidx.compose.ui:ui-tooling:$composeVersion")
|
|
debugImplementation("androidx.compose.ui:ui-tooling-preview:$composeVersion")
|
|
debugImplementation("androidx.customview:customview-poolingcontainer:1.0.0")
|
|
debugImplementation("androidx.customview:customview:1.2.0-alpha02")
|
|
}
|
|
|
|
// 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") |