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" def gradle = "7.2.0"
// Ref: https://kotlinlang.org/releases.html // Ref: https://kotlinlang.org/releases.html
def kotlin = "1.6.0" def kotlin = "1.6.21"
def kotlinCoroutines = "1.6.0" def kotlinCoroutines = "1.6.0"
def dagger = "2.42" def dagger = "2.42"
def retrofit = "2.9.0" def retrofit = "2.9.0"

View File

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

View File

@ -101,6 +101,9 @@ android {
freeCompilerArgs += [ freeCompilerArgs += [
// Disabled for now, there are too many errors. Could be handled in another dedicated PR // Disabled for now, there are too many errors. Could be handled in another dedicated PR
// '-Xexplicit-api=strict', // or warning // '-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 { companion object {
val JSON_ADAPTER_FACTORY = object : JsonAdapter.Factory { val JSON_ADAPTER_FACTORY = object : JsonAdapter.Factory {
@Nullable @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) { if (type !== Any::class.java) {
return null return null
} }

View File

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

View File

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

View File

@ -297,14 +297,14 @@ android {
kotlinOptions { kotlinOptions {
jvmTarget = "11" jvmTarget = "11"
freeCompilerArgs += [ 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." // 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... // 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 // Opt in for kotlinx.coroutines.FlowPreview too
"-Xopt-in=kotlinx.coroutines.FlowPreview", "-opt-in=kotlinx.coroutines.FlowPreview",
// Opt in for kotlinx.coroutines.ExperimentalCoroutinesApi too // 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 android.net.Uri
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import im.vector.app.ui.robot.OnboardingRobot import im.vector.app.ui.robot.OnboardingRobot
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -107,7 +108,7 @@ abstract class VerificationTestBase {
return result!! return result!!
} }
@Suppress("EXPERIMENTAL_API_USAGE") @OptIn(DelicateCoroutinesApi::class)
private fun syncSession(session: Session) { private fun syncSession(session: Session) {
val lock = CountDownLatch(1) 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.SharedPreferencesUiStateRepository
import im.vector.app.features.ui.UiStateRepository import im.vector.app.features.ui.UiStateRepository
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.SupervisorJob
@ -173,7 +174,7 @@ object VectorStaticModule {
return CoroutineDispatchers(io = Dispatchers.IO, computation = Dispatchers.Default) return CoroutineDispatchers(io = Dispatchers.IO, computation = Dispatchers.Default)
} }
@Suppress("EXPERIMENTAL_API_USAGE") @OptIn(DelicateCoroutinesApi::class)
@Provides @Provides
@NamedGlobalScope @NamedGlobalScope
fun providesGlobalScope(): CoroutineScope { 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) { override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
super.onReceivedError(view, errorCode, description, failingUrl) super.onReceivedError(view, errorCode, description, failingUrl)
onError(description) onError(description)
} }
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean { override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (url?.startsWith("js:") == true) { if (url?.startsWith("js:") == true) {
var json = url.substring(3) var json = url.substring(3)

View File

@ -141,6 +141,7 @@ class LoginWebFragment @Inject constructor(
.show() .show()
} }
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) { override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
super.onReceivedError(view, errorCode, description, failingUrl) super.onReceivedError(view, errorCode, description, failingUrl)
@ -193,6 +194,7 @@ class LoginWebFragment @Inject constructor(
* @param url * @param url
* @return * @return
*/ */
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean { override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
if (url == null) return super.shouldOverrideUrlLoading(view, url as String?) 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) { override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
super.onReceivedError(view, errorCode, description, failingUrl) super.onReceivedError(view, errorCode, description, failingUrl)
onError(description) onError(description)
} }
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean { override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (url?.startsWith("js:") == true) { if (url?.startsWith("js:") == true) {
var json = url.substring(3) var json = url.substring(3)

View File

@ -142,6 +142,7 @@ class LoginWebFragment2 @Inject constructor(
.show() .show()
} }
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) { override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
super.onReceivedError(view, errorCode, description, failingUrl) super.onReceivedError(view, errorCode, description, failingUrl)
@ -194,6 +195,7 @@ class LoginWebFragment2 @Inject constructor(
* @param url * @param url
* @return * @return
*/ */
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean { override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
if (url == null) return super.shouldOverrideUrlLoading(view, url as String?) 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) { override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
super.onReceivedError(view, errorCode, description, failingUrl) super.onReceivedError(view, errorCode, description, failingUrl)
onError(description) onError(description)
} }
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean { override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (url?.startsWith("js:") == true) { if (url?.startsWith("js:") == true) {
val javascriptResponse = parseJsonFromUrl(url) val javascriptResponse = parseJsonFromUrl(url)

View File

@ -138,6 +138,7 @@ class FtueAuthWebFragment @Inject constructor(
.show() .show()
} }
@Deprecated("Deprecated in Java")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) { override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
super.onReceivedError(view, errorCode, description, failingUrl) super.onReceivedError(view, errorCode, description, failingUrl)
@ -190,6 +191,7 @@ class FtueAuthWebFragment @Inject constructor(
* @param url * @param url
* @return * @return
*/ */
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean { override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
if (url == null) return super.shouldOverrideUrlLoading(view, url as String?) 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.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import im.vector.app.features.settings.VectorPreferences import im.vector.app.features.settings.VectorPreferences
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import timber.log.Timber import timber.log.Timber
@ -59,7 +60,7 @@ class PinLocker @Inject constructor(
return liveState return liveState
} }
@Suppress("EXPERIMENTAL_API_USAGE") @OptIn(DelicateCoroutinesApi::class)
private fun computeState() { private fun computeState() {
GlobalScope.launch { GlobalScope.launch {
val state = if (shouldBeLocked && pinCodeStore.hasEncodedPin()) { val state = if (shouldBeLocked && pinCodeStore.hasEncodedPin()) {

View File

@ -19,6 +19,7 @@ package im.vector.app.features.rageshake
import android.content.Context import android.content.Context
import android.util.Log import android.util.Log
import im.vector.app.features.settings.VectorPreferences import im.vector.app.features.settings.VectorPreferences
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch 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?) { override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
fileHandler ?: return fileHandler ?: return
GlobalScope.launch(Dispatchers.IO) { GlobalScope.launch(Dispatchers.IO) {