From de4ec50d0fc51191a8eedd3d9a2e26fd34704e0f Mon Sep 17 00:00:00 2001 From: Bojan Date: Wed, 15 Jun 2022 15:03:15 +0200 Subject: [PATCH 1/3] Centralize version numbering. --- config.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config.gradle b/config.gradle index f839c044..3dfd1505 100644 --- a/config.gradle +++ b/config.gradle @@ -1,4 +1,8 @@ ext { + def major = 5 + def minor = 4 + def patch = 7 + buildConfig = [ "minSdk" : 21, "compileSdk": 32, @@ -7,7 +11,7 @@ ext { ] releaseConfig = [ "group" : "com.infinum.dbinspector", - "version" : "5.4.7", - "versionCode": 5 * 100 * 100 + 4 * 100 + 7 + "version" : "$major.$minor.$patch", + "versionCode": major * 100 * 100 + minor * 100 + patch ] } \ No newline at end of file From aebaaf9943a9c479a02117acea2b17fd6ddef637 Mon Sep 17 00:00:00 2001 From: Bojan Date: Fri, 5 Aug 2022 18:15:56 +0200 Subject: [PATCH 2/3] * Update Kotlin to 1.7.10. * Update dependencies to stable version. --- CHANGELOG.md | 7 +++++++ README.md | 8 ++++---- build.gradle | 6 ++++++ config.gradle | 2 +- dbinspector-no-op/build.gradle | 7 +++++++ dbinspector/build.gradle | 7 +++++++ gradle/libs.versions.toml | 22 +++++++++++----------- settings.gradle | 4 ++-- 8 files changed, 45 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d213030..28ae9b93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========= +## Version 5.4.8 + +_2022-08-05_ + +* Update Kotlin to 1.7.10. +* Update dependencies to stable version. + ## Version 5.4.7 _2022-06-10_ diff --git a/README.md b/README.md index 0ca077da..0d9952aa 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.7" -releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.4.7" +debugImplementation "com.infinum.dbinspector:dbinspector:5.4.8" +releaseImplementation "com.infinum.dbinspector:dbinspector-no-op:5.4.8" ``` **KotlinDSL** ```kotlin -debugImplementation("com.infinum.dbinspector:dbinspector:5.4.7") -releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.4.7") +debugImplementation("com.infinum.dbinspector:dbinspector:5.4.8") +releaseImplementation("com.infinum.dbinspector:dbinspector-no-op:5.4.8") ``` ### Usage diff --git a/build.gradle b/build.gradle index 363e99f5..bf43ea73 100644 --- a/build.gradle +++ b/build.gradle @@ -82,3 +82,9 @@ task runStaticChecks(dependsOn: [ group = "Verification" description = "Run static checks on all modules" } + +task cleanMavenLocal { + doLast { + new File('~/.m2/repository/example').deleteDir() + } +} diff --git a/config.gradle b/config.gradle index 3dfd1505..0fdbe11c 100644 --- a/config.gradle +++ b/config.gradle @@ -1,7 +1,7 @@ ext { def major = 5 def minor = 4 - def patch = 7 + def patch = 8 buildConfig = [ "minSdk" : 21, diff --git a/dbinspector-no-op/build.gradle b/dbinspector-no-op/build.gradle index fc5c8a4b..5aa5b004 100644 --- a/dbinspector-no-op/build.gradle +++ b/dbinspector-no-op/build.gradle @@ -46,6 +46,13 @@ android { sourceSets.each { it.java.srcDirs += "src/$it.name/kotlin" } + + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } } dependencies { diff --git a/dbinspector/build.gradle b/dbinspector/build.gradle index 644cb5ba..97a37027 100644 --- a/dbinspector/build.gradle +++ b/dbinspector/build.gradle @@ -93,6 +93,13 @@ android { buildFeatures { viewBinding true } + + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } } dependencies { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fdb13f8d..7e154177 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,13 +1,13 @@ [versions] -dbinspector = "5.4.7" -gradle = "7.2.1" -kotlin = "1.7.0" -coroutines = "1.6.2" +dbinspector = "5.4.8" +gradle = "7.2.2" +kotlin = "1.7.10" +coroutines = "1.6.4" core = "1.8.0" appcompat = "1.4.2" -activity = "1.4.0" -fragment = "1.4.1" -lifecycle = "2.4.1" +activity = "1.5.1" +fragment = "1.5.1" +lifecycle = "2.5.1" viewpager = "1.0.0" paging = "3.1.1" recyclerview = "1.2.1" @@ -16,14 +16,14 @@ swiperefresh = "1.1.0" datastore = "1.0.0" dynamicanimation = "1.0.0" design = "1.6.1" -protobuf-core = "3.21.1" -protobuf-plugin = "0.8.18" +protobuf-core = "3.21.4" +protobuf-plugin = "0.8.19" koin = "3.2.0" -detekt = "1.20.0" +detekt = "1.21.0" ktlintplugin = "10.3.0" ktlint = "0.45.2" cpd = "3.2" -dokka = "1.6.21" +dokka = "1.7.10" kover = "0.5.1" jacoco = "0.8.8" intellij = "1.0.647" diff --git a/settings.gradle b/settings.gradle index 8c6f5023..448751e1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,6 +2,6 @@ enableFeaturePreview("VERSION_CATALOGS") rootProject.name="DbInspector" -include "dbinspector" -include "dbinspector-no-op" +include ":dbinspector" +include ":dbinspector-no-op" include ":sample" From ce147986c34d7ffc74a431736538413536470e4a Mon Sep 17 00:00:00 2001 From: Bojan Date: Fri, 5 Aug 2022 18:18:48 +0200 Subject: [PATCH 3/3] Fix code debt. --- .../interactors/RemoveIgnoredTableNameInteractor.kt | 2 +- .../settings/interactors/SaveIgnoredTableNameInteractor.kt | 2 +- .../infinum/dbinspector/domain/shared/models/dsl/Delete.kt | 2 +- .../dbinspector/domain/shared/models/dsl/DropTrigger.kt | 2 +- .../dbinspector/domain/shared/models/dsl/DropView.kt | 2 +- .../infinum/dbinspector/domain/shared/models/dsl/Pragma.kt | 2 +- .../infinum/dbinspector/domain/shared/models/dsl/Select.kt | 6 +++--- .../dbinspector/domain/shared/models/dsl/conditions/Eq.kt | 2 +- .../dbinspector/domain/shared/models/dsl/conditions/Like.kt | 2 +- .../ui/shared/delegates/LifecycleConnectionDelegate.kt | 2 +- .../dbinspector/ui/shared/delegates/ViewBindingDelegate.kt | 2 +- .../dbinspector/ui/shared/views/SplitLinearLayout.kt | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/RemoveIgnoredTableNameInteractor.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/RemoveIgnoredTableNameInteractor.kt index 0949d602..0cd99f9b 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/RemoveIgnoredTableNameInteractor.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/RemoveIgnoredTableNameInteractor.kt @@ -22,6 +22,6 @@ internal class RemoveIgnoredTableNameInteractor( entity.toBuilder().removeIgnoredTableNames(indexed.first).build() } } - } ?: throw IllegalStateException("Ignored table name cannot be empty or blank.") + } ?: error("Ignored table name cannot be empty or blank.") } } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/SaveIgnoredTableNameInteractor.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/SaveIgnoredTableNameInteractor.kt index f39f899b..c07b4bde 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/SaveIgnoredTableNameInteractor.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/settings/interactors/SaveIgnoredTableNameInteractor.kt @@ -21,6 +21,6 @@ internal class SaveIgnoredTableNameInteractor( ) .build() } - } ?: throw IllegalStateException("Ignored table name cannot be empty or blank.") + } ?: error("Ignored table name cannot be empty or blank.") } } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Delete.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Delete.kt index 1b6b7eca..2cc96632 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Delete.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Delete.kt @@ -22,7 +22,7 @@ internal class Delete { fun build(): String { if (!::table.isInitialized) { - throw IllegalStateException("Failed to build - target table is undefined") + error("Failed to build - target table is undefined") } return toString() } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropTrigger.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropTrigger.kt index f02227ea..0fee1a83 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropTrigger.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropTrigger.kt @@ -14,7 +14,7 @@ internal class DropTrigger { fun build(): String { if (!::trigger.isInitialized) { - throw IllegalStateException("Failed to build - target view is undefined") + error("Failed to build - target view is undefined") } return toString() } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropView.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropView.kt index 56c04855..0d7539d6 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropView.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/DropView.kt @@ -14,7 +14,7 @@ internal class DropView { fun build(): String { if (!::view.isInitialized) { - throw IllegalStateException("Failed to build - target view is undefined") + error("Failed to build - target view is undefined") } return toString() } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Pragma.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Pragma.kt index 9c7daba0..2efcb8bd 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Pragma.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Pragma.kt @@ -19,7 +19,7 @@ internal class Pragma { fun build(): String { if (!::pragmaName.isInitialized) { - throw IllegalStateException("Failed to build - pragmaName is undefined") + error("Failed to build - pragmaName is undefined") } return toString() } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Select.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Select.kt index ccc5d1db..36c11c04 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Select.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/Select.kt @@ -19,7 +19,7 @@ internal class Select { fun columns(vararg columns: String) { if (this.columns.isNotEmpty()) { - throw IllegalStateException("Detected an attempt to re-define columns to fetch.") + error("Detected an attempt to re-define columns to fetch.") } this.columns.addAll(columns) } @@ -39,7 +39,7 @@ internal class Select { throw IllegalArgumentException("At least one column should be defined") } if (this.orderByColumns.isNotEmpty()) { - throw IllegalStateException("Detected an attempt to re-define ORDER BY columns.") + error("Detected an attempt to re-define ORDER BY columns.") } this.orderByColumns = columns.toList().filterNotNull() } @@ -50,7 +50,7 @@ internal class Select { fun build(): String { if (!::table.isInitialized) { - throw IllegalStateException("Failed to build - target table is undefined") + error("Failed to build - target table is undefined") } return toString() } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Eq.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Eq.kt index 39e6fc46..9a047327 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Eq.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Eq.kt @@ -14,7 +14,7 @@ internal class Eq( } override fun addCondition(condition: Condition) { - throw IllegalStateException("Can't add a nested condition to 'eq'") + error("Can't add a nested condition to 'eq'") } override fun toString(): String = diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Like.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Like.kt index 12b1430c..1289aaf8 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Like.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/domain/shared/models/dsl/conditions/Like.kt @@ -16,7 +16,7 @@ internal class Like( } override fun addCondition(condition: Condition): Unit = - throw IllegalStateException("Can't add a nested condition to 'like'") + error("Can't add a nested condition to 'like'") override fun toString(): String = "$column LIKE \"%%$value%%\"" diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/delegates/LifecycleConnectionDelegate.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/delegates/LifecycleConnectionDelegate.kt index daa1f7e0..55f4c7c6 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/delegates/LifecycleConnectionDelegate.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/delegates/LifecycleConnectionDelegate.kt @@ -30,7 +30,7 @@ internal class LifecycleConnectionDelegate( .currentState .isAtLeast(Lifecycle.State.INITIALIZED).not() ) { - throw IllegalStateException("Owner has not passed created yet.") + error("Owner has not passed created yet.") } val extras = when (thisRef) { diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/delegates/ViewBindingDelegate.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/delegates/ViewBindingDelegate.kt index e482c873..43adbeac 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/delegates/ViewBindingDelegate.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/delegates/ViewBindingDelegate.kt @@ -48,7 +48,7 @@ internal class ViewBindingDelegate( .currentState .isAtLeast(Lifecycle.State.INITIALIZED).not() ) { - throw IllegalStateException("Fragment views are not created yet.") + error("Fragment views are not created yet.") } viewBindingFactory(thisRef.requireView()).also { this.binding = it } diff --git a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/views/SplitLinearLayout.kt b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/views/SplitLinearLayout.kt index f8473b9d..b2adce26 100644 --- a/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/views/SplitLinearLayout.kt +++ b/dbinspector/src/main/kotlin/com/infinum/dbinspector/ui/shared/views/SplitLinearLayout.kt @@ -631,7 +631,7 @@ internal class SplitLinearLayout @JvmOverloads constructor( private fun checkChildCount() { if (childCount != 2) { - throw IllegalStateException("SplitLinearLayout must have exactly 2 child views.") + error("SplitLinearLayout must have exactly 2 child views.") } }