2024-10-31 10:17:27 -04:00
|
|
|
@file:Suppress("ChromeOsAbiSupport")
|
|
|
|
|
2024-04-06 01:07:11 -04:00
|
|
|
import mihon.buildlogic.getBuildTime
|
|
|
|
import mihon.buildlogic.getCommitCount
|
|
|
|
import mihon.buildlogic.getGitSha
|
2020-12-31 11:28:34 -05:00
|
|
|
|
|
|
|
plugins {
|
2024-04-06 01:07:11 -04:00
|
|
|
id("mihon.android.application")
|
|
|
|
id("mihon.android.application.compose")
|
2020-12-31 11:28:34 -05:00
|
|
|
id("com.github.zellius.shortcut-helper")
|
2024-04-06 01:07:11 -04:00
|
|
|
kotlin("plugin.serialization")
|
2024-09-03 04:09:12 -04:00
|
|
|
alias(libs.plugins.aboutLibraries)
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
|
|
|
|
2024-01-15 09:55:26 -05:00
|
|
|
if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
2024-09-03 05:45:19 -04:00
|
|
|
pluginManager.apply {
|
|
|
|
apply(libs.plugins.google.services.get().pluginId)
|
|
|
|
apply(libs.plugins.firebase.crashlytics.get().pluginId)
|
|
|
|
}
|
2024-01-15 09:55:26 -05:00
|
|
|
}
|
|
|
|
|
2020-12-31 11:28:34 -05:00
|
|
|
shortcutHelper.setFilePath("./shortcuts.xml")
|
|
|
|
|
2024-08-19 08:11:39 -04:00
|
|
|
val supportedAbis = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
2021-06-01 09:55:03 -04:00
|
|
|
|
2020-12-31 11:28:34 -05:00
|
|
|
android {
|
2022-07-02 13:08:22 -04:00
|
|
|
namespace = "eu.kanade.tachiyomi"
|
2020-12-31 11:28:34 -05:00
|
|
|
|
|
|
|
defaultConfig {
|
2024-01-15 15:55:29 -05:00
|
|
|
applicationId = "app.mihon"
|
2023-07-10 16:44:48 -04:00
|
|
|
|
2024-10-26 13:36:36 -04:00
|
|
|
versionCode = 8
|
|
|
|
versionName = "0.17.0"
|
2020-12-31 11:28:34 -05:00
|
|
|
|
|
|
|
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
|
|
|
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
|
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
|
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
2021-10-09 10:28:43 -04:00
|
|
|
buildConfigField("boolean", "PREVIEW", "false")
|
2020-12-31 11:28:34 -05:00
|
|
|
|
|
|
|
ndk {
|
2024-08-19 08:11:39 -04:00
|
|
|
abiFilters += supportedAbis
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
2021-11-07 09:20:13 -05:00
|
|
|
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
|
|
|
|
2021-06-01 09:55:03 -04:00
|
|
|
splits {
|
|
|
|
abi {
|
2021-08-06 15:38:16 -04:00
|
|
|
isEnable = true
|
2021-06-01 09:55:03 -04:00
|
|
|
reset()
|
2024-08-19 08:11:39 -04:00
|
|
|
include(*supportedAbis.toTypedArray())
|
2021-06-01 09:55:03 -04:00
|
|
|
isUniversalApk = true
|
|
|
|
}
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
named("debug") {
|
|
|
|
versionNameSuffix = "-${getCommitCount()}"
|
|
|
|
applicationIdSuffix = ".debug"
|
2022-11-03 09:46:53 -04:00
|
|
|
isPseudoLocalesEnabled = true
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
|
|
|
named("release") {
|
2021-05-22 14:47:40 -04:00
|
|
|
isShrinkResources = true
|
|
|
|
isMinifyEnabled = true
|
|
|
|
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
2021-10-09 10:28:43 -04:00
|
|
|
create("preview") {
|
|
|
|
initWith(getByName("release"))
|
|
|
|
buildConfigField("boolean", "PREVIEW", "true")
|
|
|
|
|
2023-07-29 22:48:56 -04:00
|
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
|
|
matchingFallbacks.add("release")
|
2021-10-09 10:28:43 -04:00
|
|
|
val debugType = getByName("debug")
|
|
|
|
versionNameSuffix = debugType.versionNameSuffix
|
|
|
|
applicationIdSuffix = debugType.applicationIdSuffix
|
|
|
|
}
|
2022-10-04 09:22:55 -04:00
|
|
|
create("benchmark") {
|
|
|
|
initWith(getByName("release"))
|
|
|
|
|
|
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
|
|
matchingFallbacks.add("release")
|
|
|
|
isDebuggable = false
|
2023-08-04 16:15:25 -04:00
|
|
|
isProfileable = true
|
2022-10-04 09:22:55 -04:00
|
|
|
versionNameSuffix = "-benchmark"
|
|
|
|
applicationIdSuffix = ".benchmark"
|
|
|
|
}
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
|
|
|
|
2021-05-22 14:47:40 -04:00
|
|
|
sourceSets {
|
2021-10-09 10:28:43 -04:00
|
|
|
getByName("preview").res.srcDirs("src/debug/res")
|
2022-10-04 09:22:55 -04:00
|
|
|
getByName("benchmark").res.srcDirs("src/debug/res")
|
2021-05-22 14:47:40 -04:00
|
|
|
}
|
|
|
|
|
2021-08-22 18:05:18 -04:00
|
|
|
flavorDimensions.add("default")
|
2020-12-31 11:28:34 -05:00
|
|
|
|
|
|
|
productFlavors {
|
|
|
|
create("standard") {
|
|
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "true")
|
|
|
|
dimension = "default"
|
|
|
|
}
|
|
|
|
create("dev") {
|
2022-11-03 09:47:27 -04:00
|
|
|
// Include pseudolocales: https://developer.android.com/guide/topics/resources/pseudolocales
|
|
|
|
resourceConfigurations.addAll(listOf("en", "en_XA", "ar_XB", "xxhdpi"))
|
2020-12-31 11:28:34 -05:00
|
|
|
dimension = "default"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-16 18:02:24 -04:00
|
|
|
packaging {
|
2023-09-01 23:02:18 -04:00
|
|
|
resources.excludes.addAll(
|
|
|
|
listOf(
|
2024-10-11 19:11:16 -04:00
|
|
|
"kotlin-tooling-metadata.json",
|
2023-09-01 23:02:18 -04:00
|
|
|
"META-INF/DEPENDENCIES",
|
|
|
|
"LICENSE.txt",
|
|
|
|
"META-INF/LICENSE",
|
2024-10-11 19:11:16 -04:00
|
|
|
"META-INF/**/LICENSE.txt",
|
|
|
|
"META-INF/*.properties",
|
|
|
|
"META-INF/**/*.properties",
|
2023-09-01 23:02:18 -04:00
|
|
|
"META-INF/README.md",
|
|
|
|
"META-INF/NOTICE",
|
2024-10-11 19:11:16 -04:00
|
|
|
"META-INF/*.version",
|
2023-09-01 23:02:18 -04:00
|
|
|
),
|
|
|
|
)
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
dependenciesInfo {
|
|
|
|
includeInApk = false
|
|
|
|
}
|
|
|
|
|
2021-06-01 09:55:03 -04:00
|
|
|
buildFeatures {
|
|
|
|
viewBinding = true
|
2023-12-16 15:57:45 -05:00
|
|
|
buildConfig = true
|
2021-11-07 09:20:13 -05:00
|
|
|
|
|
|
|
// Disable some unused things
|
|
|
|
aidl = false
|
|
|
|
renderScript = false
|
|
|
|
shaders = false
|
2021-06-01 09:55:03 -04:00
|
|
|
}
|
|
|
|
|
2021-07-28 15:08:04 -04:00
|
|
|
lint {
|
2022-01-25 22:49:50 -05:00
|
|
|
abortOnError = false
|
|
|
|
checkReleaseBuilds = false
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-31 10:17:27 -04:00
|
|
|
kotlin {
|
|
|
|
compilerOptions {
|
|
|
|
freeCompilerArgs.addAll(
|
|
|
|
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi",
|
|
|
|
"-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
|
|
|
|
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
|
|
|
|
"-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi",
|
|
|
|
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
|
|
|
|
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
|
|
|
|
"-opt-in=coil3.annotation.ExperimentalCoilApi",
|
|
|
|
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
|
|
|
"-opt-in=kotlinx.coroutines.FlowPreview",
|
|
|
|
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi",
|
|
|
|
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-31 11:28:34 -05:00
|
|
|
dependencies {
|
2024-01-23 07:35:58 -05:00
|
|
|
implementation(projects.i18n)
|
2024-09-05 06:00:46 -04:00
|
|
|
implementation(projects.core.archive)
|
2024-01-29 04:11:28 -05:00
|
|
|
implementation(projects.core.common)
|
2024-01-23 07:35:58 -05:00
|
|
|
implementation(projects.coreMetadata)
|
|
|
|
implementation(projects.sourceApi)
|
|
|
|
implementation(projects.sourceLocal)
|
|
|
|
implementation(projects.data)
|
|
|
|
implementation(projects.domain)
|
|
|
|
implementation(projects.presentationCore)
|
|
|
|
implementation(projects.presentationWidget)
|
2022-09-10 09:58:45 -04:00
|
|
|
|
2022-04-24 10:22:22 -04:00
|
|
|
// Compose
|
|
|
|
implementation(compose.activity)
|
2022-04-22 17:29:24 -04:00
|
|
|
implementation(compose.foundation)
|
|
|
|
implementation(compose.material3.core)
|
2022-04-23 12:05:00 -04:00
|
|
|
implementation(compose.material.icons)
|
2022-04-22 17:29:24 -04:00
|
|
|
implementation(compose.animation)
|
2022-06-25 11:03:48 -04:00
|
|
|
implementation(compose.animation.graphics)
|
2023-06-23 08:26:35 -04:00
|
|
|
debugImplementation(compose.ui.tooling)
|
|
|
|
implementation(compose.ui.tooling.preview)
|
2022-05-23 18:03:46 -04:00
|
|
|
implementation(compose.ui.util)
|
2024-08-19 08:11:39 -04:00
|
|
|
|
2024-06-29 15:44:17 -04:00
|
|
|
implementation(androidx.interpolator)
|
2022-04-22 17:29:24 -04:00
|
|
|
|
|
|
|
implementation(androidx.paging.runtime)
|
|
|
|
implementation(androidx.paging.compose)
|
|
|
|
|
2022-07-03 10:17:41 -04:00
|
|
|
implementation(libs.bundles.sqlite)
|
2022-04-22 17:29:24 -04:00
|
|
|
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(kotlinx.reflect)
|
2023-11-11 22:43:50 -05:00
|
|
|
implementation(kotlinx.immutables)
|
2022-10-30 19:38:18 -04:00
|
|
|
|
|
|
|
implementation(platform(kotlinx.coroutines.bom))
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(kotlinx.bundles.coroutines)
|
2021-07-04 12:16:12 -04:00
|
|
|
|
2020-12-31 11:28:34 -05:00
|
|
|
// AndroidX libraries
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(androidx.annotation)
|
|
|
|
implementation(androidx.appcompat)
|
|
|
|
implementation(androidx.biometricktx)
|
|
|
|
implementation(androidx.constraintlayout)
|
|
|
|
implementation(androidx.corektx)
|
|
|
|
implementation(androidx.splashscreen)
|
|
|
|
implementation(androidx.recyclerview)
|
|
|
|
implementation(androidx.viewpager)
|
2022-10-04 09:22:55 -04:00
|
|
|
implementation(androidx.profileinstaller)
|
2022-03-04 09:58:31 -05:00
|
|
|
|
|
|
|
implementation(androidx.bundles.lifecycle)
|
2020-12-31 11:28:34 -05:00
|
|
|
|
|
|
|
// Job scheduling
|
2023-10-14 22:22:46 -04:00
|
|
|
implementation(androidx.workmanager)
|
2020-12-31 11:28:34 -05:00
|
|
|
|
2023-03-05 15:37:41 -05:00
|
|
|
// RxJava
|
2023-08-26 10:30:26 -04:00
|
|
|
implementation(libs.rxjava)
|
2020-12-31 11:28:34 -05:00
|
|
|
|
2023-03-05 15:37:41 -05:00
|
|
|
// Networking
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.bundles.okhttp)
|
|
|
|
implementation(libs.okio)
|
2023-03-05 15:37:41 -05:00
|
|
|
implementation(libs.conscrypt.android) // TLS 1.3 support for Android < 10
|
2020-12-31 11:28:34 -05:00
|
|
|
|
2023-02-26 16:16:49 -05:00
|
|
|
// Data serialization (JSON, protobuf, xml)
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(kotlinx.bundles.serialization)
|
2021-09-06 11:54:00 -04:00
|
|
|
|
2021-08-07 10:50:50 -04:00
|
|
|
// HTML parser
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.jsoup)
|
2021-08-07 10:50:50 -04:00
|
|
|
|
2020-12-31 11:28:34 -05:00
|
|
|
// Disk
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.disklrucache)
|
|
|
|
implementation(libs.unifile)
|
2020-12-31 11:28:34 -05:00
|
|
|
|
|
|
|
// Preferences
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.preferencektx)
|
2020-12-31 11:28:34 -05:00
|
|
|
|
|
|
|
// Dependency injection
|
2024-09-08 10:09:45 -04:00
|
|
|
implementation(libs.injekt)
|
2020-12-31 11:28:34 -05:00
|
|
|
|
2021-08-07 10:50:50 -04:00
|
|
|
// Image loading
|
2023-05-31 22:48:13 -04:00
|
|
|
implementation(platform(libs.coil.bom))
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.bundles.coil)
|
|
|
|
implementation(libs.subsamplingscaleimageview) {
|
2021-05-25 13:42:48 -04:00
|
|
|
exclude(module = "image-decoder")
|
|
|
|
}
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.image.decoder)
|
2020-12-31 11:28:34 -05:00
|
|
|
|
2021-08-07 10:50:50 -04:00
|
|
|
// UI libraries
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.material)
|
|
|
|
implementation(libs.flexible.adapter.core)
|
|
|
|
implementation(libs.photoview)
|
|
|
|
implementation(libs.directionalviewpager) {
|
2021-09-20 14:33:35 -04:00
|
|
|
exclude(group = "androidx.viewpager", module = "viewpager")
|
|
|
|
}
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.insetter)
|
2022-12-02 22:35:30 -05:00
|
|
|
implementation(libs.bundles.richtext)
|
2022-04-23 10:52:19 -04:00
|
|
|
implementation(libs.aboutLibraries.compose)
|
2022-10-15 11:38:01 -04:00
|
|
|
implementation(libs.bundles.voyager)
|
2023-03-05 15:37:41 -05:00
|
|
|
implementation(libs.compose.materialmotion)
|
2023-07-08 10:02:20 -04:00
|
|
|
implementation(libs.swipe)
|
2024-03-22 21:10:18 -04:00
|
|
|
implementation(libs.compose.webview)
|
2024-03-28 15:02:33 -04:00
|
|
|
implementation(libs.compose.grid)
|
2024-03-22 21:10:18 -04:00
|
|
|
|
2021-08-07 10:50:50 -04:00
|
|
|
// Logging
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.logcat)
|
2021-08-07 10:50:50 -04:00
|
|
|
|
2024-01-15 09:55:26 -05:00
|
|
|
// Crash reports/analytics
|
2024-09-03 05:45:19 -04:00
|
|
|
"standardImplementation"(platform(libs.firebase.bom))
|
2024-01-15 09:55:26 -05:00
|
|
|
"standardImplementation"(libs.firebase.analytics)
|
2024-09-03 05:45:19 -04:00
|
|
|
"standardImplementation"(libs.firebase.crashlytics)
|
2024-01-15 09:55:26 -05:00
|
|
|
|
2021-09-25 14:31:52 -04:00
|
|
|
// Shizuku
|
2022-03-04 09:58:31 -05:00
|
|
|
implementation(libs.bundles.shizuku)
|
2021-09-25 14:31:52 -04:00
|
|
|
|
2020-12-31 11:28:34 -05:00
|
|
|
// Tests
|
2023-04-15 09:51:52 -04:00
|
|
|
testImplementation(libs.bundles.test)
|
2020-12-31 11:28:34 -05:00
|
|
|
|
|
|
|
// For detecting memory leaks; see https://square.github.io/leakcanary/
|
2022-03-04 09:58:31 -05:00
|
|
|
// debugImplementation(libs.leakcanary.android)
|
2022-04-24 16:28:09 -04:00
|
|
|
implementation(libs.leakcanary.plumber)
|
2024-03-28 14:36:33 -04:00
|
|
|
|
|
|
|
testImplementation(kotlinx.coroutines.test)
|
2020-12-31 11:28:34 -05:00
|
|
|
}
|
|
|
|
|
2022-10-04 09:22:55 -04:00
|
|
|
androidComponents {
|
|
|
|
beforeVariants { variantBuilder ->
|
|
|
|
// Disables standardBenchmark
|
|
|
|
if (variantBuilder.buildType == "benchmark") {
|
2023-09-01 23:02:18 -04:00
|
|
|
variantBuilder.enable = variantBuilder.productFlavors.containsAll(
|
|
|
|
listOf("default" to "dev"),
|
|
|
|
)
|
2022-10-04 09:22:55 -04:00
|
|
|
}
|
|
|
|
}
|
2022-10-30 11:42:06 -04: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 09:22:55 -04:00
|
|
|
}
|
|
|
|
|
2020-12-31 11:32:18 -05:00
|
|
|
buildscript {
|
|
|
|
dependencies {
|
2022-03-04 09:58:31 -05:00
|
|
|
classpath(kotlinx.gradle)
|
2021-01-17 11:09:29 -05:00
|
|
|
}
|
|
|
|
}
|