2020-03-07 07:08:50 -05:00
|
|
|
import java.io.ByteArrayOutputStream
|
|
|
|
import java.time.LocalDateTime
|
|
|
|
import java.time.ZoneOffset
|
|
|
|
import java.time.format.DateTimeFormatter
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("com.android.application")
|
2020-04-30 21:33:02 -04:00
|
|
|
id("com.google.android.gms.oss-licenses-plugin")
|
2020-03-07 07:08:50 -05:00
|
|
|
kotlin("android")
|
|
|
|
kotlin("android.extensions")
|
|
|
|
kotlin("kapt")
|
2020-03-16 01:50:20 -04:00
|
|
|
id("org.jmailen.kotlinter") version "2.3.1"
|
2020-03-07 07:08:50 -05:00
|
|
|
id("com.github.zellius.shortcut-helper")
|
|
|
|
id("com.google.gms.google-services") apply false
|
|
|
|
}
|
|
|
|
|
|
|
|
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()
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion(29)
|
2020-04-30 02:23:39 -04:00
|
|
|
buildToolsVersion("29.0.3")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
|
|
|
defaultConfig {
|
2020-03-16 02:09:40 -04:00
|
|
|
minSdkVersion(23)
|
2020-03-07 07:08:50 -05:00
|
|
|
targetSdkVersion(29)
|
|
|
|
applicationId = "eu.kanade.tachiyomi"
|
2020-05-03 13:20:56 -04:00
|
|
|
versionCode = 63
|
|
|
|
versionName = "1.0.2"
|
2020-03-07 07:08:50 -05:00
|
|
|
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("armeabi-v7a", "arm64-v8a", "x86")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
getByName("debug") {
|
2020-03-29 00:08:09 -04:00
|
|
|
applicationIdSuffix = ".debugJ2K"
|
2020-03-07 07:08:50 -05:00
|
|
|
}
|
|
|
|
getByName("release") {
|
|
|
|
applicationIdSuffix = ".j2k"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
flavorDimensions("default")
|
|
|
|
|
|
|
|
productFlavors {
|
|
|
|
create("standard") {
|
|
|
|
buildConfigField("Boolean", "INCLUDE_UPDATER", "true")
|
|
|
|
}
|
|
|
|
create("dev") {
|
|
|
|
resConfig("en")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
isAbortOnError = false
|
|
|
|
isCheckReleaseBuilds = false
|
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
setSourceCompatibility(1.8)
|
|
|
|
setTargetCompatibility(1.8)
|
|
|
|
}
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "1.8"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
androidExtensions {
|
|
|
|
isExperimental = true
|
|
|
|
}
|
|
|
|
|
|
|
|
shortcutHelper {
|
|
|
|
setFilePath("./shortcuts.xml")
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2020-04-24 23:14:18 -04:00
|
|
|
// Modified dependencies
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.github.inorichi:subsampling-scale-image-view:ac0dae7")
|
|
|
|
implementation("com.github.inorichi:junrar-android:634c1f5")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Android support library
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("androidx.appcompat:appcompat:1.1.0")
|
|
|
|
implementation("androidx.cardview:cardview:1.0.0")
|
|
|
|
implementation("com.google.android.material:material:1.1.0")
|
|
|
|
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
2020-04-24 23:12:39 -04:00
|
|
|
implementation("androidx.preference:preference:1.1.1")
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("androidx.annotation:annotation:1.1.0")
|
|
|
|
implementation("androidx.browser:browser:1.2.0")
|
|
|
|
implementation("androidx.biometric:biometric:1.0.1")
|
|
|
|
implementation("androidx.palette:palette:1.0.0")
|
|
|
|
|
|
|
|
|
|
|
|
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
|
|
|
|
|
|
|
|
implementation("androidx.multidex:multidex:2.0.1")
|
|
|
|
|
2020-04-19 20:48:53 -04:00
|
|
|
implementation("com.google.firebase:firebase-core:17.3.0")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-03-16 01:50:20 -04:00
|
|
|
val lifecycleVersion = "2.1.0"
|
|
|
|
implementation("androidx.lifecycle:lifecycle-extensions:$lifecycleVersion")
|
|
|
|
implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// ReactiveX
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("io.reactivex:rxandroid:1.2.1")
|
|
|
|
implementation("io.reactivex:rxjava:1.3.8")
|
|
|
|
implementation("com.jakewharton.rxrelay:rxrelay:1.2.0")
|
|
|
|
implementation("com.f2prateek.rx.preferences:rx-preferences:1.0.2")
|
|
|
|
implementation("com.github.pwittchen:reactivenetwork:0.13.0")
|
|
|
|
|
2020-04-24 23:16:35 -04:00
|
|
|
// Coroutines
|
|
|
|
implementation("com.github.tfcporciuncula:flow-preferences:1.1.1")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Network client
|
2020-05-03 01:48:04 -04:00
|
|
|
val okhttpVersion = "4.5.0"
|
2020-03-16 01:50:20 -04:00
|
|
|
implementation("com.squareup.okhttp3:okhttp:$okhttpVersion")
|
|
|
|
implementation("com.squareup.okhttp3:logging-interceptor:$okhttpVersion")
|
2020-05-03 01:48:04 -04:00
|
|
|
implementation("com.squareup.okio:okio:2.6.0")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// REST
|
2020-03-16 01:50:20 -04:00
|
|
|
val retrofitVersion = "2.7.1"
|
|
|
|
implementation("com.squareup.retrofit2:retrofit:$retrofitVersion")
|
|
|
|
implementation("com.squareup.retrofit2:converter-gson:$retrofitVersion")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// JSON
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.google.code.gson:gson:2.8.6")
|
|
|
|
implementation("com.github.salomonbrys.kotson:kotson:2.5.0")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// JavaScript engine
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.squareup.duktape:duktape-android:1.3.0")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Disk
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.jakewharton:disklrucache:2.0.2")
|
|
|
|
implementation("com.github.inorichi:unifile:e9ee588")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// HTML parser
|
2020-04-06 23:52:15 -04:00
|
|
|
implementation("org.jsoup:jsoup:1.13.1")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Job scheduling
|
2020-04-21 13:48:35 -04:00
|
|
|
val workManagerVersion = "2.3.3"
|
|
|
|
implementation("android.arch.work:work-runtime:$workManagerVersion")
|
|
|
|
implementation("android.arch.work:work-runtime-ktx:$workManagerVersion")
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.google.android.gms:play-services-gcm:17.0.0")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Changelog
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.github.gabrielemariotti.changeloglib:changelog:2.1.0")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Database
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("androidx.sqlite:sqlite:2.1.0")
|
|
|
|
implementation("com.github.inorichi.storio:storio-common:8be19de@aar")
|
|
|
|
implementation("com.github.inorichi.storio:storio-sqlite:8be19de@aar")
|
|
|
|
implementation("io.requery:sqlite-android:3.31.0")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Model View Presenter
|
2020-03-16 01:50:20 -04:00
|
|
|
val nucleusVersion = "3.0.0"
|
|
|
|
implementation("info.android15.nucleus:nucleus:$nucleusVersion")
|
|
|
|
implementation("info.android15.nucleus:nucleus-support-v7:$nucleusVersion")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Dependency injection
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.github.inorichi.injekt:injekt-core:65b0440")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Image library
|
2020-03-16 01:50:20 -04:00
|
|
|
val glideVersion = "4.11.0"
|
|
|
|
implementation("com.github.bumptech.glide:glide:$glideVersion")
|
|
|
|
implementation("com.github.bumptech.glide:okhttp3-integration:$glideVersion")
|
|
|
|
kapt("com.github.bumptech.glide:compiler:$glideVersion")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Logging
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.jakewharton.timber:timber:4.7.1")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// UI
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.dmitrymalkovich.android:material-design-dimens:1.4")
|
|
|
|
implementation("com.github.dmytrodanylyk.android-process-button:library:1.0.4")
|
2020-04-14 23:56:50 -04:00
|
|
|
val latestFastAdapterRelease = "5.0.0"
|
|
|
|
implementation("com.mikepenz:fastadapter:${latestFastAdapterRelease}")
|
|
|
|
implementation("com.mikepenz:fastadapter-extensions-binding:${latestFastAdapterRelease}")
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("eu.davidea:flexible-adapter:5.1.0")
|
|
|
|
implementation("eu.davidea:flexible-adapter-ui:1.0.0")
|
|
|
|
implementation("com.nononsenseapps:filepicker:2.5.2")
|
2020-04-27 00:15:06 -04:00
|
|
|
implementation("com.afollestad.material-dialogs:core:3.1.1")
|
|
|
|
implementation("com.afollestad.material-dialogs:input:3.1.1")
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("me.zhanghai.android.systemuihelper:library:1.0.0")
|
|
|
|
implementation("com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0")
|
|
|
|
implementation("com.github.mthli:Slice:v1.2")
|
2020-04-04 16:48:15 -04:00
|
|
|
implementation("com.reddit:indicator-fast-scroll:1.2.1")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
|
|
|
implementation("com.github.kizitonwose:AndroidTagGroup:1.6.0")
|
|
|
|
implementation("com.github.chrisbanes:PhotoView:2.3.0")
|
|
|
|
implementation("com.github.carlosesco:DirectionalViewPager:a844dbca0a")
|
2020-04-25 00:47:01 -04:00
|
|
|
implementation("com.github.florent37:viewtooltip:1.2.2")
|
2020-04-29 00:16:06 -04:00
|
|
|
implementation("com.getkeepsafe.taptargetview:taptargetview:1.13.0")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Conductor
|
2020-03-07 07:08:50 -05:00
|
|
|
implementation("com.bluelinelabs:conductor:2.1.5")
|
|
|
|
implementation("com.bluelinelabs:conductor-support:2.1.5") {
|
|
|
|
exclude("group", "com.android.support")
|
|
|
|
}
|
|
|
|
implementation("com.github.inorichi:conductor-support-preference:a32c357")
|
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// RxBindings
|
2020-03-16 01:50:20 -04:00
|
|
|
val rxbindingsVersion = "1.0.1"
|
|
|
|
implementation("com.jakewharton.rxbinding:rxbinding-kotlin:$rxbindingsVersion")
|
|
|
|
implementation("com.jakewharton.rxbinding:rxbinding-appcompat-v7-kotlin:$rxbindingsVersion")
|
|
|
|
implementation("com.jakewharton.rxbinding:rxbinding-support-v4-kotlin:$rxbindingsVersion")
|
|
|
|
implementation("com.jakewharton.rxbinding:rxbinding-recyclerview-v7-kotlin:$rxbindingsVersion")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-04-24 23:14:18 -04:00
|
|
|
// Tests
|
2020-03-07 07:08:50 -05:00
|
|
|
testImplementation("junit:junit:4.13")
|
2020-03-16 01:50:20 -04:00
|
|
|
testImplementation("org.assertj:assertj-core:3.12.2")
|
2020-03-07 07:08:50 -05:00
|
|
|
testImplementation("org.mockito:mockito-core:1.10.19")
|
|
|
|
|
2020-03-16 01:50:20 -04:00
|
|
|
val robolectricVersion = "3.1.4"
|
|
|
|
testImplementation("org.robolectric:robolectric:$robolectricVersion")
|
|
|
|
testImplementation("org.robolectric:shadows-multidex:$robolectricVersion")
|
|
|
|
testImplementation("org.robolectric:shadows-play-services:$robolectricVersion")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
implementation(kotlin("stdlib", org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION))
|
|
|
|
|
2020-05-03 01:48:04 -04:00
|
|
|
val coroutinesVersion = "1.3.5"
|
2020-03-16 01:50:20 -04:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
|
2020-03-07 07:08:50 -05:00
|
|
|
|
|
|
|
//Crash reports
|
|
|
|
val acraVersion = "4.9.2"
|
|
|
|
implementation("ch.acra:acra:$acraVersion")
|
|
|
|
|
|
|
|
// Text distance
|
|
|
|
implementation("info.debatty:java-string-similarity:1.2.1")
|
2020-04-30 21:33:02 -04:00
|
|
|
|
|
|
|
implementation("com.google.android.gms:play-services-oss-licenses:17.0.0")
|
2020-03-07 07:08:50 -05:00
|
|
|
}
|
|
|
|
|
2020-03-16 01:50:20 -04:00
|
|
|
tasks.preBuild {
|
2020-03-07 07:08:50 -05:00
|
|
|
dependsOn(tasks.lintKotlin)
|
|
|
|
}
|
|
|
|
tasks.lintKotlin {
|
|
|
|
dependsOn(tasks.formatKotlin)
|
2020-03-16 01:50:20 -04:00
|
|
|
}
|
2020-03-07 07:08:50 -05:00
|
|
|
|
2020-03-16 01:50:20 -04:00
|
|
|
if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
|
2020-03-07 07:08:50 -05:00
|
|
|
apply(mapOf("plugin" to "com.google.gms.google-services"))
|
|
|
|
}
|