2021-01-01 00:28:34 +08:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
2022-12-18 01:02:01 +08:00
|
|
|
import org.jmailen.gradle.kotlinter.tasks.LintTask
|
2021-01-01 00:28:34 +08:00
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("com.android.application")
|
|
|
|
id("com.mikepenz.aboutlibraries.plugin")
|
|
|
|
kotlin("android")
|
|
|
|
kotlin("plugin.serialization")
|
|
|
|
id("com.github.zellius.shortcut-helper")
|
|
|
|
}
|
|
|
|
|
2021-01-01 00:32:18 +08:00
|
|
|
if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
2022-03-04 22:58:31 +08:00
|
|
|
apply<com.google.gms.googleservices.GoogleServicesPlugin>()
|
2021-01-01 00:32:18 +08:00
|
|
|
}
|
|
|
|
|
2021-01-01 00:28:34 +08:00
|
|
|
shortcutHelper.setFilePath("./shortcuts.xml")
|
|
|
|
|
2022-08-28 21:45:33 +08:00
|
|
|
val SUPPORTED_ABIS = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
2021-06-01 21:55:03 +08:00
|
|
|
|
2021-01-01 00:28:34 +08:00
|
|
|
android {
|
2022-07-03 01:08:22 +08:00
|
|
|
namespace = "eu.kanade.tachiyomi"
|
2021-01-01 00:28:34 +08:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId = "eu.kanade.tachiyomi"
|
2023-04-28 10:27:12 +08:00
|
|
|
|
|
|
|
versionCode = 103
|
2023-04-16 23:00:14 +08:00
|
|
|
versionName = "0.14.6"
|
2021-01-01 00:28:34 +08:00
|
|
|
|
|
|
|
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
|
|
|
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
|
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
|
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
2021-10-09 22:28:43 +08:00
|
|
|
buildConfigField("boolean", "PREVIEW", "false")
|
2021-01-01 00:28:34 +08:00
|
|
|
|
2021-01-18 00:09:29 +08: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\"")
|
|
|
|
|
2021-01-01 00:28:34 +08:00
|
|
|
ndk {
|
2021-06-01 21:55:03 +08:00
|
|
|
abiFilters += SUPPORTED_ABIS
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
2021-11-07 22:20:13 +08:00
|
|
|
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
|
|
|
|
2021-06-01 21:55:03 +08:00
|
|
|
splits {
|
|
|
|
abi {
|
2021-08-07 03:38:16 +08:00
|
|
|
isEnable = true
|
2021-06-01 21:55:03 +08:00
|
|
|
reset()
|
|
|
|
include(*SUPPORTED_ABIS.toTypedArray())
|
|
|
|
isUniversalApk = true
|
|
|
|
}
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
named("debug") {
|
|
|
|
versionNameSuffix = "-${getCommitCount()}"
|
|
|
|
applicationIdSuffix = ".debug"
|
2022-11-03 21:46:53 +08:00
|
|
|
isPseudoLocalesEnabled = true
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
|
|
|
named("release") {
|
2021-05-23 02:47:40 +08:00
|
|
|
isShrinkResources = true
|
|
|
|
isMinifyEnabled = true
|
|
|
|
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
2021-10-09 22:28:43 +08:00
|
|
|
create("preview") {
|
|
|
|
initWith(getByName("release"))
|
|
|
|
buildConfigField("boolean", "PREVIEW", "true")
|
|
|
|
|
|
|
|
val debugType = getByName("debug")
|
|
|
|
signingConfig = debugType.signingConfig
|
|
|
|
versionNameSuffix = debugType.versionNameSuffix
|
|
|
|
applicationIdSuffix = debugType.applicationIdSuffix
|
2022-09-10 10:29:40 +08:00
|
|
|
matchingFallbacks.add("release")
|
2021-10-09 22:28:43 +08:00
|
|
|
}
|
2022-10-04 21:22:55 +08:00
|
|
|
create("benchmark") {
|
|
|
|
initWith(getByName("release"))
|
|
|
|
|
|
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
|
|
matchingFallbacks.add("release")
|
|
|
|
isDebuggable = false
|
|
|
|
versionNameSuffix = "-benchmark"
|
|
|
|
applicationIdSuffix = ".benchmark"
|
|
|
|
}
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
|
|
|
|
2021-05-23 02:47:40 +08:00
|
|
|
sourceSets {
|
2021-10-09 22:28:43 +08:00
|
|
|
getByName("preview").res.srcDirs("src/debug/res")
|
2022-10-04 21:22:55 +08:00
|
|
|
getByName("benchmark").res.srcDirs("src/debug/res")
|
2021-05-23 02:47:40 +08:00
|
|
|
}
|
|
|
|
|
2021-08-23 06:05:18 +08:00
|
|
|
flavorDimensions.add("default")
|
2021-01-01 00:28:34 +08:00
|
|
|
|
|
|
|
productFlavors {
|
|
|
|
create("standard") {
|
|
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "true")
|
|
|
|
dimension = "default"
|
|
|
|
}
|
|
|
|
create("dev") {
|
2022-11-03 21:47:27 +08:00
|
|
|
// Include pseudolocales: https://developer.android.com/guide/topics/resources/pseudolocales
|
|
|
|
resourceConfigurations.addAll(listOf("en", "en_XA", "ar_XB", "xxhdpi"))
|
2021-01-01 00:28:34 +08:00
|
|
|
dimension = "default"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-17 06:02:24 +08:00
|
|
|
packaging {
|
2021-08-23 06:05:18 +08:00
|
|
|
resources.excludes.addAll(listOf(
|
|
|
|
"META-INF/DEPENDENCIES",
|
|
|
|
"LICENSE.txt",
|
|
|
|
"META-INF/LICENSE",
|
|
|
|
"META-INF/LICENSE.txt",
|
2021-10-16 22:21:25 +08:00
|
|
|
"META-INF/README.md",
|
2021-08-23 06:05:18 +08:00
|
|
|
"META-INF/NOTICE",
|
|
|
|
"META-INF/*.kotlin_module",
|
|
|
|
))
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependenciesInfo {
|
|
|
|
includeInApk = false
|
|
|
|
}
|
|
|
|
|
2021-06-01 21:55:03 +08:00
|
|
|
buildFeatures {
|
|
|
|
viewBinding = true
|
2022-04-23 05:29:24 +08:00
|
|
|
compose = true
|
2021-11-07 22:20:13 +08:00
|
|
|
|
|
|
|
// Disable some unused things
|
|
|
|
aidl = false
|
|
|
|
renderScript = false
|
|
|
|
shaders = false
|
2021-06-01 21:55:03 +08:00
|
|
|
}
|
|
|
|
|
2021-07-29 03:08:04 +08:00
|
|
|
lint {
|
2022-01-26 11:49:50 +08:00
|
|
|
abortOnError = false
|
|
|
|
checkReleaseBuilds = false
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
|
|
|
|
2022-04-23 05:29:24 +08:00
|
|
|
composeOptions {
|
2022-06-30 10:45:11 +08:00
|
|
|
kotlinCompilerExtensionVersion = compose.versions.compiler.get()
|
2022-04-23 05:29:24 +08:00
|
|
|
}
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-09-10 21:58:45 +08:00
|
|
|
implementation(project(":i18n"))
|
2022-09-16 06:12:27 +08:00
|
|
|
implementation(project(":core"))
|
2023-02-27 05:16:49 +08:00
|
|
|
implementation(project(":core-metadata"))
|
2022-09-16 06:12:27 +08:00
|
|
|
implementation(project(":source-api"))
|
2023-02-27 05:16:49 +08:00
|
|
|
implementation(project(":source-local"))
|
2023-01-21 23:37:07 +08:00
|
|
|
implementation(project(":data"))
|
2023-01-22 23:12:29 +08:00
|
|
|
implementation(project(":domain"))
|
2023-01-27 06:53:24 +08:00
|
|
|
implementation(project(":presentation-core"))
|
|
|
|
implementation(project(":presentation-widget"))
|
2022-09-10 21:58:45 +08:00
|
|
|
|
2022-04-24 22:22:22 +08:00
|
|
|
// Compose
|
2022-10-27 06:12:32 +08:00
|
|
|
implementation(platform(compose.bom))
|
2022-04-24 22:22:22 +08:00
|
|
|
implementation(compose.activity)
|
2022-04-23 05:29:24 +08:00
|
|
|
implementation(compose.foundation)
|
|
|
|
implementation(compose.material3.core)
|
2022-11-12 04:02:45 +08:00
|
|
|
implementation(compose.material.core)
|
2022-04-24 00:05:00 +08:00
|
|
|
implementation(compose.material.icons)
|
2022-04-23 05:29:24 +08:00
|
|
|
implementation(compose.animation)
|
2022-06-25 23:03:48 +08:00
|
|
|
implementation(compose.animation.graphics)
|
2022-04-23 05:29:24 +08:00
|
|
|
implementation(compose.ui.tooling)
|
2022-05-24 06:03:46 +08:00
|
|
|
implementation(compose.ui.util)
|
2022-04-24 22:22:22 +08:00
|
|
|
implementation(compose.accompanist.webview)
|
2022-10-15 23:38:01 +08:00
|
|
|
implementation(compose.accompanist.permissions)
|
2022-12-02 12:08:04 +08:00
|
|
|
implementation(compose.accompanist.themeadapter)
|
2022-12-10 00:20:13 +08:00
|
|
|
implementation(compose.accompanist.systemuicontroller)
|
2022-04-23 05:29:24 +08:00
|
|
|
|
|
|
|
implementation(androidx.paging.runtime)
|
|
|
|
implementation(androidx.paging.compose)
|
|
|
|
|
2022-07-03 22:17:41 +08:00
|
|
|
implementation(libs.bundles.sqlite)
|
2022-04-23 05:29:24 +08:00
|
|
|
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(kotlinx.reflect)
|
2022-10-31 07:38:18 +08:00
|
|
|
|
|
|
|
implementation(platform(kotlinx.coroutines.bom))
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(kotlinx.bundles.coroutines)
|
2021-07-05 00:16:12 +08:00
|
|
|
|
2021-01-01 00:28:34 +08:00
|
|
|
// AndroidX libraries
|
2022-03-04 22:58:31 +08: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.viewpager)
|
2022-10-04 21:22:55 +08:00
|
|
|
implementation(androidx.profileinstaller)
|
2022-03-04 22:58:31 +08:00
|
|
|
|
|
|
|
implementation(androidx.bundles.lifecycle)
|
2021-01-01 00:28:34 +08:00
|
|
|
|
|
|
|
// Job scheduling
|
2022-04-11 20:56:22 +08:00
|
|
|
implementation(androidx.bundles.workmanager)
|
2021-01-01 00:28:34 +08:00
|
|
|
|
2023-03-06 04:37:41 +08:00
|
|
|
// RxJava
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.bundles.reactivex)
|
|
|
|
implementation(libs.flowreactivenetwork)
|
2021-01-01 00:28:34 +08:00
|
|
|
|
2023-03-06 04:37:41 +08:00
|
|
|
// Networking
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.bundles.okhttp)
|
|
|
|
implementation(libs.okio)
|
2023-03-06 04:37:41 +08:00
|
|
|
implementation(libs.conscrypt.android) // TLS 1.3 support for Android < 10
|
2021-01-01 00:28:34 +08:00
|
|
|
|
2023-02-27 05:16:49 +08:00
|
|
|
// Data serialization (JSON, protobuf, xml)
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(kotlinx.bundles.serialization)
|
2021-09-06 23:54:00 +08:00
|
|
|
|
2021-08-07 22:50:50 +08:00
|
|
|
// HTML parser
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.jsoup)
|
2021-08-07 22:50:50 +08:00
|
|
|
|
2021-01-01 00:28:34 +08:00
|
|
|
// Disk
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.disklrucache)
|
|
|
|
implementation(libs.unifile)
|
|
|
|
implementation(libs.junrar)
|
2021-01-01 00:28:34 +08:00
|
|
|
|
|
|
|
// Preferences
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.preferencektx)
|
2021-01-01 00:28:34 +08:00
|
|
|
|
|
|
|
// Dependency injection
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.injekt.core)
|
2021-01-01 00:28:34 +08:00
|
|
|
|
2021-08-07 22:50:50 +08:00
|
|
|
// Image loading
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.bundles.coil)
|
|
|
|
implementation(libs.subsamplingscaleimageview) {
|
2021-05-26 01:42:48 +08:00
|
|
|
exclude(module = "image-decoder")
|
|
|
|
}
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.image.decoder)
|
2021-01-01 00:28:34 +08:00
|
|
|
|
2021-08-07 22:50:50 +08:00
|
|
|
// UI libraries
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.material)
|
|
|
|
implementation(libs.flexible.adapter.core)
|
|
|
|
implementation(libs.flexible.adapter.ui)
|
|
|
|
implementation(libs.photoview)
|
|
|
|
implementation(libs.directionalviewpager) {
|
2021-09-21 02:33:35 +08:00
|
|
|
exclude(group = "androidx.viewpager", module = "viewpager")
|
|
|
|
}
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.insetter)
|
2022-12-03 11:35:30 +08:00
|
|
|
implementation(libs.bundles.richtext)
|
2022-04-23 22:52:19 +08:00
|
|
|
implementation(libs.aboutLibraries.compose)
|
2022-10-15 23:38:01 +08:00
|
|
|
implementation(libs.bundles.voyager)
|
2023-03-06 04:37:41 +08:00
|
|
|
implementation(libs.compose.materialmotion)
|
|
|
|
implementation(libs.compose.simpleicons)
|
2021-01-01 00:28:34 +08:00
|
|
|
|
2021-08-07 22:50:50 +08:00
|
|
|
// Logging
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.logcat)
|
2021-08-07 22:50:50 +08:00
|
|
|
|
|
|
|
// Crash reports/analytics
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.acra.http)
|
|
|
|
"standardImplementation"(libs.firebase.analytics)
|
2021-08-07 22:50:50 +08:00
|
|
|
|
2021-09-26 02:31:52 +08:00
|
|
|
// Shizuku
|
2022-03-04 22:58:31 +08:00
|
|
|
implementation(libs.bundles.shizuku)
|
2021-09-26 02:31:52 +08:00
|
|
|
|
2021-01-01 00:28:34 +08:00
|
|
|
// Tests
|
2023-04-15 21:51:52 +08:00
|
|
|
testImplementation(libs.bundles.test)
|
2021-01-01 00:28:34 +08:00
|
|
|
|
|
|
|
// For detecting memory leaks; see https://square.github.io/leakcanary/
|
2022-03-04 22:58:31 +08:00
|
|
|
// debugImplementation(libs.leakcanary.android)
|
2022-04-25 04:28:09 +08:00
|
|
|
implementation(libs.leakcanary.plumber)
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
|
|
|
|
2022-10-04 21:22:55 +08:00
|
|
|
androidComponents {
|
|
|
|
beforeVariants { variantBuilder ->
|
|
|
|
// Disables standardBenchmark
|
|
|
|
if (variantBuilder.buildType == "benchmark") {
|
|
|
|
variantBuilder.enable = variantBuilder.productFlavors.containsAll(listOf("default" to "dev"))
|
|
|
|
}
|
|
|
|
}
|
2022-10-30 23:42:06 +08:00
|
|
|
onVariants(selector().withFlavor("default" to "standard")) {
|
|
|
|
// Only excluding in standard flavor because this breaks
|
|
|
|
// Layout Inspector's Compose tree
|
|
|
|
it.packaging.resources.excludes.add("META-INF/*.version")
|
|
|
|
}
|
2022-10-04 21:22:55 +08:00
|
|
|
}
|
|
|
|
|
2021-01-01 00:28:34 +08:00
|
|
|
tasks {
|
2022-12-18 01:02:01 +08:00
|
|
|
withType<LintTask>().configureEach {
|
2022-09-01 03:56:08 +08:00
|
|
|
exclude { it.file.path.contains("generated[\\\\/]".toRegex()) }
|
2022-08-19 02:06:32 +08:00
|
|
|
}
|
|
|
|
|
2021-01-01 00:28:34 +08:00
|
|
|
// See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers)
|
|
|
|
withType<KotlinCompile> {
|
|
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
2023-02-21 08:02:38 +08:00
|
|
|
"-Xcontext-receivers",
|
2022-04-29 06:09:16 +08:00
|
|
|
"-opt-in=coil.annotation.ExperimentalCoilApi",
|
2022-10-15 23:38:01 +08:00
|
|
|
"-opt-in=com.google.accompanist.permissions.ExperimentalPermissionsApi",
|
2022-12-03 11:35:30 +08:00
|
|
|
"-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi",
|
2022-10-10 03:49:32 +08:00
|
|
|
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
|
2022-04-29 06:09:16 +08:00
|
|
|
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
|
2022-12-08 11:40:57 +08:00
|
|
|
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
|
2022-04-29 06:09:16 +08:00
|
|
|
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
|
2022-06-25 23:03:48 +08:00
|
|
|
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
|
2022-10-15 23:38:01 +08:00
|
|
|
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi",
|
2022-06-25 23:03:48 +08:00
|
|
|
"-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
|
2022-08-11 11:26:34 +08:00
|
|
|
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
|
|
|
"-opt-in=kotlinx.coroutines.FlowPreview",
|
2022-08-06 11:11:06 +08:00
|
|
|
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi",
|
|
|
|
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
|
2021-01-01 00:28:34 +08:00
|
|
|
)
|
2022-10-29 21:37:48 +08:00
|
|
|
|
|
|
|
if (project.findProperty("tachiyomi.enableComposeCompilerMetrics") == "true") {
|
|
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
|
|
"-P",
|
|
|
|
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
|
|
|
|
project.buildDir.absolutePath + "/compose_metrics"
|
|
|
|
)
|
|
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
|
|
"-P",
|
|
|
|
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
|
|
|
|
project.buildDir.absolutePath + "/compose_metrics"
|
|
|
|
)
|
|
|
|
}
|
2021-01-01 00:28:34 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-01 00:32:18 +08:00
|
|
|
buildscript {
|
|
|
|
dependencies {
|
2022-03-04 22:58:31 +08:00
|
|
|
classpath(kotlinx.gradle)
|
2021-01-18 00:09:29 +08:00
|
|
|
}
|
|
|
|
}
|