
* feat: add cross device sync. * chore: add google api. * chore: add SY specifics. * feat: add backupSource, backupPref, and "SY" backupSavedSearches. I forgot to add the data into the merging logic, So remote always have empty value :(. Better late than never. * feat(sync): Allow to choose what to sync. Various improvement and added the option to choose what they want to sync. Added sync library button to LibraryTab as well. Signed-off-by: KaiserBh <kaiserbh@proton.me> * oops. Signed-off-by: KaiserBh <kaiserbh@proton.me> * refactor: fix up the sync triggers, and update imports. * refactor * chore: review pointers. * refactor: update imports * refactor: add more error guard for gdrive. Also changed it to be app specific, we don't want them to use sync data from SY or other forks as some of the model and backup is different. So if people using other forks they should use the same data and not mismatch. * fix: conflict and refactor. * refactor: update imports. * chore: fix some of detekt error. * refactor: add breaks and max retries. I think we were reaching deadlock or infinite loop causing the sync to go forever. * feat: db changes to accommodate new syncing logic. Using timestamp to sync is a bit skewed due to system clock etc and therefore there was a lot of issues with it such as removing a manga that shouldn't have been removed. Marking chapters as unread even though it was marked as a read. Hopefully by using versioning system it should eliminate those issues. * chore: add migrations * chore: version and is_syncing fields. * chore: add SY only stuff. * fix: oops wrong index. Signed-off-by: KaiserBh <kaiserbh@proton.me> * chore: review pointers. Signed-off-by: KaiserBh <kaiserbh@proton.me> * chore: remove the option to reset timestamp We don't need this anymore since we are utilizing versioning system. Signed-off-by: KaiserBh <kaiserbh@proton.me> * refactor: Forgot to use the new versioning system. I forgot to cherry pick this from mihon branch. * chore: remove isSyncing from Chapter/Manga model. Signed-off-by: KaiserBh <kaiserbh@proton.me> * chore: remove unused import. Signed-off-by: KaiserBh <kaiserbh@proton.me> * chore: remove isSyncing leftover. Signed-off-by: KaiserBh <kaiserbh@proton.me> * chore: remove isSyncing. Signed-off-by: KaiserBh <kaiserbh@proton.me> * refactor: make sure the manga version is bumped. When there is changes in the chapters table such as reading or updating last read page we should bump the manga version. This way the manga is synced properly as in the History and last_read history is synced properly. This should fix the sorting issue. Signed-off-by: KaiserBh <kaiserbh@proton.me> --------- Signed-off-by: KaiserBh <kaiserbh@proton.me>
350 lines
11 KiB
Plaintext
350 lines
11 KiB
Plaintext
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("com.mikepenz.aboutlibraries.plugin")
|
|
kotlin("android")
|
|
kotlin("plugin.parcelize")
|
|
kotlin("plugin.serialization")
|
|
// id("com.github.zellius.shortcut-helper")
|
|
id("com.github.ben-manes.versions")
|
|
}
|
|
|
|
if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
|
apply<com.google.gms.googleservices.GoogleServicesPlugin>()
|
|
// Firebase Crashlytics
|
|
apply(plugin = "com.google.firebase.crashlytics")
|
|
}
|
|
|
|
// shortcutHelper.setFilePath("./shortcuts.xml")
|
|
|
|
val SUPPORTED_ABIS = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
|
|
|
android {
|
|
namespace = "eu.kanade.tachiyomi"
|
|
|
|
defaultConfig {
|
|
applicationId = "eu.kanade.tachiyomi.sy"
|
|
|
|
versionCode = 66
|
|
versionName = "1.10.5"
|
|
|
|
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
|
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
|
buildConfigField("boolean", "INCLUDE_UPDATER", "false")
|
|
|
|
ndk {
|
|
abiFilters += SUPPORTED_ABIS
|
|
}
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
splits {
|
|
abi {
|
|
isEnable = true
|
|
reset()
|
|
include(*SUPPORTED_ABIS.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"))
|
|
}
|
|
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") {
|
|
// Include pseudolocales: https://developer.android.com/guide/topics/resources/pseudolocales
|
|
resourceConfigurations.addAll(listOf("en", "en_XA", "ar_XB", "xxhdpi"))
|
|
dimension = "default"
|
|
}
|
|
}
|
|
|
|
packaging {
|
|
resources.excludes.addAll(
|
|
listOf(
|
|
"META-INF/DEPENDENCIES",
|
|
"LICENSE.txt",
|
|
"META-INF/LICENSE",
|
|
"META-INF/LICENSE.txt",
|
|
"META-INF/README.md",
|
|
"META-INF/NOTICE",
|
|
"META-INF/*.kotlin_module",
|
|
),
|
|
)
|
|
}
|
|
|
|
dependenciesInfo {
|
|
includeInApk = false
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding = true
|
|
compose = true
|
|
buildConfig = true
|
|
|
|
// Disable some unused things
|
|
aidl = false
|
|
renderScript = false
|
|
shaders = false
|
|
}
|
|
|
|
lint {
|
|
abortOnError = false
|
|
checkReleaseBuilds = false
|
|
}
|
|
|
|
composeOptions {
|
|
kotlinCompilerExtensionVersion = compose.versions.compiler.get()
|
|
}
|
|
}
|
|
|
|
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(platform(compose.bom))
|
|
implementation(compose.activity)
|
|
implementation(compose.foundation)
|
|
implementation(compose.material3.core)
|
|
implementation(compose.material.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(compose.accompanist.webview)
|
|
implementation(compose.accompanist.systemuicontroller)
|
|
|
|
implementation(androidx.paging.runtime)
|
|
implementation(androidx.paging.compose)
|
|
|
|
implementation(libs.bundles.sqlite)
|
|
// SY -->
|
|
implementation(libs.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)
|
|
implementation(libs.junrar)
|
|
// SY -->
|
|
implementation(libs.zip4j)
|
|
// SY <--
|
|
|
|
// Preferences
|
|
implementation(libs.preferencektx)
|
|
|
|
// Dependency injection
|
|
implementation(libs.injekt.core)
|
|
|
|
// 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.insetter)
|
|
implementation(libs.bundles.richtext)
|
|
implementation(libs.aboutLibraries.compose)
|
|
implementation(libs.bundles.voyager)
|
|
implementation(libs.compose.materialmotion)
|
|
implementation(libs.swipe)
|
|
|
|
implementation(libs.google.api.services.drive)
|
|
implementation(libs.google.api.client.oauth)
|
|
|
|
// Logging
|
|
implementation(libs.logcat)
|
|
|
|
// Crash reports/analytics
|
|
// implementation(libs.bundles.acra)
|
|
// "standardImplementation"(libs.firebase.analytics)
|
|
|
|
// Shizuku
|
|
implementation(libs.bundles.shizuku)
|
|
|
|
// Tests
|
|
testImplementation(libs.bundles.test)
|
|
|
|
// For detecting memory leaks; see https://square.github.io/leakcanary/
|
|
// debugImplementation(libs.leakcanary.android)
|
|
implementation(libs.leakcanary.plumber)
|
|
|
|
// SY -->
|
|
// Text distance (EH)
|
|
implementation(sylibs.simularity)
|
|
|
|
// Firebase (EH)
|
|
implementation(sylibs.firebase.analytics)
|
|
implementation(sylibs.firebase.crashlytics.ktx)
|
|
|
|
// Better logging (EH)
|
|
implementation(sylibs.xlog)
|
|
|
|
// RatingBar (SY)
|
|
implementation(sylibs.ratingbar)
|
|
implementation(sylibs.composeRatingbar)
|
|
}
|
|
|
|
androidComponents {
|
|
beforeVariants { variantBuilder ->
|
|
// Disables standardBenchmark
|
|
if (variantBuilder.buildType == "benchmark") {
|
|
variantBuilder.enable = variantBuilder.productFlavors.containsAll(
|
|
listOf("default" to "dev"),
|
|
)
|
|
}
|
|
}
|
|
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")
|
|
}
|
|
}
|
|
|
|
tasks {
|
|
// See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers)
|
|
withType<KotlinCompile> {
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
"-Xcontext-receivers",
|
|
"-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi",
|
|
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
|
|
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
|
|
"-opt-in=androidx.compose.material.ExperimentalMaterialApi",
|
|
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
|
|
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
|
|
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi",
|
|
"-opt-in=androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi",
|
|
"-opt-in=coil3.annotation.ExperimentalCoilApi",
|
|
"-opt-in=com.google.accompanist.permissions.ExperimentalPermissionsApi",
|
|
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
|
"-opt-in=kotlinx.coroutines.FlowPreview",
|
|
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi",
|
|
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
|
|
)
|
|
|
|
if (project.findProperty("tachiyomi.enableComposeCompilerMetrics") == "true") {
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
"-P",
|
|
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
|
|
project.layout.buildDirectory.dir("compose_metrics").get().asFile.absolutePath,
|
|
)
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
"-P",
|
|
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
|
|
project.layout.buildDirectory.dir("compose_metrics").get().asFile.absolutePath,
|
|
)
|
|
}
|
|
|
|
// https://developer.android.com/jetpack/androidx/releases/compose-compiler#1.5.9
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
"-P",
|
|
"plugin:androidx.compose.compiler.plugins.kotlin:nonSkippingGroupOptimization=true",
|
|
)
|
|
}
|
|
}
|
|
|
|
buildscript {
|
|
dependencies {
|
|
classpath(kotlinx.gradle)
|
|
}
|
|
}
|