mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 09:38:52 -06:00
Compare commits
10 Commits
630eaa3b0b
...
fe59914032
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe59914032 | ||
|
|
ef7454ae75 | ||
|
|
b51f6abfce | ||
|
|
a013635224 | ||
|
|
a9f028a34b | ||
|
|
3b0fba12f5 | ||
|
|
4139f09fb7 | ||
|
|
248ff2ec62 | ||
|
|
cc7178eb21 | ||
|
|
334dabb407 |
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
val kotlinVersion = "1.7.21"
|
||||
val kotlinVersion = "1.8.20"
|
||||
id("com.android.application") version "7.4.2" apply (false)
|
||||
id("org.jetbrains.kotlin.android") version kotlinVersion apply (false)
|
||||
id("org.jetbrains.kotlin.kapt") version kotlinVersion apply (false)
|
||||
|
||||
@@ -29,6 +29,17 @@ tasks.compileLint {
|
||||
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 {
|
||||
|
||||
compileSdk = 32
|
||||
@@ -69,8 +80,11 @@ android {
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
targetCompatibility(JavaVersion.VERSION_1_8)
|
||||
sourceCompatibility(JavaVersion.VERSION_1_8)
|
||||
targetCompatibility(JavaVersion.VERSION_11)
|
||||
sourceCompatibility(JavaVersion.VERSION_11)
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_11.toString()
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
@@ -79,8 +93,8 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
val daggerVersion = "2.47"
|
||||
val kotlinVersion = "1.7.21"
|
||||
val daggerVersion = "2.48"
|
||||
val kotlinVersion = "1.8.20"
|
||||
val kxCoroutinesVersion = "1.7.3"
|
||||
val ktorVersion = "1.6.8"
|
||||
val espressoVersion = "3.5.1"
|
||||
@@ -95,7 +109,7 @@ dependencies {
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.2.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")
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
|
||||
implementation("com.github.AppIntro:AppIntro:6.2.0")
|
||||
@@ -119,7 +133,7 @@ dependencies {
|
||||
kaptAndroidTest("com.google.dagger:dagger-compiler:$daggerVersion")
|
||||
testImplementation("com.google.dagger:dagger:$daggerVersion")
|
||||
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 {
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.Locale;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
@@ -23,14 +23,13 @@ import android.graphics.Paint.*;
|
||||
import android.os.*;
|
||||
import androidx.core.view.*;
|
||||
import androidx.core.view.accessibility.*;
|
||||
import androidx.core.widget.*;
|
||||
|
||||
import android.text.format.*;
|
||||
import android.view.*;
|
||||
import android.view.accessibility.*;
|
||||
|
||||
import androidx.customview.widget.ExploreByTouchHelper;
|
||||
|
||||
import com.android.*;
|
||||
import com.android.datetimepicker.*;
|
||||
import com.android.datetimepicker.date.MonthAdapter.*;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import android.graphics.Paint.*;
|
||||
import android.util.*;
|
||||
import android.view.*;
|
||||
|
||||
import com.android.*;
|
||||
import com.android.datetimepicker.*;
|
||||
|
||||
import org.isoron.uhabits.R;
|
||||
|
||||
@@ -28,7 +28,6 @@ import android.view.View.*;
|
||||
import android.view.accessibility.*;
|
||||
import android.widget.*;
|
||||
|
||||
import com.android.*;
|
||||
import com.android.datetimepicker.*;
|
||||
|
||||
import org.isoron.uhabits.R;
|
||||
|
||||
@@ -127,6 +127,7 @@ class ListHabitsActivity : AppCompatActivity(), Preferences.Listener {
|
||||
return menu.onItemSelected(item)
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onActivityResult(request: Int, result: Int, data: Intent?) {
|
||||
super.onActivityResult(request, result, data)
|
||||
screen.onResult(request, result, data)
|
||||
|
||||
@@ -38,7 +38,7 @@ class BarCardView(context: Context, attrs: AttributeSet) : LinearLayout(context,
|
||||
|
||||
fun setState(state: BarCardState) {
|
||||
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 })
|
||||
colors = mutableListOf(theme.color(state.color.paletteIndex))
|
||||
axis = state.entries.map { it.timestamp.toLocalDate() }
|
||||
|
||||
@@ -53,6 +53,8 @@ class SettingsFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeLis
|
||||
private var ringtoneManager: RingtoneManager? = null
|
||||
private lateinit var prefs: Preferences
|
||||
private var widgetUpdater: WidgetUpdater? = null
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (requestCode == RINGTONE_REQUEST_CODE) {
|
||||
ringtoneManager!!.update(data)
|
||||
|
||||
@@ -60,12 +60,14 @@ class AndroidTaskRunner : TaskRunner {
|
||||
publishProgress(progress)
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun doInBackground(vararg params: Void?): Void? {
|
||||
if (isCancelled) return null
|
||||
task.doInBackground()
|
||||
return null
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onPostExecute(aVoid: Void?) {
|
||||
if (isCancelled) return
|
||||
task.onPostExecute()
|
||||
@@ -74,6 +76,7 @@ class AndroidTaskRunner : TaskRunner {
|
||||
for (l in listeners) l.onTaskFinished(task)
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onPreExecute() {
|
||||
if (isCancelled) return
|
||||
for (l in listeners) l.onTaskStarted(task)
|
||||
@@ -82,6 +85,7 @@ class AndroidTaskRunner : TaskRunner {
|
||||
task.onPreExecute()
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onProgressUpdate(vararg values: Int?) {
|
||||
values[0]?.let { task.onProgressUpdate(it) }
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ plugins {
|
||||
|
||||
kotlin {
|
||||
jvm().withJava()
|
||||
jvmToolchain(11)
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
@@ -43,7 +44,7 @@ kotlin {
|
||||
val jvmMain by getting {
|
||||
dependencies {
|
||||
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("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3")
|
||||
implementation("androidx.annotation:annotation:1.6.0")
|
||||
@@ -61,7 +62,7 @@ kotlin {
|
||||
implementation("org.xerial:sqlite-jdbc:3.42.0.0")
|
||||
implementation("org.hamcrest:hamcrest:2.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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,10 @@ plugins {
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(17)
|
||||
}
|
||||
|
||||
|
||||
application {
|
||||
group = "org.isoron.uhabits"
|
||||
@@ -34,8 +38,8 @@ application {
|
||||
|
||||
dependencies {
|
||||
val ktorVersion = "1.6.8"
|
||||
val kotlinVersion = "1.7.21"
|
||||
val logbackVersion = "1.4.9"
|
||||
val kotlinVersion = "1.8.20"
|
||||
val logbackVersion = "1.4.11"
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
|
||||
implementation("io.ktor:ktor-server-netty:$ktorVersion")
|
||||
implementation("ch.qos.logback:logback-classic:$logbackVersion")
|
||||
@@ -47,7 +51,7 @@ dependencies {
|
||||
implementation("io.prometheus:simpleclient_httpserver:0.16.0")
|
||||
implementation("io.prometheus:simpleclient_hotspot:0.16.0")
|
||||
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-junit"))
|
||||
}
|
||||
@@ -57,3 +61,4 @@ tasks.withType<ShadowJar> {
|
||||
archiveClassifier.set("")
|
||||
archiveVersion.set("")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user