Upgrade Kotlin (to 1.3), Coroutines, Gradle and Android gradle plugin.

Kotlin:                1.2.71 -> 1.3.50
Coroutines:            0.30.2 -> 1.3.1
Gradle:                4.6    -> 5.4.1
Android gradle plugin: 3.2.1  -> 3.5.0

This brings us down to *one* experimental coroutine API, and we've
opted in to using it in just *one* place.

(The fact that the API to opt-in to using an experimental API in a
specific place is *also* experimental surely will not come back to
bite us later.)
This commit is contained in:
Samuel Bronson 2019-09-18 22:45:54 -04:00
parent fa59b4f8a7
commit 9276c491bc
8 changed files with 18 additions and 21 deletions

View file

@ -228,14 +228,12 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
final coroutines_version = '0.30.2' final coroutines_version = '1.3.1'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version" // TODO: hack!
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
} }
buildscript { buildscript {
ext.kotlin_version = '1.2.71' ext.kotlin_version = '1.3.50'
repositories { repositories {
mavenCentral() mavenCentral()
} }
@ -248,10 +246,9 @@ repositories {
mavenCentral() mavenCentral()
} }
kotlin { // See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api-markers
experimental { tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all {
coroutines 'enable' kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlin.Experimental"]
}
} }
androidExtensions { androidExtensions {

View file

@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.source.online.fetchAllImageUrlsFromPageList import eu.kanade.tachiyomi.source.online.fetchAllImageUrlsFromPageList
import eu.kanade.tachiyomi.util.* import eu.kanade.tachiyomi.util.*
import kotlinx.coroutines.experimental.async import kotlinx.coroutines.async
import okhttp3.Response import okhttp3.Response
import rx.Observable import rx.Observable
import rx.android.schedulers.AndroidSchedulers import rx.android.schedulers.AndroidSchedulers

View file

@ -13,7 +13,7 @@ import eu.kanade.tachiyomi.extension.util.ExtensionInstaller
import eu.kanade.tachiyomi.extension.util.ExtensionLoader import eu.kanade.tachiyomi.extension.util.ExtensionLoader
import eu.kanade.tachiyomi.source.SourceManager import eu.kanade.tachiyomi.source.SourceManager
import eu.kanade.tachiyomi.util.launchNow import eu.kanade.tachiyomi.util.launchNow
import kotlinx.coroutines.experimental.async import kotlinx.coroutines.async
import rx.Observable import rx.Observable
import rx.android.schedulers.AndroidSchedulers import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers import rx.schedulers.Schedulers

View file

@ -7,10 +7,10 @@ import android.content.IntentFilter
import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.extension.model.LoadResult import eu.kanade.tachiyomi.extension.model.LoadResult
import eu.kanade.tachiyomi.util.launchNow import eu.kanade.tachiyomi.util.launchNow
import kotlinx.coroutines.experimental.CoroutineStart import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.experimental.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.experimental.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.experimental.async import kotlinx.coroutines.async
/** /**
* Broadcast receiver that listens for the system's packages installed, updated or removed, and only * Broadcast receiver that listens for the system's packages installed, updated or removed, and only

View file

@ -13,8 +13,8 @@ import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.util.Hash import eu.kanade.tachiyomi.util.Hash
import kotlinx.coroutines.experimental.async import kotlinx.coroutines.async
import kotlinx.coroutines.experimental.runBlocking import kotlinx.coroutines.runBlocking
import timber.log.Timber import timber.log.Timber
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get

View file

@ -1,10 +1,10 @@
package eu.kanade.tachiyomi.util package eu.kanade.tachiyomi.util
import kotlinx.coroutines.experimental.* import kotlinx.coroutines.*
import kotlinx.coroutines.experimental.android.Main
fun launchUI(block: suspend CoroutineScope.() -> Unit): Job = fun launchUI(block: suspend CoroutineScope.() -> Unit): Job =
GlobalScope.launch(Dispatchers.Main, CoroutineStart.DEFAULT, block) GlobalScope.launch(Dispatchers.Main, CoroutineStart.DEFAULT, block)
@UseExperimental(ExperimentalCoroutinesApi::class)
fun launchNow(block: suspend CoroutineScope.() -> Unit): Job = fun launchNow(block: suspend CoroutineScope.() -> Unit): Job =
GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED, block) GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED, block)

View file

@ -7,7 +7,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0' classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath 'com.github.zellius:android-shortcut-gradle-plugin:0.1.2' classpath 'com.github.zellius:android-shortcut-gradle-plugin:0.1.2'
classpath 'com.google.gms:google-services:3.2.0' classpath 'com.google.gms:google-services:3.2.0'

View file

@ -1,6 +1,6 @@
#Tue Sep 25 08:47:56 CEST 2018 #Wed Sep 18 21:00:59 EDT 2019
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip