2020-12-31 19:28:34 +03:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("com.android.application")
|
|
|
|
id("com.mikepenz.aboutlibraries.plugin")
|
|
|
|
kotlin("android")
|
|
|
|
kotlin("plugin.serialization")
|
|
|
|
id("com.github.zellius.shortcut-helper")
|
2022-04-23 00:29:24 +03:00
|
|
|
id("com.squareup.sqldelight")
|
2020-12-31 19:28:34 +03:00
|
|
|
}
|
|
|
|
|
2020-12-31 19:32:18 +03:00
|
|
|
if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
2022-03-04 17:58:31 +03:00
|
|
|
apply<com.google.gms.googleservices.GoogleServicesPlugin>()
|
2020-12-31 19:32:18 +03:00
|
|
|
}
|
|
|
|
|
2020-12-31 19:28:34 +03:00
|
|
|
shortcutHelper.setFilePath("./shortcuts.xml")
|
|
|
|
|
2021-06-01 16:55:03 +03:00
|
|
|
val SUPPORTED_ABIS = setOf("armeabi-v7a", "arm64-v8a", "x86")
|
|
|
|
|
2020-12-31 19:28:34 +03:00
|
|
|
android {
|
2022-03-13 00:45:36 +03:00
|
|
|
compileSdk = AndroidConfig.compileSdk
|
|
|
|
ndkVersion = AndroidConfig.ndk
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId = "eu.kanade.tachiyomi"
|
2022-03-13 00:45:36 +03:00
|
|
|
minSdk = AndroidConfig.minSdk
|
|
|
|
targetSdk = AndroidConfig.targetSdk
|
2022-04-23 00:29:18 +03:00
|
|
|
versionCode = 80
|
|
|
|
versionName = "0.13.4"
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
|
|
|
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
|
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
|
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
2021-10-09 17:28:43 +03:00
|
|
|
buildConfigField("boolean", "PREVIEW", "false")
|
2020-12-31 19:28:34 +03:00
|
|
|
|
2021-01-17 19:09:29 +03:00
|
|
|
// Please disable ACRA or use your own instance in forked versions of the project
|
|
|
|
buildConfigField("String", "ACRA_URI", "\"https://tachiyomi.kanade.eu/crash_report\"")
|
|
|
|
|
2020-12-31 19:28:34 +03:00
|
|
|
ndk {
|
2021-06-01 16:55:03 +03:00
|
|
|
abiFilters += SUPPORTED_ABIS
|
2020-12-31 19:28:34 +03:00
|
|
|
}
|
2021-11-07 17:20:13 +03:00
|
|
|
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
2020-12-31 19:28:34 +03:00
|
|
|
}
|
|
|
|
|
2021-06-01 16:55:03 +03:00
|
|
|
splits {
|
|
|
|
abi {
|
2021-08-06 22:38:16 +03:00
|
|
|
isEnable = true
|
2021-06-01 16:55:03 +03:00
|
|
|
reset()
|
|
|
|
include(*SUPPORTED_ABIS.toTypedArray())
|
|
|
|
isUniversalApk = true
|
|
|
|
}
|
2020-12-31 19:28:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
named("debug") {
|
|
|
|
versionNameSuffix = "-${getCommitCount()}"
|
|
|
|
applicationIdSuffix = ".debug"
|
|
|
|
}
|
|
|
|
named("release") {
|
2021-05-22 21:47:40 +03:00
|
|
|
isShrinkResources = true
|
|
|
|
isMinifyEnabled = true
|
|
|
|
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
2020-12-31 19:28:34 +03:00
|
|
|
}
|
2021-10-09 17:28:43 +03:00
|
|
|
create("preview") {
|
|
|
|
initWith(getByName("release"))
|
|
|
|
buildConfigField("boolean", "PREVIEW", "true")
|
|
|
|
|
|
|
|
val debugType = getByName("debug")
|
|
|
|
signingConfig = debugType.signingConfig
|
|
|
|
versionNameSuffix = debugType.versionNameSuffix
|
|
|
|
applicationIdSuffix = debugType.applicationIdSuffix
|
|
|
|
}
|
2020-12-31 19:28:34 +03:00
|
|
|
}
|
|
|
|
|
2021-05-22 21:47:40 +03:00
|
|
|
sourceSets {
|
2021-10-09 17:28:43 +03:00
|
|
|
getByName("preview").res.srcDirs("src/debug/res")
|
2021-05-22 21:47:40 +03:00
|
|
|
}
|
|
|
|
|
2021-08-23 01:05:18 +03:00
|
|
|
flavorDimensions.add("default")
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
productFlavors {
|
|
|
|
create("standard") {
|
|
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "true")
|
|
|
|
dimension = "default"
|
|
|
|
}
|
|
|
|
create("dev") {
|
2021-08-23 01:05:18 +03:00
|
|
|
resourceConfigurations.addAll(listOf("en", "xxhdpi"))
|
2020-12-31 19:28:34 +03:00
|
|
|
dimension = "default"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
packagingOptions {
|
2021-08-23 01:05:18 +03:00
|
|
|
resources.excludes.addAll(listOf(
|
|
|
|
"META-INF/DEPENDENCIES",
|
|
|
|
"LICENSE.txt",
|
|
|
|
"META-INF/LICENSE",
|
|
|
|
"META-INF/LICENSE.txt",
|
2021-10-16 17:21:25 +03:00
|
|
|
"META-INF/README.md",
|
2021-08-23 01:05:18 +03:00
|
|
|
"META-INF/NOTICE",
|
|
|
|
"META-INF/*.kotlin_module",
|
2021-10-16 17:21:25 +03:00
|
|
|
"META-INF/*.version",
|
2021-08-23 01:05:18 +03:00
|
|
|
))
|
2020-12-31 19:28:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
dependenciesInfo {
|
|
|
|
includeInApk = false
|
|
|
|
}
|
|
|
|
|
2021-06-01 16:55:03 +03:00
|
|
|
buildFeatures {
|
|
|
|
viewBinding = true
|
2022-04-23 00:29:24 +03:00
|
|
|
compose = true
|
2021-11-07 17:20:13 +03:00
|
|
|
|
|
|
|
// Disable some unused things
|
|
|
|
aidl = false
|
|
|
|
renderScript = false
|
|
|
|
shaders = false
|
2021-06-01 16:55:03 +03:00
|
|
|
}
|
|
|
|
|
2021-07-28 22:08:04 +03:00
|
|
|
lint {
|
2022-01-26 06:49:50 +03:00
|
|
|
disable.addAll(listOf("MissingTranslation", "ExtraTranslation"))
|
|
|
|
abortOnError = false
|
|
|
|
checkReleaseBuilds = false
|
2020-12-31 19:28:34 +03:00
|
|
|
}
|
|
|
|
|
2022-04-23 00:29:24 +03:00
|
|
|
composeOptions {
|
|
|
|
kotlinCompilerExtensionVersion = compose.versions.compose.get()
|
|
|
|
}
|
|
|
|
|
2020-12-31 19:28:34 +03:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-04-23 00:29:24 +03:00
|
|
|
implementation(compose.foundation)
|
|
|
|
implementation(compose.material3.core)
|
|
|
|
implementation(compose.material3.adapter)
|
|
|
|
implementation(compose.animation)
|
|
|
|
implementation(compose.ui.tooling)
|
|
|
|
|
|
|
|
implementation(androidx.paging.runtime)
|
|
|
|
implementation(androidx.paging.compose)
|
|
|
|
|
|
|
|
implementation(libs.sqldelight.android.driver)
|
|
|
|
implementation(libs.sqldelight.coroutines)
|
|
|
|
implementation(libs.sqldelight.android.paging)
|
|
|
|
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(kotlinx.reflect)
|
2021-07-04 19:16:12 +03:00
|
|
|
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(kotlinx.bundles.coroutines)
|
2021-07-04 19:16:12 +03:00
|
|
|
|
2020-12-31 19:28:34 +03:00
|
|
|
// Source models and interfaces from Tachiyomi 1.x
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.tachiyomi.api)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// AndroidX libraries
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(androidx.annotation)
|
|
|
|
implementation(androidx.appcompat)
|
|
|
|
implementation(androidx.biometricktx)
|
|
|
|
implementation(androidx.constraintlayout)
|
|
|
|
implementation(androidx.coordinatorlayout)
|
|
|
|
implementation(androidx.corektx)
|
|
|
|
implementation(androidx.splashscreen)
|
|
|
|
implementation(androidx.recyclerview)
|
|
|
|
implementation(androidx.swiperefreshlayout)
|
|
|
|
implementation(androidx.viewpager)
|
|
|
|
|
|
|
|
implementation(androidx.bundles.lifecycle)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// Job scheduling
|
2022-04-11 15:56:22 +03:00
|
|
|
implementation(androidx.bundles.workmanager)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
2021-08-07 17:50:50 +03:00
|
|
|
// RX
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.bundles.reactivex)
|
|
|
|
implementation(libs.flowreactivenetwork)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// Network client
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.bundles.okhttp)
|
|
|
|
implementation(libs.okio)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// TLS 1.3 support for Android < 10
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.conscrypt.android)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
2021-08-07 17:50:50 +03:00
|
|
|
// Data serialization (JSON, protobuf)
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(kotlinx.bundles.serialization)
|
2021-09-06 18:54:00 +03:00
|
|
|
|
2020-12-31 19:28:34 +03:00
|
|
|
// JavaScript engine
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.bundles.js.engine)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
2021-08-07 17:50:50 +03:00
|
|
|
// HTML parser
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.jsoup)
|
2021-08-07 17:50:50 +03:00
|
|
|
|
2020-12-31 19:28:34 +03:00
|
|
|
// Disk
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.disklrucache)
|
|
|
|
implementation(libs.unifile)
|
|
|
|
implementation(libs.junrar)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// Database
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.bundles.sqlite)
|
2020-12-31 19:28:34 +03:00
|
|
|
implementation("com.github.inorichi.storio:storio-common:8be19de@aar")
|
|
|
|
implementation("com.github.inorichi.storio:storio-sqlite:8be19de@aar")
|
|
|
|
|
|
|
|
// Preferences
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.preferencektx)
|
|
|
|
implementation(libs.flowpreferences)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// Model View Presenter
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.bundles.nucleus)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// Dependency injection
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.injekt.core)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
2021-08-07 17:50:50 +03:00
|
|
|
// Image loading
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.bundles.coil)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.subsamplingscaleimageview) {
|
2021-05-25 20:42:48 +03:00
|
|
|
exclude(module = "image-decoder")
|
|
|
|
}
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.image.decoder)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// Sort
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.natural.comparator)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
2021-08-07 17:50:50 +03:00
|
|
|
// UI libraries
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.material)
|
|
|
|
implementation(libs.androidprocessbutton)
|
|
|
|
implementation(libs.flexible.adapter.core)
|
|
|
|
implementation(libs.flexible.adapter.ui)
|
|
|
|
implementation(libs.viewstatepageradapter)
|
|
|
|
implementation(libs.photoview)
|
|
|
|
implementation(libs.directionalviewpager) {
|
2021-09-20 21:33:35 +03:00
|
|
|
exclude(group = "androidx.viewpager", module = "viewpager")
|
|
|
|
}
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.insetter)
|
2022-04-17 18:30:05 +03:00
|
|
|
implementation(libs.markwon)
|
2022-04-23 17:52:19 +03:00
|
|
|
implementation(libs.aboutLibraries.compose)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// Conductor
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.bundles.conductor)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// FlowBinding
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.bundles.flowbinding)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
2021-08-07 17:50:50 +03:00
|
|
|
// Logging
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.logcat)
|
2021-08-07 17:50:50 +03:00
|
|
|
|
|
|
|
// Crash reports/analytics
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.acra.http)
|
|
|
|
"standardImplementation"(libs.firebase.analytics)
|
2021-08-07 17:50:50 +03:00
|
|
|
|
2021-09-25 21:31:52 +03:00
|
|
|
// Shizuku
|
2022-03-04 17:58:31 +03:00
|
|
|
implementation(libs.bundles.shizuku)
|
2021-09-25 21:31:52 +03:00
|
|
|
|
2020-12-31 19:28:34 +03:00
|
|
|
// Tests
|
2022-03-04 17:58:31 +03:00
|
|
|
testImplementation(libs.junit)
|
|
|
|
testImplementation(libs.assertj.core)
|
|
|
|
testImplementation(libs.mockito.core)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
2022-03-04 17:58:31 +03:00
|
|
|
testImplementation(libs.bundles.robolectric)
|
2020-12-31 19:28:34 +03:00
|
|
|
|
|
|
|
// For detecting memory leaks; see https://square.github.io/leakcanary/
|
2022-03-04 17:58:31 +03:00
|
|
|
// debugImplementation(libs.leakcanary.android)
|
2020-12-31 19:28:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
|
|
|
// See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers)
|
|
|
|
withType<KotlinCompile> {
|
|
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
|
|
"-Xopt-in=kotlin.Experimental",
|
|
|
|
"-Xopt-in=kotlin.RequiresOptIn",
|
2022-01-04 06:25:35 +03:00
|
|
|
"-Xopt-in=kotlin.ExperimentalStdlibApi",
|
|
|
|
"-Xopt-in=kotlinx.coroutines.FlowPreview",
|
|
|
|
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
|
|
|
"-Xopt-in=kotlinx.coroutines.InternalCoroutinesApi",
|
|
|
|
"-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi",
|
|
|
|
"-Xopt-in=coil.annotation.ExperimentalCoilApi",
|
2022-04-23 00:29:24 +03:00
|
|
|
"-Xopt-in=androidx.compose.material3.ExperimentalMaterial3Api",
|
|
|
|
"-Xopt-in=androidx.compose.ui.ExperimentalComposeUiApi",
|
|
|
|
"-Xopt-in=androidx.compose.foundation.ExperimentalFoundationApi"
|
2020-12-31 19:28:34 +03:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Duplicating Hebrew string assets due to some locale code issues on different devices
|
|
|
|
val copyHebrewStrings = task("copyHebrewStrings", type = Copy::class) {
|
|
|
|
from("./src/main/res/values-he")
|
|
|
|
into("./src/main/res/values-iw")
|
|
|
|
include("**/*")
|
|
|
|
}
|
|
|
|
|
|
|
|
preBuild {
|
|
|
|
dependsOn(formatKotlin, copyHebrewStrings)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-31 19:32:18 +03:00
|
|
|
buildscript {
|
|
|
|
dependencies {
|
2022-03-04 17:58:31 +03:00
|
|
|
classpath(kotlinx.gradle)
|
2021-01-17 19:09:29 +03:00
|
|
|
}
|
|
|
|
}
|