yokai/app/build.gradle.kts
Jays2Kings 3140361452
Targeting SDK 33 (Android 13) (#1525)
* starting workmanager updates

* Update Download service to download job

Also making downloader use suspend methods like upstream

Co-Authored-By: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>

* Make BackupRestorer a job

* Make LibraryUpdateJob a datasync service type

* Changing Extension auto installer to a job instead of service

* Changing App auto installer to a job instead of service

With it theres no more services, and nearly ready to up the target sdk

* Add runtime permission for notifications

Shows permission when adding to library, seeing the app update in app prompt, or loading library or recents
Tries to show the permission again (or a warning message) when trying to restore a backup or set library update timing
Same warning messages shows when not allowing notifications

* Set target sdk to 33

we made it.

* Clean up ContextExtensions

* Add notification check for incognito mode

* Add last updated timestamp to updates job

* Update LibraryUpdateJob.kt

minor changes to the notifier's placeholder, and making sure it uses localeContext for versions under A13

* update channel logic in library updater

* Change library update channel to just take a Long instead a whole Manga

* Use extensionManager flow in ExtensionInstallerJob

* Update MainActivity.kt

* Fixes to downloadFlow

* reworking running extensions after library update logic

* Change update channel to shared flow in library job

* More updates to the library updates flow

no longer using a suspend, instead holding a buffer for the flow

* updates to the flow in extensionInstaller

from state to shared, also using "tryEmit" less for it

* Fix extension auto installing notification not dismissing/dismissable

* Version 1.7.0

* Update AppDownloadInstallJob.kt

* Refactor DownloadJob

* Version 1.7.0-b02

* Fix uninstalling extensions not refreshing the list

* Show notification permission prompt when pressing update all

* Chunked the extension install job in case too many extensions are being updated at once

The limit is around 62 extensions, but to be safe it runs 32 per job (which jobs still update 3 at a time)

Closes #1584

* Update Java Version

---------

Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com>
2023-07-31 16:19:43 -04:00

327 lines
No EOL
12 KiB
Kotlin

import java.io.ByteArrayOutputStream
plugins {
id(Plugins.androidApplication)
kotlin(Plugins.kotlinAndroid)
kotlin(Plugins.kapt)
id(Plugins.kotlinParcelize)
id(Plugins.kotlinSerialization)
id("com.google.android.gms.oss-licenses-plugin")
id(Plugins.googleServices) apply false
id("com.google.firebase.crashlytics")
}
if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
apply<com.google.gms.googleservices.GoogleServicesPlugin>()
}
fun runCommand(command: String): String {
val byteOut = ByteArrayOutputStream()
project.exec {
commandLine = command.split(" ")
standardOutput = byteOut
}
return String(byteOut.toByteArray()).trim()
}
val supportedAbis = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
android {
compileSdk = AndroidVersions.compileSdk
ndkVersion = AndroidVersions.ndk
defaultConfig {
minSdk = AndroidVersions.minSdk
targetSdk = AndroidVersions.targetSdk
applicationId = "eu.kanade.tachiyomi"
versionCode = AndroidVersions.versionCode
versionName = AndroidVersions.versionName
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
buildConfigField("String", "BETA_COUNT", "\"${getBetaCount()}\"")
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
buildConfigField("Boolean", "INCLUDE_UPDATER", "false")
buildConfigField("boolean", "BETA", "false")
ndk {
abiFilters += supportedAbis
}
externalNativeBuild {
cmake {
this.arguments("-DHAVE_LIBJXL=FALSE")
}
}
}
splits {
abi {
isEnable = true
reset()
include(*supportedAbis.toTypedArray())
isUniversalApk = true
}
}
buildTypes {
getByName("debug") {
applicationIdSuffix = ".debugJ2K"
versionNameSuffix = "-d${getCommitCount()}"
}
getByName("release") {
applicationIdSuffix = ".j2k"
isShrinkResources = true
isMinifyEnabled = true
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
}
create("beta") {
initWith(getByName("release"))
buildConfigField("boolean", "BETA", "true")
versionNameSuffix = "-b${getBetaCount()}"
}
}
buildFeatures {
viewBinding = true
compose = true
// Disable some unused things
aidl = false
renderScript = false
shaders = false
}
flavorDimensions.add("default")
productFlavors {
create("standard") {
buildConfigField("Boolean", "INCLUDE_UPDATER", "true")
}
create("dev") {
resourceConfigurations.clear()
resourceConfigurations.add("en")
}
}
lint {
disable.addAll(listOf("MissingTranslation", "ExtraTranslation"))
abortOnError = false
checkReleaseBuilds = false
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.2"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
namespace = "eu.kanade.tachiyomi"
}
dependencies {
// Compose
implementation("androidx.activity:activity-compose:1.6.1")
implementation("androidx.compose.foundation:foundation:1.3.1")
implementation("androidx.compose.animation:animation:1.3.3")
implementation("androidx.compose.ui:ui:1.3.3")
implementation("androidx.compose.material:material:1.3.1")
implementation("androidx.compose.material3:material3:1.0.1")
implementation("com.google.android.material:compose-theme-adapter-3:1.1.1")
implementation("androidx.compose.material:material-icons-extended:1.3.1")
implementation("androidx.compose.ui:ui-tooling-preview:1.3.3")
debugImplementation("androidx.compose.ui:ui-tooling:1.3.3")
implementation("com.google.accompanist:accompanist-webview:0.28.0")
implementation("androidx.glance:glance-appwidget:1.0.0-alpha03")
// Modified dependencies
implementation("com.github.jays2kings:subsampling-scale-image-view:756849e") {
exclude(module = "image-decoder")
}
implementation("com.github.tachiyomiorg:image-decoder:7481a4a")
// Android X libraries
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.cardview:cardview:1.0.0")
implementation("com.google.android.material:material:1.8.0")
implementation("androidx.webkit:webkit:1.6.1")
implementation("androidx.recyclerview:recyclerview:1.3.0")
implementation("androidx.preference:preference:1.2.0")
implementation("androidx.annotation:annotation:1.6.0")
implementation("androidx.browser:browser:1.5.0")
implementation("androidx.biometric:biometric:1.1.0")
implementation("androidx.palette:palette:1.0.0")
implementation("androidx.activity:activity-ktx:1.7.0")
implementation("androidx.core:core-ktx:1.10.0")
implementation("com.google.android.flexbox:flexbox:3.0.0")
implementation("androidx.window:window:1.0.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.multidex:multidex:2.0.1")
implementation(platform("com.google.firebase:firebase-bom:31.2.3"))
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-crashlytics-ktx")
val lifecycleVersion = "2.6.1"
kapt("androidx.lifecycle:lifecycle-compiler:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-common:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-process:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion")
// ReactiveX
implementation("io.reactivex:rxandroid:1.2.1")
implementation("io.reactivex:rxjava:1.3.8")
implementation("com.jakewharton.rxrelay:rxrelay:1.2.0")
// Coroutines
implementation("com.fredporciuncula:flow-preferences:1.6.0")
// Network client
val okhttpVersion = "5.0.0-alpha.11"
implementation("com.squareup.okhttp3:okhttp:$okhttpVersion")
implementation("com.squareup.okhttp3:logging-interceptor:$okhttpVersion")
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:$okhttpVersion")
implementation("com.squareup.okio:okio:3.3.0")
// Chucker
val chuckerVersion = "3.5.2"
debugImplementation("com.github.ChuckerTeam.Chucker:library:$chuckerVersion")
releaseImplementation("com.github.ChuckerTeam.Chucker:library-no-op:$chuckerVersion")
add("betaImplementation", "com.github.ChuckerTeam.Chucker:library-no-op:$chuckerVersion")
implementation(kotlin("reflect", version = AndroidVersions.kotlin))
// JSON
val kotlinSerialization = "1.4.0"
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${kotlinSerialization}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:${kotlinSerialization}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-okio:${kotlinSerialization}")
// JavaScript engine
implementation("app.cash.quickjs:quickjs-android:0.9.2")
// Disk
implementation("com.jakewharton:disklrucache:2.0.2")
implementation("com.github.tachiyomiorg:unifile:17bec43")
implementation("com.github.junrar:junrar:7.5.4")
// HTML parser
implementation("org.jsoup:jsoup:1.15.4")
// Job scheduling
implementation("androidx.work:work-runtime-ktx:2.8.0")
implementation("com.google.guava:guava:31.1-android")
implementation("com.google.android.gms:play-services-gcm:17.0.0")
// Database
implementation("androidx.sqlite:sqlite-ktx:2.3.0")
implementation("com.github.requery:sqlite-android:3.39.2")
implementation("com.github.inorichi.storio:storio-common:8be19de@aar")
implementation("com.github.inorichi.storio:storio-sqlite:8be19de@aar")
// Model View Presenter
val nucleusVersion = "3.0.0"
implementation("info.android15.nucleus:nucleus:$nucleusVersion")
implementation("info.android15.nucleus:nucleus-support-v7:$nucleusVersion")
// Dependency injection
implementation("com.github.inorichi.injekt:injekt-core:65b0440")
// Image library
val coilVersion = "2.1.0"
implementation("io.coil-kt:coil:$coilVersion")
implementation("io.coil-kt:coil-gif:$coilVersion")
implementation("io.coil-kt:coil-svg:$coilVersion")
// Logging
implementation("com.jakewharton.timber:timber:4.7.1")
// Sort
implementation("com.github.gpanther:java-nat-sort:natural-comparator-1.1")
// UI
implementation("com.dmitrymalkovich.android:material-design-dimens:1.4")
implementation("br.com.simplepass:loading-button-android:2.2.0")
val fastAdapterVersion = "5.6.0"
implementation("com.mikepenz:fastadapter:$fastAdapterVersion")
implementation("com.mikepenz:fastadapter-extensions-binding:$fastAdapterVersion")
implementation("com.github.arkon.FlexibleAdapter:flexible-adapter:c8013533")
implementation("com.github.arkon.FlexibleAdapter:flexible-adapter-ui:c8013533")
implementation("com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0")
implementation("com.github.mthli:Slice:v1.2")
implementation("io.noties.markwon:core:4.6.2")
implementation("com.github.chrisbanes:PhotoView:2.3.0")
implementation("com.github.tachiyomiorg:DirectionalViewPager:1.0.0")
implementation("com.github.florent37:viewtooltip:1.2.2")
implementation("com.getkeepsafe.taptargetview:taptargetview:1.13.3")
// Conductor
val conductorVersion = "3.0.0"
implementation("com.bluelinelabs:conductor:$conductorVersion")
implementation("com.github.tachiyomiorg:conductor-support-preference:$conductorVersion")
// Shizuku
val shizukuVersion = "12.1.0"
implementation("dev.rikka.shizuku:api:$shizukuVersion")
implementation("dev.rikka.shizuku:provider:$shizukuVersion")
implementation(kotlin("stdlib", org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION))
val coroutines = "1.5.1"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines")
// Text distance
implementation("info.debatty:java-string-similarity:2.0.0")
implementation("com.google.android.gms:play-services-oss-licenses:17.0.0")
// TLS 1.3 support for Android < 10
implementation("org.conscrypt:conscrypt-android:2.5.2")
// Android Chart
implementation("com.github.PhilJay:MPAndroidChart:v3.1.0")
}
tasks {
// See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers)
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
"-opt-in=kotlin.Experimental",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.InternalCoroutinesApi",
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
"-opt-in=coil.annotation.ExperimentalCoilApi",
)
}
// Duplicating Hebrew string assets due to some locale code issues on different devices
val copyHebrewStrings = task("copyHebrewStrings", type = Copy::class) {
from("./src/main/res/values-he")
into("./src/main/res/values-iw")
include("**/*")
}
preBuild {
dependsOn(formatKotlin, copyHebrewStrings)
}
}