mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
310 lines
No EOL
11 KiB
Kotlin
310 lines
No EOL
11 KiB
Kotlin
import java.io.ByteArrayOutputStream
|
|
import java.time.LocalDateTime
|
|
import java.time.ZoneOffset
|
|
import java.time.format.DateTimeFormatter
|
|
|
|
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
|
|
}
|
|
|
|
if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
|
apply<com.google.gms.googleservices.GoogleServicesPlugin>()
|
|
}
|
|
|
|
fun getBuildTime() = DateTimeFormatter.ISO_DATE_TIME.format(LocalDateTime.now(ZoneOffset.UTC))
|
|
fun getCommitCount() = runCommand("git rev-list --count HEAD")
|
|
fun getGitSha() = runCommand("git rev-parse --short HEAD")
|
|
|
|
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")
|
|
|
|
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", "COMMIT_SHA", "\"${getGitSha()}\"")
|
|
buildConfigField("String", "BUILD_TIME", "\"${getBuildTime()}\"")
|
|
buildConfigField("Boolean", "INCLUDE_UPDATER", "false")
|
|
|
|
ndk {
|
|
abiFilters += supportedAbis
|
|
}
|
|
packagingOptions {
|
|
jniLibs.excludes.addAll(
|
|
listOf(
|
|
"**/libjxl.so",
|
|
"**/libjxl_dec.so",
|
|
"**/libjxl_threads.so",
|
|
)
|
|
)
|
|
}
|
|
externalNativeBuild {
|
|
cmake {
|
|
this.arguments("-DHAVE_LIBJXL=FALSE")
|
|
}
|
|
}
|
|
}
|
|
|
|
splits {
|
|
abi {
|
|
isEnable = true
|
|
reset()
|
|
include(*supportedAbis.toTypedArray())
|
|
isUniversalApk = true
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
getByName("debug") {
|
|
applicationIdSuffix = ".debugJ2K"
|
|
}
|
|
getByName("release") {
|
|
applicationIdSuffix = ".j2k"
|
|
isShrinkResources = true
|
|
isMinifyEnabled = true
|
|
proguardFiles("proguard-android-optimize.txt", "proguard-rules.pro")
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding = true
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = "1.8"
|
|
}
|
|
namespace = "eu.kanade.tachiyomi"
|
|
}
|
|
|
|
dependencies {
|
|
// Modified dependencies
|
|
implementation("com.github.jays2kings:subsampling-scale-image-view:756849e") {
|
|
exclude(module = "image-decoder")
|
|
}
|
|
implementation("com.github.tachiyomiorg:image-decoder:7481a4a")
|
|
|
|
// Source models and interfaces from Tachiyomi 1.x
|
|
implementation("tachiyomi.sourceapi:source-api:1.1")
|
|
|
|
// Android X libraries
|
|
implementation("androidx.appcompat:appcompat:1.6.0-alpha03")
|
|
implementation("androidx.cardview:cardview:1.0.0")
|
|
implementation("com.google.android.material:material:1.6.0")
|
|
implementation("androidx.webkit:webkit:1.4.0")
|
|
implementation("androidx.recyclerview:recyclerview:1.2.1")
|
|
implementation("androidx.preference:preference:1.2.0")
|
|
implementation("androidx.annotation:annotation:1.3.0")
|
|
implementation("androidx.browser:browser:1.4.0")
|
|
implementation("androidx.biometric:biometric:1.1.0")
|
|
implementation("androidx.palette:palette:1.0.0")
|
|
implementation("androidx.core:core-ktx:1.7.0")
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0-rc01")
|
|
|
|
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
|
|
|
|
implementation("androidx.multidex:multidex:2.0.1")
|
|
|
|
implementation("com.google.firebase:firebase-core:20.1.2")
|
|
implementation("com.google.firebase:firebase-analytics-ktx:20.1.2")
|
|
|
|
val lifecycleVersion = "2.4.0-rc01"
|
|
kapt("androidx.lifecycle:lifecycle-compiler:$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")
|
|
implementation("com.github.pwittchen:reactivenetwork:0.13.0")
|
|
|
|
// Coroutines
|
|
implementation("com.fredporciuncula:flow-preferences:1.6.0")
|
|
|
|
// Network client
|
|
val okhttpVersion = "4.9.3"
|
|
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.0.0")
|
|
|
|
// Chucker
|
|
val chuckerVersion = "3.5.2"
|
|
debugImplementation("com.github.ChuckerTeam.Chucker:library:$chuckerVersion")
|
|
releaseImplementation("com.github.ChuckerTeam.Chucker:library-no-op:$chuckerVersion")
|
|
|
|
implementation(kotlin("reflect", version = AndroidVersions.kotlin))
|
|
|
|
// JSON
|
|
val kotlinSerialization = "1.3.2"
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${kotlinSerialization}")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:${kotlinSerialization}")
|
|
|
|
// JavaScript engine
|
|
implementation("app.cash.quickjs:quickjs-android:0.9.2")
|
|
// TODO: remove Duktape once all extensions are using QuickJS
|
|
implementation("com.squareup.duktape:duktape-android:1.4.0")
|
|
|
|
// Disk
|
|
implementation("com.jakewharton:disklrucache:2.0.2")
|
|
implementation("com.github.tachiyomiorg:unifile:17bec43")
|
|
implementation("com.github.junrar:junrar:7.5.0")
|
|
|
|
// HTML parser
|
|
implementation("org.jsoup:jsoup:1.14.3")
|
|
|
|
// Job scheduling
|
|
implementation("androidx.work:work-runtime-ktx:2.6.0")
|
|
implementation("com.google.guava:guava:31.1-android")
|
|
|
|
implementation("com.google.android.gms:play-services-gcm:17.0.0")
|
|
|
|
// Changelog
|
|
implementation("com.github.gabrielemariotti.changeloglib:changelog:2.1.0")
|
|
|
|
// Database
|
|
implementation("androidx.sqlite:sqlite-ktx:2.2.0")
|
|
implementation("com.github.requery:sqlite-android:3.36.0")
|
|
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.0.0-rc03"
|
|
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.nononsenseapps:filepicker:2.5.2")
|
|
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")
|
|
|
|
// Crash reports
|
|
implementation("ch.acra:acra-http:5.9.3")
|
|
|
|
// 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")
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
}
|
|
} |