From 700363f5f00d16638397a770c47c1dc512e62d08 Mon Sep 17 00:00:00 2001 From: Bojan Date: Wed, 29 Dec 2021 12:20:28 +0100 Subject: [PATCH 1/2] * Fix implicit Kotlin 1.6 changes on static show methods. * Prepare 5.4.3 release. --- CHANGELOG.md | 6 ++++++ config.gradle | 4 ++-- .../src/main/kotlin/com/infinum/dbinspector/DbInspector.kt | 4 ++-- .../src/main/kotlin/com/infinum/dbinspector/DbInspector.kt | 3 ++- .../main/kotlin/com/infinum/dbinspector/ui/Presentation.kt | 4 ++-- gradle/libs.versions.toml | 2 +- .../kotlin/com/infinum/dbinspector/sample/MainActivity.kt | 3 +-- 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db821fc0..e0b6b62a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========= +## Version 5.4.3 + +_2021-12-29_ + +* Fix implicit Kotlin 1.6 changes on static show methods. + ## Version 5.4.2 _2021-12-24_ diff --git a/config.gradle b/config.gradle index c13e7474..8ee4a5f2 100644 --- a/config.gradle +++ b/config.gradle @@ -7,7 +7,7 @@ ext { ] releaseConfig = [ "group" : "com.infinum.dbinspector", - "version" : "5.4.2", - "versionCode": 5 * 100 * 100 + 4 * 100 + 2 + "version" : "5.4.3", + "versionCode": 5 * 100 * 100 + 4 * 100 + 3 ] } \ No newline at end of file diff --git a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt index 2306933a..8c2d0c20 100644 --- a/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt +++ b/dbinspector-no-op/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt @@ -2,12 +2,12 @@ package com.infinum.dbinspector -import com.infinum.dbinspector.data.sources.memory.logger.EmptyLogger import com.infinum.dbinspector.data.sources.memory.logger.Logger @Suppress("UnusedPrivateMember") public object DbInspector { @JvmStatic - public fun show(logger: Logger = EmptyLogger()): Unit = Unit + @JvmOverloads + public fun show(logger: Logger? = null): Unit = Unit } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt index 1f7436c8..cf5a889c 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/DbInspector.kt @@ -9,7 +9,8 @@ import com.infinum.dbinspector.ui.databases.DatabasesActivity public object DbInspector { @JvmStatic - public fun show(logger: Logger = EmptyLogger()) { + @JvmOverloads + public fun show(logger: Logger? = null) { Presentation.setLogger(logger) with(Presentation.applicationContext()) { this.startActivity( diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/Presentation.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/Presentation.kt index 04230689..b2f4584e 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/Presentation.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/Presentation.kt @@ -66,8 +66,8 @@ internal object Presentation { this.context = context } - fun setLogger(logger: Logger) { - LibraryKoin.setLibraryLogger(logger) + fun setLogger(logger: Logger? = null) { + logger?.let { LibraryKoin.setLibraryLogger(it) } } fun applicationContext(): Context { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c36ef490..64aff174 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -dbinspector = "5.4.2" +dbinspector = "5.4.3" gradle = "7.0.4" kotlin = "1.6.10" coroutines = "1.6.0" diff --git a/sample/src/main/kotlin/com/infinum/dbinspector/sample/MainActivity.kt b/sample/src/main/kotlin/com/infinum/dbinspector/sample/MainActivity.kt index 673feffe..43c3280f 100644 --- a/sample/src/main/kotlin/com/infinum/dbinspector/sample/MainActivity.kt +++ b/sample/src/main/kotlin/com/infinum/dbinspector/sample/MainActivity.kt @@ -3,7 +3,6 @@ package com.infinum.dbinspector.sample import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import com.infinum.dbinspector.DbInspector -import com.infinum.dbinspector.data.sources.memory.logger.AndroidLogger import com.infinum.dbinspector.sample.databinding.ActivityMainBinding import org.koin.androidx.viewmodel.ext.android.viewModel @@ -20,7 +19,7 @@ class MainActivity : AppCompatActivity() { .also { setContentView(it.root) } .also { it.show.setOnClickListener { - DbInspector.show(AndroidLogger()) + DbInspector.show() } } From 4cfd0f910b9c5d62b1c454e7fa189ffbe0457942 Mon Sep 17 00:00:00 2001 From: Bojan Date: Wed, 29 Dec 2021 12:22:38 +0100 Subject: [PATCH 2/2] * Fix implicit Kotlin 1.6 changes on static show methods. * Prepare 5.4.3 release. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fde344b5..11ee72c6 100644 --- a/README.md +++ b/README.md @@ -44,13 +44,13 @@ Then add the following dependencies in your app `build.gradle` or `build.gradle. **Groovy** ```groovy -debugImplementation "com.infinum.dbinspector:dbinspector:5.4.2" -releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.4.2" +debugImplementation "com.infinum.dbinspector:dbinspector:5.4.3" +releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.4.3" ``` **KotlinDSL** ```kotlin -debugImplementation("com.infinum.dbinspector:dbinspector:5.4.2") -releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.4.2") +debugImplementation("com.infinum.dbinspector:dbinspector:5.4.3") +releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.4.3") ``` ### Usage