* 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)
349 lines
10 KiB
Text
349 lines
10 KiB
Text
import mihon.buildlogic.Config
|
|
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")
|
|
alias(libs.plugins.aboutLibraries)
|
|
id("com.github.ben-manes.versions")
|
|
}
|
|
|
|
if (Config.includeTelemetry) {
|
|
pluginManager.apply {
|
|
apply(libs.plugins.google.services.get().pluginId)
|
|
apply(libs.plugins.firebase.crashlytics.get().pluginId)
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "eu.kanade.tachiyomi"
|
|
|
|
defaultConfig {
|
|
applicationId = "app.komikku"
|
|
|
|
versionCode = 78
|
|
versionName = "1.13.6"
|
|
|
|
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
|
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime(useLastCommitTime = false)}\"")
|
|
buildConfigField("boolean", "TELEMETRY_INCLUDED", "${Config.includeTelemetry}")
|
|
buildConfigField("boolean", "UPDATER_ENABLED", "${Config.enableUpdater}")
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
buildTypes {
|
|
val debug by getting {
|
|
applicationIdSuffix = ".dev"
|
|
versionNameSuffix = "-${getCommitCount()}"
|
|
isPseudoLocalesEnabled = true
|
|
}
|
|
val release by getting {
|
|
isMinifyEnabled = Config.enableCodeShrink
|
|
isShrinkResources = Config.enableCodeShrink
|
|
|
|
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
|
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime(useLastCommitTime = true)}\"")
|
|
}
|
|
|
|
val commonMatchingFallbacks = listOf(release.name)
|
|
|
|
create("releaseTest") {
|
|
initWith(release)
|
|
|
|
applicationIdSuffix = ".rt"
|
|
isMinifyEnabled = false
|
|
isShrinkResources = false
|
|
|
|
matchingFallbacks.addAll(commonMatchingFallbacks)
|
|
}
|
|
create("foss") {
|
|
initWith(release)
|
|
|
|
applicationIdSuffix = ".foss"
|
|
|
|
matchingFallbacks.addAll(commonMatchingFallbacks)
|
|
}
|
|
create("preview") {
|
|
initWith(release)
|
|
|
|
applicationIdSuffix = ".beta"
|
|
|
|
versionNameSuffix = debug.versionNameSuffix
|
|
signingConfig = debug.signingConfig
|
|
|
|
matchingFallbacks.addAll(commonMatchingFallbacks)
|
|
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime(useLastCommitTime = false)}\"")
|
|
}
|
|
create("benchmark") {
|
|
initWith(release)
|
|
|
|
isDebuggable = false
|
|
isProfileable = true
|
|
versionNameSuffix = "${debug.versionNameSuffix}-benchmark"
|
|
applicationIdSuffix = ".benchmark"
|
|
|
|
signingConfig = debug.signingConfig
|
|
|
|
matchingFallbacks.addAll(commonMatchingFallbacks)
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
getByName("preview").res.srcDirs("src/beta/res")
|
|
getByName("benchmark").res.srcDirs("src/debug/res")
|
|
}
|
|
|
|
splits {
|
|
abi {
|
|
isEnable = true
|
|
isUniversalApk = true
|
|
reset()
|
|
include("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
|
}
|
|
}
|
|
|
|
packaging {
|
|
jniLibs {
|
|
keepDebugSymbols += listOf(
|
|
"libandroidx.graphics.path",
|
|
"libarchive-jni",
|
|
"libconscrypt_jni",
|
|
"libimagedecoder",
|
|
"libquickjs",
|
|
"libsqlite3x",
|
|
)
|
|
.map { "**/$it.so" }
|
|
}
|
|
resources {
|
|
excludes += setOf(
|
|
"kotlin-tooling-metadata.json",
|
|
"LICENSE.txt",
|
|
"META-INF/**/*.properties",
|
|
"META-INF/**/LICENSE.txt",
|
|
"META-INF/*.properties",
|
|
"META-INF/*.version",
|
|
"META-INF/INDEX.LIST",
|
|
"META-INF/DEPENDENCIES",
|
|
"META-INF/LICENSE",
|
|
"META-INF/NOTICE",
|
|
"META-INF/README.md",
|
|
)
|
|
}
|
|
}
|
|
|
|
dependenciesInfo {
|
|
includeInApk = Config.includeDependencyInfo
|
|
includeInBundle = Config.includeDependencyInfo
|
|
}
|
|
|
|
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)
|
|
// KMK -->
|
|
implementation(projects.i18nKmk)
|
|
// KMK <--
|
|
// SY -->
|
|
implementation(projects.i18nSy)
|
|
// SY <--
|
|
implementation(projects.core.archive)
|
|
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)
|
|
implementation(projects.telemetry)
|
|
|
|
// 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)
|
|
|
|
// KMK -->
|
|
implementation(libs.palette.ktx)
|
|
implementation(libs.haze)
|
|
implementation(compose.colorpicker)
|
|
implementation(projects.flagkit)
|
|
// KMK <--
|
|
|
|
// Logging
|
|
implementation(libs.timber)
|
|
implementation(libs.logcat)
|
|
|
|
// 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 -->
|
|
// Better logging (EH)
|
|
implementation(sylibs.xlog)
|
|
|
|
// RatingBar (SY)
|
|
implementation(sylibs.ratingbar)
|
|
implementation(sylibs.composeRatingbar)
|
|
|
|
// Google drive
|
|
implementation(sylibs.google.api.services.drive)
|
|
|
|
// 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)
|
|
}
|
|
}
|