a7d93ae751
# Conflicts: # app/build.gradle.kts # app/shortcuts.xml # app/src/main/res/xml/shortcuts.xml # app/src/main/shortcuts.xml # build.gradle.kts # buildSrc/src/main/kotlin/mihon/buildlogic/AndroidConfig.kt # core/archive/build.gradle.kts # core/common/build.gradle.kts # gradle/build-logic/src/main/kotlin/mihon/gradle/BuildConfig.kt # settings.gradle.kts # source-api/build.gradle.kts # source-local/build.gradle.kts # telemetry/build.gradle.kts
353 lines
11 KiB
Kotlin
353 lines
11 KiB
Kotlin
|
|
import mihon.gradle.getBuildTime
|
|
import mihon.gradle.getLatestCommitCount
|
|
import mihon.gradle.getLatestCommitSha
|
|
import mihon.gradle.tasks.ReplaceShortcutsPlaceholderTask
|
|
|
|
plugins {
|
|
alias(mihonx.plugins.android.application)
|
|
alias(mihonx.plugins.compose)
|
|
alias(mihonx.plugins.spotless)
|
|
|
|
kotlin("plugin.parcelize")
|
|
|
|
alias(libs.plugins.aboutLibraries)
|
|
alias(libs.plugins.kotlin.serialization)
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "eu.kanade.tachiyomi"
|
|
|
|
defaultConfig {
|
|
applicationId = "eu.kanade.tachiyomi.sy"
|
|
|
|
versionCode = 77
|
|
versionName = "1.12.0"
|
|
|
|
buildConfigField("String", "COMMIT_COUNT", "\"${getLatestCommitCount()}\"")
|
|
buildConfigField("String", "COMMIT_SHA", "\"${getLatestCommitSha()}\"")
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime(useLatestCommitTime = false)}\"")
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
buildTypes {
|
|
named("debug") {
|
|
versionNameSuffix = "-${getLatestCommitCount()}"
|
|
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(useLatestCommitTime = 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")
|
|
}
|
|
|
|
splits {
|
|
abi {
|
|
isEnable = true
|
|
isUniversalApk = true
|
|
reset()
|
|
include("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
|
}
|
|
}
|
|
|
|
flavorDimensions.add("default")
|
|
|
|
productFlavors {
|
|
create("standard") {
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "true")
|
|
dimension = "default"
|
|
}
|
|
create("fdroid") {
|
|
dimension = "default"
|
|
}
|
|
create("dev") {
|
|
dimension = "default"
|
|
}
|
|
}
|
|
|
|
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/DEPENDENCIES",
|
|
"META-INF/LICENSE",
|
|
"META-INF/NOTICE",
|
|
"META-INF/README.md",
|
|
)
|
|
}
|
|
}
|
|
|
|
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(libs.androidx.activity.compose)
|
|
implementation(libs.androidx.compose.foundation)
|
|
implementation(libs.androidx.compose.material3)
|
|
implementation(libs.androidx.compose.materialIcons)
|
|
implementation(libs.androidx.compose.animation)
|
|
implementation(libs.androidx.compose.animationGraphics)
|
|
debugImplementation(libs.androidx.compose.uiTooling)
|
|
implementation(libs.androidx.compose.uiToolingPreview)
|
|
implementation(libs.androidx.compose.uiUtil)
|
|
|
|
implementation(libs.androidx.interpolator)
|
|
|
|
implementation(libs.androidx.paging.runtime)
|
|
implementation(libs.androidx.paging.compose)
|
|
|
|
implementation(libs.androidx.sqlite.bundled)
|
|
// SY -->
|
|
implementation(sylibs.sqlcipher)
|
|
// SY <--
|
|
|
|
|
|
implementation(libs.kotlin.reflect)
|
|
implementation(libs.kotlinx.collections.immutable)
|
|
|
|
implementation(libs.bundles.kotlinx.coroutines)
|
|
|
|
// AndroidX libraries
|
|
implementation(libs.androidx.annotation)
|
|
implementation(libs.androidx.appCompat)
|
|
implementation(libs.androidx.biometric)
|
|
implementation(libs.androidx.constraintLayout)
|
|
implementation(libs.androidx.core)
|
|
implementation(libs.androidx.coreSplashScreen)
|
|
implementation(libs.androidx.recyclerView)
|
|
implementation(libs.androidx.viewPager)
|
|
implementation(libs.androidx.profileInstaller)
|
|
|
|
implementation(libs.bundles.androidx.lifecycle)
|
|
|
|
// Job scheduling
|
|
implementation(libs.androidx.work)
|
|
|
|
// RxJava
|
|
implementation(libs.rxJava)
|
|
|
|
// Networking
|
|
implementation(libs.bundles.okhttp)
|
|
implementation(libs.okio)
|
|
implementation(libs.conscrypt) // TLS 1.3 support for Android < 10
|
|
|
|
// Data serialization (JSON, protobuf, xml)
|
|
implementation(libs.bundles.serialization)
|
|
|
|
// HTML parser
|
|
implementation(libs.jsoup)
|
|
|
|
// Disk
|
|
implementation(libs.diskLruCache)
|
|
implementation(libs.unifile)
|
|
|
|
// Preferences
|
|
implementation(libs.androidx.preference)
|
|
|
|
// Dependency injection
|
|
implementation(libs.injekt)
|
|
|
|
// Image loading
|
|
implementation(libs.bundles.coil)
|
|
implementation(libs.subsamplingScaleImageView) {
|
|
exclude(module = "image-decoder")
|
|
}
|
|
implementation(libs.image.decoder)
|
|
|
|
// UI libraries
|
|
implementation(libs.material)
|
|
implementation(libs.flexibleAdapter)
|
|
implementation(libs.photoView)
|
|
implementation(libs.directionalViewPager) {
|
|
exclude(group = "androidx.viewpager", module = "viewpager")
|
|
}
|
|
implementation(libs.composeRichEditor)
|
|
implementation(libs.aboutLibraries.compose)
|
|
implementation(libs.bundles.voyager)
|
|
implementation(libs.composeMaterialMotion)
|
|
implementation(libs.swipe)
|
|
implementation(libs.composeWebview)
|
|
implementation(libs.composeGrid)
|
|
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(libs.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 { variant ->
|
|
val resSource = variant.sources.res ?: return@onVariants
|
|
|
|
val variantName = variant.name.replaceFirstChar { it.uppercase() }
|
|
val replaceShortcutsPlaceholderTask = tasks.register<ReplaceShortcutsPlaceholderTask>(
|
|
"replace${variantName}ShortcutPlaceholder",
|
|
) {
|
|
applicationId.set(variant.applicationId)
|
|
shortcutsFile.set(projectDir.resolve("src/main/shortcuts.xml"))
|
|
}
|
|
resSource.addGeneratedSourceDirectory(replaceShortcutsPlaceholderTask) { it.outputDir }
|
|
}
|
|
|
|
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(libs.kotlin.gradle)
|
|
}
|
|
}
|