Merge pull request #5987 from vector-im/dependabot/gradle/org.jetbrains.kotlin-kotlin-gradle-plugin-1.6.21

Bump kotlin-gradle-plugin from 1.6.0 to 1.6.21
This commit is contained in:
Benoit Marty 2022-05-10 18:23:51 +02:00 committed by GitHub
commit 04cadb94cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 36 additions and 16 deletions

View file

@ -9,7 +9,7 @@ ext.versions = [
def gradle = "7.2.0"
// Ref: https://kotlinlang.org/releases.html
def kotlin = "1.6.0"
def kotlin = "1.6.21"
def kotlinCoroutines = "1.6.0"
def dagger = "2.42"
def retrofit = "2.9.0"

View file

@ -44,7 +44,7 @@ android {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn"
"-opt-in=kotlin.RequiresOptIn"
]
}
}

View file

@ -101,6 +101,9 @@ android {
freeCompilerArgs += [
// Disabled for now, there are too many errors. Could be handled in another dedicated PR
// '-Xexplicit-api=strict', // or warning
"-opt-in=kotlin.RequiresOptIn",
// Opt in for kotlinx.coroutines.FlowPreview
"-opt-in=kotlinx.coroutines.FlowPreview",
]
}

View file

@ -33,7 +33,7 @@ internal interface CheckNumberType {
companion object {
val JSON_ADAPTER_FACTORY = object : JsonAdapter.Factory {
@Nullable
override fun create(type: Type, annotations: Set<Annotation?>?, moshi: Moshi): JsonAdapter<*>? {
override fun create(type: Type, annotations: Set<Annotation>, moshi: Moshi): JsonAdapter<*>? {
if (type !== Any::class.java) {
return null
}

View file

@ -291,7 +291,6 @@ internal class DefaultTimeline(
}
}
@Suppress("EXPERIMENTAL_API_USAGE")
private fun listenToPostSnapshotSignals() {
postSnapshotSignalFlow
.sample(150)

View file

@ -16,6 +16,8 @@
package org.matrix.android.sdk.internal.task
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.asCoroutineDispatcher
import kotlinx.coroutines.delay
@ -31,8 +33,8 @@ class CoroutineSequencersTest : MatrixTest {
private val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher()
@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
@Test
@Suppress("EXPERIMENTAL_API_USAGE")
fun sequencer_should_run_sequential() {
val sequencer = SemaphoreCoroutineSequencer()
val results = ArrayList<String>()
@ -60,8 +62,8 @@ class CoroutineSequencersTest : MatrixTest {
assertEquals(results[2], "#3")
}
@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
@Test
@Suppress("EXPERIMENTAL_API_USAGE")
fun sequencer_should_run_parallel() {
val sequencer1 = SemaphoreCoroutineSequencer()
val sequencer2 = SemaphoreCoroutineSequencer()
@ -87,8 +89,8 @@ class CoroutineSequencersTest : MatrixTest {
assertEquals(3, results.size)
}
@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
@Test
@Suppress("EXPERIMENTAL_API_USAGE")
fun sequencer_should_jump_to_next_when_current_job_canceled() {
val sequencer = SemaphoreCoroutineSequencer()
val results = ArrayList<String>()

View file

@ -297,14 +297,14 @@ android {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.RequiresOptIn",
// Fixes false positive "This is an internal Mavericks API. It is not intended for external use."
// of MvRx `by viewModel()` calls. Maybe due to the inlining of code... This is a temporary fix...
"-Xopt-in=com.airbnb.mvrx.InternalMavericksApi",
"-opt-in=com.airbnb.mvrx.InternalMavericksApi",
// Opt in for kotlinx.coroutines.FlowPreview too
"-Xopt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=kotlinx.coroutines.FlowPreview",
// Opt in for kotlinx.coroutines.ExperimentalCoroutinesApi too
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
]
}

View file

@ -19,6 +19,7 @@ package im.vector.app
import android.net.Uri
import androidx.lifecycle.Observer
import im.vector.app.ui.robot.OnboardingRobot
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
@ -107,7 +108,7 @@ abstract class VerificationTestBase {
return result!!
}
@Suppress("EXPERIMENTAL_API_USAGE")
@OptIn(DelicateCoroutinesApi::class)
private fun syncSession(session: Session) {
val lock = CountDownLatch(1)

View file

@ -50,6 +50,7 @@ import im.vector.app.features.settings.VectorPreferences
import im.vector.app.features.ui.SharedPreferencesUiStateRepository
import im.vector.app.features.ui.UiStateRepository
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.SupervisorJob
@ -173,7 +174,7 @@ object VectorStaticModule {
return CoroutineDispatchers(io = Dispatchers.IO, computation = Dispatchers.Default)
}
@Suppress("EXPERIMENTAL_API_USAGE")
@OptIn(DelicateCoroutinesApi::class)
@Provides
@NamedGlobalScope
fun providesGlobalScope(): CoroutineScope {

View file

@ -157,12 +157,14 @@ class LoginCaptchaFragment @Inject constructor(
}
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
@Suppress("DEPRECATION")
super.onReceivedError(view, errorCode, description, failingUrl)
onError(description)
}
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (url?.startsWith("js:") == true) {
var json = url.substring(3)

View file

@ -141,6 +141,7 @@ class LoginWebFragment @Inject constructor(
.show()
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
super.onReceivedError(view, errorCode, description, failingUrl)
@ -193,6 +194,7 @@ class LoginWebFragment @Inject constructor(
* @param url
* @return
*/
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
if (url == null) return super.shouldOverrideUrlLoading(view, url as String?)

View file

@ -152,12 +152,14 @@ class LoginCaptchaFragment2 @Inject constructor(
}
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
@Suppress("DEPRECATION")
super.onReceivedError(view, errorCode, description, failingUrl)
onError(description)
}
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (url?.startsWith("js:") == true) {
var json = url.substring(3)

View file

@ -142,6 +142,7 @@ class LoginWebFragment2 @Inject constructor(
.show()
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
super.onReceivedError(view, errorCode, description, failingUrl)
@ -194,6 +195,7 @@ class LoginWebFragment2 @Inject constructor(
* @param url
* @return
*/
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
if (url == null) return super.shouldOverrideUrlLoading(view, url as String?)

View file

@ -103,12 +103,14 @@ class CaptchaWebview @Inject constructor(
}
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
@Suppress("DEPRECATION")
super.onReceivedError(view, errorCode, description, failingUrl)
onError(description)
}
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (url?.startsWith("js:") == true) {
val javascriptResponse = parseJsonFromUrl(url)

View file

@ -138,6 +138,7 @@ class FtueAuthWebFragment @Inject constructor(
.show()
}
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
super.onReceivedError(view, errorCode, description, failingUrl)
@ -190,6 +191,7 @@ class FtueAuthWebFragment @Inject constructor(
* @param url
* @return
*/
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
if (url == null) return super.shouldOverrideUrlLoading(view, url as String?)

View file

@ -22,6 +22,7 @@ import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import im.vector.app.features.settings.VectorPreferences
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import timber.log.Timber
@ -59,7 +60,7 @@ class PinLocker @Inject constructor(
return liveState
}
@Suppress("EXPERIMENTAL_API_USAGE")
@OptIn(DelicateCoroutinesApi::class)
private fun computeState() {
GlobalScope.launch {
val state = if (shouldBeLocked && pinCodeStore.hasEncodedPin()) {

View file

@ -19,6 +19,7 @@ package im.vector.app.features.rageshake
import android.content.Context
import android.util.Log
import im.vector.app.features.settings.VectorPreferences
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
@ -88,7 +89,7 @@ class VectorFileLogger @Inject constructor(
}
}
@Suppress("EXPERIMENTAL_API_USAGE")
@OptIn(DelicateCoroutinesApi::class)
override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
fileHandler ?: return
GlobalScope.launch(Dispatchers.IO) {