Skip to content

Commit

Permalink
Merge pull request #5987 from vector-im/dependabot/gradle/org.jetbrai…
Browse files Browse the repository at this point in the history
…ns.kotlin-kotlin-gradle-plugin-1.6.21

Bump kotlin-gradle-plugin from 1.6.0 to 1.6.21
  • Loading branch information
bmarty authored May 10, 2022
2 parents eafe65b + a3b6bb3 commit 04cadb9
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions library/core-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ android {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn"
"-opt-in=kotlin.RequiresOptIn"
]
}
}

dependencies {
implementation libs.androidx.appCompat
implementation libs.jetbrains.coroutinesAndroid
}
}
3 changes: 3 additions & 0 deletions matrix-sdk-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ internal class DefaultTimeline(
}
}

@Suppress("EXPERIMENTAL_API_USAGE")
private fun listenToPostSnapshotSignals() {
postSnapshotSignalFlow
.sample(150)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>()
Expand Down Expand Up @@ -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()
Expand All @@ -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>()
Expand Down
8 changes: 4 additions & 4 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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?)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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?)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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?)

Expand Down
3 changes: 2 additions & 1 deletion vector/src/main/java/im/vector/app/features/pin/PinLocker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 04cadb9

Please sign in to comment.