From b4b9d91ea6f706efe6bb007b4989e7c4f29b7e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Borcz?= Date: Wed, 25 Aug 2021 20:49:44 +0200 Subject: [PATCH] Update dependencies (#1448) --- app/build.gradle | 18 +++++------------- app/jacoco.gradle | 6 +++--- .../alarm/TimetableNotificationReceiver.kt | 4 ++-- .../wulkanowy/ui/modules/main/MainActivity.kt | 4 ++-- .../message/send/SendMessageActivity.kt | 4 +--- .../message/send/SendMessagePresenter.kt | 2 -- .../modules/message/tab/MessageTabFragment.kt | 2 -- .../modules/message/tab/MessageTabPresenter.kt | 3 +-- .../timetablewidget/TimetableWidgetProvider.kt | 2 ++ build.gradle | 2 +- gradle.properties | 8 +++++--- 11 files changed, 22 insertions(+), 33 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 409e6c4d1..d5fccac6f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,11 +3,11 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-parcelize' apply plugin: 'kotlin-kapt' apply plugin: 'dagger.hilt.android.plugin' +apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' apply plugin: 'com.github.triplet.play' apply plugin: 'ru.cian.huawei-publish' apply plugin: 'com.mikepenz.aboutlibraries.plugin' -apply plugin: 'com.google.gms.google-services' apply plugin: 'com.huawei.agconnect' apply from: 'jacoco.gradle' apply from: 'sonarqube.gradle' @@ -15,7 +15,6 @@ apply from: 'hooks.gradle' android { compileSdkVersion 30 - buildToolsVersion '30.0.3' defaultConfig { applicationId "io.github.wulkanowy" @@ -98,7 +97,7 @@ android { } buildFeatures { - viewBinding = true + viewBinding true } testOptions.unitTests { @@ -107,12 +106,12 @@ android { compileOptions { coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "11" freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn", "-Xjvm-default=all"] } @@ -128,12 +127,6 @@ android { kapt { correctErrorTypes true - - javacOptions { - //Bug workaround https://youtrack.jetbrains.com/issue/KT-47416 - option("-Adagger.fastInit=ENABLED") - option("-Adagger.hilt.android.internal.disableAndroidSuperclassValidation=true") - } } play { @@ -168,7 +161,6 @@ dependencies { coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1" implementation "androidx.core:core-ktx:1.6.0" diff --git a/app/jacoco.gradle b/app/jacoco.gradle index 9c1f5b1c2..f253673e6 100644 --- a/app/jacoco.gradle +++ b/app/jacoco.gradle @@ -2,7 +2,7 @@ apply plugin: "jacoco" jacoco { toolVersion "0.8.7" - reportsDirectory = file("$buildDir/reports") + reportsDirectory.set(file("$buildDir/reports")) } tasks.withType(Test) { @@ -16,8 +16,8 @@ task jacocoTestReport(type: JacocoReport) { description = "Generate Jacoco coverage reports" reports { - xml.enabled = true - html.enabled = true + xml.required.set(true) + html.required.set(true) } def excludes = ['**/R.class', diff --git a/app/src/main/java/io/github/wulkanowy/services/alarm/TimetableNotificationReceiver.kt b/app/src/main/java/io/github/wulkanowy/services/alarm/TimetableNotificationReceiver.kt index 8eefc032f..406d91f5f 100644 --- a/app/src/main/java/io/github/wulkanowy/services/alarm/TimetableNotificationReceiver.kt +++ b/app/src/main/java/io/github/wulkanowy/services/alarm/TimetableNotificationReceiver.kt @@ -1,6 +1,5 @@ package io.github.wulkanowy.services.alarm -import android.annotation.SuppressLint import android.app.PendingIntent import android.app.PendingIntent.FLAG_UPDATE_CURRENT import android.content.Context @@ -20,6 +19,7 @@ import io.github.wulkanowy.ui.modules.main.MainView import io.github.wulkanowy.utils.flowWithResource import io.github.wulkanowy.utils.getCompatColor import io.github.wulkanowy.utils.toLocalDateTime +import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach @@ -50,7 +50,7 @@ class TimetableNotificationReceiver : HiltBroadcastReceiver() { const val LESSON_END = "end_timestamp" } - @SuppressLint("CheckResult") + @OptIn(DelicateCoroutinesApi::class) override fun onReceive(context: Context, intent: Intent) { super.onReceive(context, intent) Timber.d("Receiving intent... ${intent.toUri(0)}") diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainActivity.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainActivity.kt index 188cf5fc9..b44bb4b21 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainActivity.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/main/MainActivity.kt @@ -230,8 +230,8 @@ class MainActivity : BaseActivity(), MainVie .setIcon(R.drawable.ic_main_more) } selectedItemId = startMenuIndex - setOnNavigationItemSelectedListener { presenter.onTabSelected(it.itemId, false) } - setOnNavigationItemReselectedListener { presenter.onTabSelected(it.itemId, true) } + setOnItemSelectedListener { presenter.onTabSelected(it.itemId, false) } + setOnItemReselectedListener { presenter.onTabSelected(it.itemId, true) } } with(navController) { diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/message/send/SendMessageActivity.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/message/send/SendMessageActivity.kt index f169de9fd..d49c9b833 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/message/send/SendMessageActivity.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/message/send/SendMessageActivity.kt @@ -23,8 +23,6 @@ import io.github.wulkanowy.ui.base.BaseActivity import io.github.wulkanowy.utils.dpToPx import io.github.wulkanowy.utils.hideSoftInput import io.github.wulkanowy.utils.showSoftInput -import kotlinx.coroutines.FlowPreview -import timber.log.Timber import javax.inject.Inject @AndroidEntryPoint @@ -67,7 +65,6 @@ class SendMessageActivity : BaseActivity presenter.clearDraft() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/message/send/SendMessagePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/message/send/SendMessagePresenter.kt index b1cf3b642..f61542187 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/message/send/SendMessagePresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/message/send/SendMessagePresenter.kt @@ -1,6 +1,5 @@ package io.github.wulkanowy.ui.modules.message.send -import io.github.wulkanowy.R import io.github.wulkanowy.data.Status import io.github.wulkanowy.data.db.entities.Message import io.github.wulkanowy.data.db.entities.Recipient @@ -41,7 +40,6 @@ class SendMessagePresenter @Inject constructor( private val messageUpdateChannel = Channel() - @FlowPreview fun onAttachView(view: SendMessageView, message: Message?, reply: Boolean?) { super.onAttachView(view) view.initView() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabFragment.kt index dfd95b721..54ee74eb1 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabFragment.kt @@ -21,7 +21,6 @@ import io.github.wulkanowy.ui.modules.message.MessageFragment import io.github.wulkanowy.ui.modules.message.preview.MessagePreviewFragment import io.github.wulkanowy.ui.widgets.DividerItemDecoration import io.github.wulkanowy.utils.getThemeAttrColor -import kotlinx.coroutines.FlowPreview import javax.inject.Inject @AndroidEntryPoint @@ -58,7 +57,6 @@ class MessageTabFragment : BaseFragment(R.layout.frag setHasOptionsMenu(true) } - @FlowPreview override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) binding = FragmentMessageTabBinding.bind(view) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt index 93c7408f6..3e5e09b48 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt @@ -44,7 +44,6 @@ class MessageTabPresenter @Inject constructor( private val searchChannel = Channel() - @FlowPreview fun onAttachView(view: MessageTabView, folder: MessageFolder) { super.onAttachView(view) view.initView() @@ -178,7 +177,7 @@ class MessageTabPresenter @Inject constructor( } } - @FlowPreview + @OptIn(FlowPreview::class) private fun initializeSearchStream() { launch { searchChannel.consumeAsFlow() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetablewidget/TimetableWidgetProvider.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetablewidget/TimetableWidgetProvider.kt index 733eb17fc..f9079b5f9 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetablewidget/TimetableWidgetProvider.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetablewidget/TimetableWidgetProvider.kt @@ -35,6 +35,7 @@ import io.github.wulkanowy.utils.nextSchoolDay import io.github.wulkanowy.utils.nickOrName import io.github.wulkanowy.utils.previousSchoolDay import io.github.wulkanowy.utils.toFormattedString +import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import timber.log.Timber @@ -81,6 +82,7 @@ class TimetableWidgetProvider : HiltBroadcastReceiver() { "timetable_widget_current_theme_$appWidgetId" } + @OptIn(DelicateCoroutinesApi::class) override fun onReceive(context: Context, intent: Intent) { super.onReceive(context, intent) GlobalScope.launch { diff --git a/build.gradle b/build.gradle index d169291d6..afe0285c8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - kotlin_version = '1.5.21' + kotlin_version = '1.5.30' about_libraries = '8.9.1' hilt_version = "2.38.1" } diff --git a/gradle.properties b/gradle.properties index 998e31957..38603830b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,17 +4,19 @@ # any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html - +# # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx1536m +# android.enableJetifier=true android.useAndroidX=true +# kotlin.code.style=official -kapt.incremental.apt=true +# kapt.use.worker.api=true kapt.include.compile.classpath=false - +# # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects