Compare commits

...

10 Commits

Author SHA1 Message Date
dependabot[bot]
fe59914032 Bump ch.qos.logback:logback-classic from 1.4.9 to 1.4.11
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.4.9 to 1.4.11.
- [Commits](https://github.com/qos-ch/logback/compare/v_1.4.9...v_1.4.11)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-20 19:09:49 +00:00
Quentin Hibon
ef7454ae75 Bump kotlin from 1.7.21 to 1.8.20 2023-09-20 21:04:38 +02:00
Quentin Hibon
b51f6abfce Target JVM 17 in uhabits-server 2023-09-20 21:04:38 +02:00
Quentin Hibon
a013635224 Bump mockito-kotlin from 4.1.0 to 5.0.0 2023-09-20 21:04:38 +02:00
Quentin Hibon
a9f028a34b Target JVM 11 2023-09-20 21:04:38 +02:00
Quentin Hibon
3b0fba12f5 Remove unused imports in datetimepicker 2023-09-20 21:04:38 +02:00
Quentin Hibon
4139f09fb7 Add @Deprecated when overriding @Deprecated methods 2023-09-20 21:04:38 +02:00
Quentin Hibon
248ff2ec62 Bump mockito-kotlin from 2.2.11 to 4.1.0 in -server 2023-09-20 21:04:38 +02:00
dependabot[bot]
cc7178eb21 Bump daggerVersion from 2.47 to 2.48
Bumps `daggerVersion` from 2.47 to 2.48.

Updates `com.google.dagger:dagger` from 2.47 to 2.48
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.47...dagger-2.48)

Updates `com.google.dagger:dagger-compiler` from 2.47 to 2.48
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.47...dagger-2.48)

