2034971cc0
* Replace deprecated rememberPlainTooltipPositionProvider * Remove superfluous when branch This when is marked as exhaustive. * Replace deprecated LibrariesContainer call AboutLibraries now wants us to produce the libraries ourselves. * Replace deprecated ClipboardManager with Clipboard Clipboard uses suspend functions, hence the coroutine scope addition. * Use multi-dollar strs to simplify GraphQL queries These have been available since Kotlin 2.1. * Remove various redundant casts & conversions - WebViewScreenContent: loadingState is in the LoadingState.Loading branch, no need to cast at all - Bangumi: username is not modified, make val - Kavita: token is already a String - PagerViewerAdapter: insertPageLastPage is already null-checked - PagerViewerAdapter: use reified filterIsInstance - ReaderViewModel: chapter IDs are already Longs - CloudflareInterceptor: webview is smart-cast to non-null here * Replace deprecated MenuAnchorType Literally just a typealias for ExposedDropdownMenuAnchorType anyway. * OptimizeNonSkippingGroups is enabled by default * Suppress shadowing warning This is explicitly intentional according to the KDocs. * Migrate Context Receivers to Context Parameters Requires changing the compiler arg, but that is part of the migration: https://blog.jetbrains.com/kotlin/2025/04/update-on-context-parameters Apparently, the only visible change is that names are required now. "_" can be used for anonymous context parameters. * Fix expression bodies with explicit return Naming conflict resolved by aliasing. From 2.4/2.5 onward, these will only be allowed with explicit return types, or have to be turned into a block body. I opted for the latter since the function is reasonably dense already. see: https://youtrack.jetbrains.com/issue/KTLC-288 * Suppress deprecation of non-AutoMirrored icons We use these arrows for navigation in the Upcoming screen. I strongly doubt the AutoMirrored versions would make sense for our use-case. * Explicitly opt-in to new annotation default rules affects the following annotated value-parameters: - Preference.SliderPreference.steps (`@IntRange`) - ReaderViewModel.State.brightnessOverlayValue (`@IntRange`) - ReadingMode.iconRes (`@DrawableRes`) - MigrationListScreenModel.Dialog.Progress.progress (`@FloatRange`) see: https://youtrack.jetbrains.com/issue/KT-73255 see: https://github.com/Kotlin/KEEP/blob/change-defaulting-rule/proposals/annotation-target-in-properties.md Warning message was the following: This annotation is currently applied to the value parameter only, but in the future it will also be applied to field. - To opt in to applying to both value parameter and field, add '-Xannotation-default-target=param-property' to your compiler arguments. - To keep applying to the value parameter only, use the '@param:' annotation target. (cherry picked from commit b543bc089a442c5e93b0fb6c83bc4037740b1eb5) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewerAdapter.kt # core/common/src/main/kotlin/eu/kanade/tachiyomi/network/interceptor/CloudflareInterceptor.kt # core/common/src/main/kotlin/mihon/core/common/archive/ArchiveInputStream.kt
334 lines
9.8 KiB
Kotlin
334 lines
9.8 KiB
Kotlin
@file:Suppress("ChromeOsAbiSupport")
|
|
|
|
import mihon.buildlogic.getBuildTime
|
|
import mihon.buildlogic.getCommitCount
|
|
import mihon.buildlogic.getGitSha
|
|
|
|
plugins {
|
|
id("mihon.android.application")
|
|
id("mihon.android.application.compose")
|
|
kotlin("plugin.parcelize")
|
|
kotlin("plugin.serialization")
|
|
// id("com.github.zellius.shortcut-helper")
|
|
alias(libs.plugins.aboutLibraries)
|
|
id("com.github.ben-manes.versions")
|
|
}
|
|
|
|
if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
|
pluginManager.apply {
|
|
apply(libs.plugins.google.services.get().pluginId)
|
|
apply(libs.plugins.firebase.crashlytics.get().pluginId)
|
|
}
|
|
}
|
|
|
|
// shortcutHelper.setFilePath("./shortcuts.xml")
|
|
|
|
val supportedAbis = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
|
|
|
android {
|
|
namespace = "eu.kanade.tachiyomi"
|
|
|
|
defaultConfig {
|
|
applicationId = "eu.kanade.tachiyomi.sy"
|
|
|
|
versionCode = 75
|
|
versionName = "1.12.0"
|
|
|
|
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
|
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime(useLastCommitTime = false)}\"")
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
|
|
|
ndk {
|
|
abiFilters += supportedAbis
|
|
}
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
splits {
|
|
abi {
|
|
isEnable = true
|
|
reset()
|
|
include(*supportedAbis.toTypedArray())
|
|
isUniversalApk = true
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
named("debug") {
|
|
versionNameSuffix = "-${getCommitCount()}"
|
|
applicationIdSuffix = ".debug"
|
|
isPseudoLocalesEnabled = true
|
|
}
|
|
create("releaseTest") {
|
|
applicationIdSuffix = ".rt"
|
|
// isMinifyEnabled = true
|
|
// isShrinkResources = true
|
|
setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"))
|
|
matchingFallbacks.add("release")
|
|
}
|
|
named("release") {
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"))
|
|
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime(useLastCommitTime = true)}\"")
|
|
}
|
|
create("benchmark") {
|
|
initWith(getByName("release"))
|
|
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
matchingFallbacks.add("release")
|
|
isDebuggable = false
|
|
isProfileable = true
|
|
versionNameSuffix = "-benchmark"
|
|
applicationIdSuffix = ".benchmark"
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
getByName("benchmark").res.srcDirs("src/debug/res")
|
|
}
|
|
|
|
flavorDimensions.add("default")
|
|
|
|
productFlavors {
|
|
create("standard") {
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "true")
|
|
dimension = "default"
|
|
}
|
|
create("fdroid") {
|
|
dimension = "default"
|
|
}
|
|
create("dev") {
|
|
dimension = "default"
|
|
}
|
|
}
|
|
|
|
packaging {
|
|
resources.excludes.addAll(
|
|
listOf(
|
|
"kotlin-tooling-metadata.json",
|
|
"META-INF/DEPENDENCIES",
|
|
"LICENSE.txt",
|
|
"META-INF/LICENSE",
|
|
"META-INF/**/LICENSE.txt",
|
|
"META-INF/*.properties",
|
|
"META-INF/**/*.properties",
|
|
"META-INF/README.md",
|
|
"META-INF/NOTICE",
|
|
"META-INF/*.version",
|
|
),
|
|
)
|
|
}
|
|
|
|
dependenciesInfo {
|
|
includeInApk = false
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding = true
|
|
buildConfig = true
|
|
aidl = true
|
|
|
|
// Disable some unused things
|
|
renderScript = false
|
|
shaders = false
|
|
}
|
|
|
|
lint {
|
|
abortOnError = false
|
|
checkReleaseBuilds = false
|
|
}
|
|
}
|
|
|
|
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.material3.ExperimentalMaterial3ExpressiveApi",
|
|
"-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",
|
|
"-Xannotation-default-target=param-property",
|
|
)
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(projects.i18n)
|
|
// SY -->
|
|
implementation(projects.i18nSy)
|
|
// SY <--
|
|
implementation(projects.core.common)
|
|
implementation(projects.coreMetadata)
|
|
implementation(projects.sourceApi)
|
|
implementation(projects.sourceLocal)
|
|
implementation(projects.data)
|
|
implementation(projects.domain)
|
|
implementation(projects.presentationCore)
|
|
implementation(projects.presentationWidget)
|
|
|
|
// Compose
|
|
implementation(compose.activity)
|
|
implementation(compose.foundation)
|
|
implementation(compose.material3.core)
|
|
implementation(compose.material.icons)
|
|
implementation(compose.animation)
|
|
implementation(compose.animation.graphics)
|
|
debugImplementation(compose.ui.tooling)
|
|
implementation(compose.ui.tooling.preview)
|
|
implementation(compose.ui.util)
|
|
|
|
implementation(androidx.interpolator)
|
|
|
|
implementation(androidx.paging.runtime)
|
|
implementation(androidx.paging.compose)
|
|
|
|
implementation(libs.bundles.sqlite)
|
|
// SY -->
|
|
implementation(sylibs.sqlcipher)
|
|
// SY <--
|
|
|
|
implementation(kotlinx.reflect)
|
|
implementation(kotlinx.immutables)
|
|
|
|
implementation(platform(kotlinx.coroutines.bom))
|
|
implementation(kotlinx.bundles.coroutines)
|
|
|
|
// AndroidX libraries
|
|
implementation(androidx.annotation)
|
|
implementation(androidx.appcompat)
|
|
implementation(androidx.biometricktx)
|
|
implementation(androidx.constraintlayout)
|
|
implementation(androidx.corektx)
|
|
implementation(androidx.splashscreen)
|
|
implementation(androidx.recyclerview)
|
|
implementation(androidx.viewpager)
|
|
implementation(androidx.profileinstaller)
|
|
|
|
implementation(androidx.bundles.lifecycle)
|
|
|
|
// Job scheduling
|
|
implementation(androidx.workmanager)
|
|
|
|
// RxJava
|
|
implementation(libs.rxjava)
|
|
|
|
// Networking
|
|
implementation(libs.bundles.okhttp)
|
|
implementation(libs.okio)
|
|
implementation(libs.conscrypt.android) // TLS 1.3 support for Android < 10
|
|
|
|
// Data serialization (JSON, protobuf, xml)
|
|
implementation(kotlinx.bundles.serialization)
|
|
|
|
// HTML parser
|
|
implementation(libs.jsoup)
|
|
|
|
// Disk
|
|
implementation(libs.disklrucache)
|
|
implementation(libs.unifile)
|
|
|
|
// Preferences
|
|
implementation(libs.preferencektx)
|
|
|
|
// Dependency injection
|
|
implementation(libs.injekt)
|
|
|
|
// Image loading
|
|
implementation(platform(libs.coil.bom))
|
|
implementation(libs.bundles.coil)
|
|
implementation(libs.subsamplingscaleimageview) {
|
|
exclude(module = "image-decoder")
|
|
}
|
|
implementation(libs.image.decoder)
|
|
|
|
// UI libraries
|
|
implementation(libs.material)
|
|
implementation(libs.flexible.adapter.core)
|
|
implementation(libs.photoview)
|
|
implementation(libs.directionalviewpager) {
|
|
exclude(group = "androidx.viewpager", module = "viewpager")
|
|
}
|
|
implementation(libs.richeditor.compose)
|
|
implementation(libs.aboutLibraries.compose)
|
|
implementation(libs.bundles.voyager)
|
|
implementation(libs.compose.materialmotion)
|
|
implementation(libs.swipe)
|
|
implementation(libs.compose.webview)
|
|
implementation(libs.compose.grid)
|
|
implementation(libs.reorderable)
|
|
implementation(libs.bundles.markdown)
|
|
implementation(libs.materialKolor)
|
|
|
|
// Logging
|
|
implementation(libs.logcat)
|
|
|
|
// Crash reports/analytics
|
|
// "standardImplementation"(platform(libs.firebase.bom))
|
|
// "standardImplementation"(libs.firebase.analytics)
|
|
// "standardImplementation"(libs.firebase.crashlytics)
|
|
|
|
// Shizuku
|
|
implementation(libs.bundles.shizuku)
|
|
|
|
// String similarity
|
|
implementation(libs.stringSimilarity)
|
|
|
|
// Tests
|
|
testImplementation(libs.bundles.test)
|
|
testRuntimeOnly(libs.junit.platform.launcher)
|
|
|
|
// For detecting memory leaks; see https://square.github.io/leakcanary/
|
|
// debugImplementation(libs.leakcanary.android)
|
|
implementation(libs.leakcanary.plumber)
|
|
|
|
testImplementation(kotlinx.coroutines.test)
|
|
|
|
// SY -->
|
|
// Firebase (EH)
|
|
implementation(platform(libs.firebase.bom))
|
|
implementation(libs.firebase.analytics)
|
|
implementation(libs.firebase.crashlytics)
|
|
|
|
// Better logging (EH)
|
|
implementation(sylibs.xlog)
|
|
|
|
// RatingBar (SY)
|
|
implementation(sylibs.ratingbar)
|
|
implementation(sylibs.composeRatingbar)
|
|
|
|
// Google drive
|
|
implementation(sylibs.google.api.services.drive)
|
|
implementation(sylibs.google.api.client.oauth)
|
|
|
|
// Koin
|
|
implementation(sylibs.koin.core)
|
|
implementation(sylibs.koin.android)
|
|
|
|
// ZXing Android Embedded
|
|
implementation(sylibs.zxing.android.embedded)
|
|
}
|
|
|
|
androidComponents {
|
|
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")
|
|
}
|
|
}
|
|
|
|
buildscript {
|
|
dependencies {
|
|
classpath(kotlinx.gradle)
|
|
}
|
|
}
|