Skip to content

Commit

Permalink
Disable Jetifier and improve deprecated elements
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluchu committed Jun 14, 2024
1 parent 284d622 commit e3f4063
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
android.enableJetifier=false
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
5 changes: 0 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ androidx-lifecycle-lifecycle-livedata-core-ktx = { module = "androidx.lifecycle:
androidx-lifecycle-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
androidx-navigation-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
androidx-preference = "androidx.preference:preference-ktx:1.2.1"
com-android-tools-build-gradle = "com.android.tools.build:gradle:8.4.2"
org-jetbrains-dokka = "org.jetbrains.dokka:dokka-gradle-plugin:1.9.20"
org-jetbrains-dokka-versioning = "org.jetbrains.dokka:versioning-plugin:1.9.20"
com-google-accompanist-accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "com-google-accompanist" }
com-google-android-gms-play-services-base = "com.google.android.gms:play-services-base:18.5.0"
com-google-code-gson = "com.google.code.gson:gson:2.11.0"
Expand All @@ -47,8 +44,6 @@ com-squareup-okhttp3-okhttp = { module = "com.squareup.okhttp3:okhttp", version.
com-squareup-retrofit2-converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "com-squareup-retrofit2" }
com-squareup-retrofit2-retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "com-squareup-retrofit2" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil-kt" }
coil-gif = { module = "io.coil-kt:coil-gif", version.ref = "coil-gif" }
org-jetbrains-kotlin-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "org-jetbrains-kotlin" }
org-jetbrains-kotlinx-kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "org-jetbrains-kotlinx" }
org-jetbrains-kotlinx-kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "org-jetbrains-kotlinx" }
androidx-appcompat = "androidx.appcompat:appcompat:1.7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.jeluchu.jchucomponents.ktx.numbers

import java.math.BigDecimal
import java.math.MathContext
import java.math.RoundingMode
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols

Expand Down Expand Up @@ -30,7 +31,7 @@ fun List<BigDecimal>.sum(): BigDecimal = if (this.isNotEmpty()) reduce { acc, it

operator fun BigDecimal.div(int: Int) = this / int.toBigDecimal()

fun BigDecimal.isZero() = setScale(0, BigDecimal.ROUND_UP) == BigDecimal.ZERO
fun BigDecimal.isZero() = setScale(0, RoundingMode.UP) == BigDecimal.ZERO

fun BigDecimal.safeDiv(n: BigDecimal, context: MathContext = MathContext.DECIMAL128): BigDecimal =
this.divide(if (n.isZero()) BigDecimal.ONE else n, context)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@
package com.jeluchu.qr

abstract class ReaderException : Exception {

internal constructor()
internal constructor(cause: Throwable?) : super(cause)

// Prevent stack traces from being taken
@Synchronized
override fun fillInStackTrace(): Throwable? = null

companion object {
// disable stack traces when not running inside test units
@JvmField
Expand All @@ -23,5 +18,4 @@ abstract class ReaderException : Exception {
@JvmField
val NO_TRACE = arrayOfNulls<StackTraceElement>(0)
}

}
17 changes: 10 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ dependencyResolutionManagement {
}

rootProject.name = "JchuComponents"
include(":jchucomponents-core")
include(":jchucomponents-ui")
include(":jchucomponents-ktx")
include(":jchucomponents-qr")
include(":jchucomponents-pay")
include(":jchucomponents-prefs")
include("app")
include(
":jchucomponents-core",
":jchucomponents-ui",
":jchucomponents-ktx",
":jchucomponents-qr",
":jchucomponents-pay",
":jchucomponents-prefs",
"app"
)

0 comments on commit e3f4063

Please sign in to comment.