---
updated-dependencies:
- dependency-name: com.google.dagger:dagger
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.google.dagger:dagger-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 14:47:47 +02:00
Felix Schlegel
334dabb407 Use default locale instead of hardcoded US locale (#1763) 2023-08-18 18:35:54 +02:00
12 changed files with 41 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
plugins { plugins {
val kotlinVersion = "1.7.21" val kotlinVersion = "1.8.20"
id("com.android.application") version "7.4.2" apply (false) id("com.android.application") version "7.4.2" apply (false)
id("org.jetbrains.kotlin.android") version kotlinVersion apply (false) id("org.jetbrains.kotlin.android") version kotlinVersion apply (false)
id("org.jetbrains.kotlin.kapt") version kotlinVersion apply (false) id("org.jetbrains.kotlin.kapt") version kotlinVersion apply (false)

View File

@@ -29,6 +29,17 @@ tasks.compileLint {
dependsOn("updateTranslators") dependsOn("updateTranslators")
} }
/*
Added on top of kotlinOptions to work around this issue:
https://youtrack.jetbrains.com/issue/KTIJ-24311/task-current-target-is-17-and-kaptGenerateStubsProductionDebugKotlin-task-current-target-is-1.8-jvm-target-compatibility-should#focus=Comments-27-6798448.0-0
Updating gradle might fix this, so try again in the future to remove this and run:
./gradlew --rerun-tasks :uhabits-android:kaptGenerateStubsReleaseKotlin
If this doesn't produce any warning, try to remove it.
*/
kotlin {
jvmToolchain(11)
}
android { android {
compileSdk = 32 compileSdk = 32
@@ -69,8 +80,11 @@ android {
compileOptions { compileOptions {
isCoreLibraryDesugaringEnabled = true isCoreLibraryDesugaringEnabled = true
targetCompatibility(JavaVersion.VERSION_1_8) targetCompatibility(JavaVersion.VERSION_11)
sourceCompatibility(JavaVersion.VERSION_1_8) sourceCompatibility(JavaVersion.VERSION_11)
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
} }
buildFeatures { buildFeatures {
@@ -79,8 +93,8 @@ android {
} }
dependencies { dependencies {
val daggerVersion = "2.47" val daggerVersion = "2.48"
val kotlinVersion = "1.7.21" val kotlinVersion = "1.8.20"
val kxCoroutinesVersion = "1.7.3" val kxCoroutinesVersion = "1.7.3"
val ktorVersion = "1.6.8" val ktorVersion = "1.6.8"
val espressoVersion = "3.5.1" val espressoVersion = "3.5.1"
@@ -95,7 +109,7 @@ dependencies {
androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.2.0") androidTestImplementation("androidx.test.uiautomator:uiautomator:2.2.0")
androidTestImplementation("androidx.test:rules:1.5.0") androidTestImplementation("androidx.test:rules:1.5.0")
androidTestImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0") androidTestImplementation("org.mockito.kotlin:mockito-kotlin:5.0.0")
compileOnly("javax.annotation:jsr250-api:1.0") compileOnly("javax.annotation:jsr250-api:1.0")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3") coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
implementation("com.github.AppIntro:AppIntro:6.2.0") implementation("com.github.AppIntro:AppIntro:6.2.0")
@@ -119,7 +133,7 @@ dependencies {
kaptAndroidTest("com.google.dagger:dagger-compiler:$daggerVersion") kaptAndroidTest("com.google.dagger:dagger-compiler:$daggerVersion")
testImplementation("com.google.dagger:dagger:$daggerVersion") testImplementation("com.google.dagger:dagger:$daggerVersion")
testImplementation("junit:junit:4.13.2") testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0") testImplementation("org.mockito.kotlin:mockito-kotlin:5.0.0")
} }
kapt { kapt {

View File

@@ -22,7 +22,6 @@ import java.util.Locale;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.util.AttributeSet; import android.util.AttributeSet;

View File

@@ -23,14 +23,13 @@ import android.graphics.Paint.*;
import android.os.*; import android.os.*;
import androidx.core.view.*; import androidx.core.view.*;
import androidx.core.view.accessibility.*; import androidx.core.view.accessibility.*;
import androidx.core.widget.*;
import android.text.format.*; import android.text.format.*;
import android.view.*; import android.view.*;
import android.view.accessibility.*; import android.view.accessibility.*;
import androidx.customview.widget.ExploreByTouchHelper; import androidx.customview.widget.ExploreByTouchHelper;
import com.android.*;
import com.android.datetimepicker.*; import com.android.datetimepicker.*;
import com.android.datetimepicker.date.MonthAdapter.*; import com.android.datetimepicker.date.MonthAdapter.*;

View File

@@ -23,7 +23,6 @@ import android.graphics.Paint.*;
import android.util.*; import android.util.*;
import android.view.*; import android.view.*;
import com.android.*;
import com.android.datetimepicker.*; import com.android.datetimepicker.*;
import org.isoron.uhabits.R; import org.isoron.uhabits.R;

View File

@@ -28,7 +28,6 @@ import android.view.View.*;
import android.view.accessibility.*; import android.view.accessibility.*;
import android.widget.*; import android.widget.*;
import com.android.*;
import com.android.datetimepicker.*; import com.android.datetimepicker.*;
import org.isoron.uhabits.R; import org.isoron.uhabits.R;

View File

@@ -127,6 +127,7 @@ class ListHabitsActivity : AppCompatActivity(), Preferences.Listener {
return menu.onItemSelected(item) return menu.onItemSelected(item)
} }
@Deprecated("Deprecated in Java")
override fun onActivityResult(request: Int, result: Int, data: Intent?) { override fun onActivityResult(request: Int, result: Int, data: Intent?) {
super.onActivityResult(request, result, data) super.onActivityResult(request, result, data)
screen.onResult(request, result, data) screen.onResult(request, result, data)

View File

@@ -38,7 +38,7 @@ class BarCardView(context: Context, attrs: AttributeSet) : LinearLayout(context,
fun setState(state: BarCardState) { fun setState(state: BarCardState) {
val androidColor = state.theme.color(state.color).toInt() val androidColor = state.theme.color(state.color).toInt()
binding.chart.view = BarChart(state.theme, JavaLocalDateFormatter(Locale.US)).apply { binding.chart.view = BarChart(state.theme, JavaLocalDateFormatter(Locale.getDefault())).apply {
series = mutableListOf(state.entries.map { it.value / 1000.0 }) series = mutableListOf(state.entries.map { it.value / 1000.0 })
colors = mutableListOf(theme.color(state.color.paletteIndex)) colors = mutableListOf(theme.color(state.color.paletteIndex))
axis = state.entries.map { it.timestamp.toLocalDate() } axis = state.entries.map { it.timestamp.toLocalDate() }

View File

@@ -53,6 +53,8 @@ class SettingsFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeLis
private var ringtoneManager: RingtoneManager? = null private var ringtoneManager: RingtoneManager? = null
private lateinit var prefs: Preferences private lateinit var prefs: Preferences
private var widgetUpdater: WidgetUpdater? = null private var widgetUpdater: WidgetUpdater? = null
@Deprecated("Deprecated in Java")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == RINGTONE_REQUEST_CODE) { if (requestCode == RINGTONE_REQUEST_CODE) {
ringtoneManager!!.update(data) ringtoneManager!!.update(data)

View File

@@ -60,12 +60,14 @@ class AndroidTaskRunner : TaskRunner {
publishProgress(progress) publishProgress(progress)
} }
@Deprecated("Deprecated in Java")
override fun doInBackground(vararg params: Void?): Void? { override fun doInBackground(vararg params: Void?): Void? {
if (isCancelled) return null if (isCancelled) return null
task.doInBackground() task.doInBackground()
return null return null
} }
@Deprecated("Deprecated in Java")
override fun onPostExecute(aVoid: Void?) { override fun onPostExecute(aVoid: Void?) {
if (isCancelled) return if (isCancelled) return
task.onPostExecute() task.onPostExecute()
@@ -74,6 +76,7 @@ class AndroidTaskRunner : TaskRunner {
for (l in listeners) l.onTaskFinished(task) for (l in listeners) l.onTaskFinished(task)
} }
@Deprecated("Deprecated in Java")
override fun onPreExecute() { override fun onPreExecute() {
if (isCancelled) return if (isCancelled) return
for (l in listeners) l.onTaskStarted(task) for (l in listeners) l.onTaskStarted(task)
@@ -82,6 +85,7 @@ class AndroidTaskRunner : TaskRunner {
task.onPreExecute() task.onPreExecute()
} }
@Deprecated("Deprecated in Java")
override fun onProgressUpdate(vararg values: Int?) { override fun onProgressUpdate(vararg values: Int?) {
values[0]?.let { task.onProgressUpdate(it) } values[0]?.let { task.onProgressUpdate(it) }
} }

View File

@@ -24,6 +24,7 @@ plugins {
kotlin { kotlin {
jvm().withJava() jvm().withJava()
jvmToolchain(11)
sourceSets { sourceSets {
val commonMain by getting { val commonMain by getting {
@@ -43,7 +44,7 @@ kotlin {
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {
implementation(kotlin("stdlib-jdk8")) implementation(kotlin("stdlib-jdk8"))
compileOnly("com.google.dagger:dagger:2.47") compileOnly("com.google.dagger:dagger:2.48")
implementation("com.google.guava:guava:32.1.2-android") implementation("com.google.guava:guava:32.1.2-android")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3")
implementation("androidx.annotation:annotation:1.6.0") implementation("androidx.annotation:annotation:1.6.0")
@@ -61,7 +62,7 @@ kotlin {
implementation("org.xerial:sqlite-jdbc:3.42.0.0") implementation("org.xerial:sqlite-jdbc:3.42.0.0")
implementation("org.hamcrest:hamcrest:2.2") implementation("org.hamcrest:hamcrest:2.2")
implementation("org.apache.commons:commons-io:1.3.2") implementation("org.apache.commons:commons-io:1.3.2")
implementation("org.mockito.kotlin:mockito-kotlin:4.1.0") implementation("org.mockito.kotlin:mockito-kotlin:5.0.0")
implementation("org.junit.jupiter:junit-jupiter:5.10.0") implementation("org.junit.jupiter:junit-jupiter:5.10.0")
} }
} }

View File

@@ -25,6 +25,10 @@ plugins {
id("com.github.johnrengelman.shadow") version "7.1.2" id("com.github.johnrengelman.shadow") version "7.1.2"
} }
kotlin {
jvmToolchain(17)
}
application { application {
group = "org.isoron.uhabits" group = "org.isoron.uhabits"
@@ -34,8 +38,8 @@ application {
dependencies { dependencies {
val ktorVersion = "1.6.8" val ktorVersion = "1.6.8"
val kotlinVersion = "1.7.21" val kotlinVersion = "1.8.20"
val logbackVersion = "1.4.9" val logbackVersion = "1.4.11"
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion") implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion") implementation("ch.qos.logback:logback-classic:$logbackVersion")
@@ -47,7 +51,7 @@ dependencies {
implementation("io.prometheus:simpleclient_httpserver:0.16.0") implementation("io.prometheus:simpleclient_httpserver:0.16.0")
implementation("io.prometheus:simpleclient_hotspot:0.16.0") implementation("io.prometheus:simpleclient_hotspot:0.16.0")
testImplementation("io.ktor:ktor-server-tests:$ktorVersion") testImplementation("io.ktor:ktor-server-tests:$ktorVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:2.2.11") testImplementation("org.mockito.kotlin:mockito-kotlin:5.0.0")
testImplementation(kotlin("test")) testImplementation(kotlin("test"))
testImplementation(kotlin("test-junit")) testImplementation(kotlin("test-junit"))
} }
@@ -57,3 +61,4 @@ tasks.withType<ShadowJar> {
archiveClassifier.set("") archiveClassifier.set("")
archiveVersion.set("") archiveVersion.set("")
} }