Skip to content

Commit 5cc21f9

Browse files
committed
build: Final after refactor build fix, done
1 parent bc21179 commit 5cc21f9

File tree

42 files changed

+317
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+317
-281
lines changed

api/agata/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
plugins {
2121
alias(libs.plugins.lastaapps.kmp.library)
22-
alias(libs.plugins.lastaapps.kmp.sqldelight)
22+
alias(libs.plugins.lastaapps.common.sqldelight)
2323
}
2424

2525
kotlin {
@@ -44,7 +44,7 @@ sqldelight {
4444
databases {
4545
create("AgataDatabase") {
4646
packageName.set("cz.lastaapps.api.agata")
47-
schemaOutputDirectory.set(file("src/main/sqldelight/databases"))
47+
schemaOutputDirectory.set(file("src/commonMain/sqldelight/databases"))
4848
verifyMigrations.set(true)
4949
}
5050
}

api/buffet/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
plugins {
2121
alias(libs.plugins.lastaapps.kmp.library)
22-
alias(libs.plugins.lastaapps.kmp.sqldelight)
22+
alias(libs.plugins.lastaapps.common.sqldelight)
2323
}
2424

2525
kotlin {
@@ -41,7 +41,7 @@ sqldelight {
4141
databases {
4242
create("BuffetDatabase") {
4343
packageName.set("cz.lastaapps.api.buffet")
44-
schemaOutputDirectory.set(file("src/main/sqldelight/databases"))
44+
schemaOutputDirectory.set(file("src/commonMain/sqldelight/databases"))
4545
verifyMigrations.set(true)
4646
}
4747
}

app/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ android {
6969
}
7070

7171
dependencies {
72-
7372
implementation(projects.api.agata)
7473
implementation(projects.api.main)
7574
implementation(projects.core)

app/src/main/kotlin/cz/lastaapps/menza/features/other/ui/dialog/ReportDialog.kt

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ import cz.lastaapps.menza.features.other.ui.dialog.ReportMode.Facebook
6565
import cz.lastaapps.menza.features.other.ui.dialog.ReportMode.GitHub
6666
import cz.lastaapps.menza.features.other.ui.dialog.ReportMode.Matrix
6767
import cz.lastaapps.menza.features.other.ui.dialog.ReportMode.Telegram
68-
import java.time.LocalDateTime
69-
import java.time.ZonedDateTime
70-
import java.time.format.DateTimeFormatter
68+
import kotlinx.datetime.LocalDateTime
69+
import kotlinx.datetime.TimeZone
70+
import kotlinx.datetime.format
71+
import kotlinx.datetime.toLocalDateTime
72+
import kotlin.time.Clock
7173

7274
sealed class ReportMode {
7375
data object Matrix : ReportMode()
@@ -252,7 +254,10 @@ fun sendReport(
252254
|${getPhoneInfo(context)}
253255
|
254256
|"Internal app problem"
255-
|${LocalDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)}
257+
|${
258+
Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault())
259+
.format(LocalDateTime.Formats.ISO)
260+
}
256261
|$errorText
257262
|
258263
|${extraMessage ?: ""}
@@ -281,7 +286,10 @@ fun sendReport(
281286
ErrorSeverity.HANDLED -> "Internal app problem"
282287
}
283288
}
284-
|${crash.date.format(DateTimeFormatter.ISO_DATE_TIME)}
289+
|${
290+
crash.date.toLocalDateTime(TimeZone.currentSystemDefault())
291+
.format(LocalDateTime.Formats.ISO)
292+
}
285293
|${crash.message}
286294
|${crash.trace}
287295
""".trimMargin()
@@ -296,12 +304,30 @@ private fun doSend(
296304
copyToClipboard(context, text)
297305

298306
when (mode) {
299-
Matrix -> sendMatrix(context, text)
300-
Telegram -> sendTelegram(context, text)
301-
GitHub -> sendGitHub(context, text)
302-
Discord -> sendDiscord(context, text)
303-
Facebook -> sendFacebook(context, text)
304-
Email -> sendEmail(context, text)
307+
Matrix -> {
308+
sendMatrix(context, text)
309+
}
310+
311+
Telegram -> {
312+
sendTelegram(context, text)
313+
}
314+
315+
GitHub -> {
316+
sendGitHub(context, text)
317+
}
318+
319+
Discord -> {
320+
sendDiscord(context, text)
321+
}
322+
323+
Facebook -> {
324+
sendFacebook(context, text)
325+
}
326+
327+
Email -> {
328+
sendEmail(context, text)
329+
}
330+
305331
Clipboard -> {}
306332
}
307333
}
@@ -314,7 +340,7 @@ private fun getPhoneInfo(context: Context): String {
314340
|App version code: ${BuildConfig.VERSION_CODE}
315341
|Phone model: ${Build.MODEL}
316342
|Phone manufacturer: ${Build.MANUFACTURER}
317-
|Date and Time: ${ZonedDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)}
343+
|Date and Time: ${Clock.System.now()}
318344
|Screen size: ${metrics.widthPixels} x ${metrics.heightPixels} px
319345
""".trimMargin()
320346
}

app/src/main/kotlin/cz/lastaapps/menza/features/other/ui/widgets/CrashesList.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ import cz.lastaapps.menza.features.other.ui.dialog.ReportDialog
5151
import cz.lastaapps.menza.features.other.ui.dialog.sendReport
5252
import cz.lastaapps.menza.features.panels.crashreport.ui.CrashesViewModel
5353
import kotlinx.collections.immutable.ImmutableList
54-
import java.time.format.DateTimeFormatter
54+
import kotlinx.datetime.LocalDateTime
55+
import kotlinx.datetime.TimeZone
56+
import kotlinx.datetime.format
57+
import kotlinx.datetime.toLocalDateTime
5558

5659
@Composable
5760
internal fun CrashesDialog(
@@ -159,9 +162,9 @@ private fun CrashItem(
159162
Text(
160163
stringResource(
161164
R.string.crash_date_title,
162-
crash.date.format(
163-
DateTimeFormatter.ISO_LOCAL_DATE_TIME,
164-
),
165+
crash.date
166+
.toLocalDateTime(TimeZone.currentSystemDefault())
167+
.format(LocalDateTime.Formats.ISO),
165168
),
166169
)
167170
Text(

app/src/main/kotlin/cz/lastaapps/menza/features/panels/crashreport/ui/CrashesViewModel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import kotlinx.collections.immutable.persistentListOf
3535
import kotlinx.collections.immutable.toImmutableList
3636
import kotlinx.coroutines.flow.collectLatest
3737
import kotlinx.coroutines.launch
38-
import java.time.ZonedDateTime
38+
import kotlin.time.Instant
3939

4040
internal class CrashesViewModel(
4141
context: VMContext,
@@ -55,7 +55,7 @@ internal class CrashesViewModel(
5555
database.crashQueries
5656
.getCrashes {
5757
id: Long,
58-
date: ZonedDateTime,
58+
date: Instant,
5959
severity: ErrorSeverity,
6060
message: String?,
6161
trace: String,
@@ -77,7 +77,7 @@ internal class CrashesViewModel(
7777
database.crashQueries
7878
.getUnreported {
7979
id: Long,
80-
date: ZonedDateTime,
80+
date: Instant,
8181
severity: ErrorSeverity,
8282
message: String?,
8383
trace: String,

app/src/main/kotlin/cz/lastaapps/menza/features/settings/data/OrderRepoImpl.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024, Petr Laštovička as Lasta apps, All rights reserved
2+
* Copyright 2025, Petr Laštovička as Lasta apps, All rights reserved
33
*
44
* This file is part of Menza.
55
*
@@ -57,7 +57,7 @@ internal class OrderRepoImpl(
5757
override suspend fun toggleVisible(menza: MenzaType) =
5858
lock.withLock {
5959
val (newVisible, newHidden) = getHighestKeys()
60-
val current = source.getMenzaOrder(toKey(menza)) ?: return
60+
val current = source.getMenzaOrder(toKey(menza)) ?: return@withLock
6161

6262
if (current.visible) {
6363
MenzaOrder(newHidden + 1, false)
@@ -72,8 +72,8 @@ internal class OrderRepoImpl(
7272
m1: MenzaType,
7373
m2: MenzaType,
7474
) = lock.withLock {
75-
val o1 = source.getMenzaOrder(toKey(m1)) ?: return
76-
val o2 = source.getMenzaOrder(toKey(m2)) ?: return
75+
val o1 = source.getMenzaOrder(toKey(m1)) ?: return@withLock
76+
val o2 = source.getMenzaOrder(toKey(m2)) ?: return@withLock
7777
source.putMenzaOrder(toKey(m1), o2)
7878
source.putMenzaOrder(toKey(m2), o1)
7979
}

core/build.gradle.kts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,6 @@
1717
* along with Menza. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919

20-
import cz.lastaapps.extensions.libs
21-
22-
/*
23-
* Copyright 2024, Petr Laštovička as Lasta apps, All rights reserved
24-
*
25-
* This file is part of Menza.
26-
*
27-
* Menza is free software: you can redistribute it and/or modify
28-
* it under the terms of the GNU General Public License as published by
29-
* the Free Software Foundation, either version 3 of the License, or
30-
* (at your option) any later version.
31-
*
32-
* Menza is distributed in the hope that it will be useful,
33-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
34-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35-
* GNU General Public License for more details.
36-
*
37-
* You should have received a copy of the GNU General Public License
38-
* along with Menza. If not, see <https://www.gnu.org/licenses/>.
39-
*/
40-
4120
plugins {
4221
alias(libs.plugins.lastaapps.kmp.library)
4322
}

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ detekt = "1.23.8"
1313
espresso = "3.7.0"
1414
google-ksp = "2.3.4"
1515
# @keep
16-
java-jvmTarget = "21"
16+
java-jvmTarget = "17"
1717
junit = "4.13.2"
1818
junit5-bom = "6.0.1"
1919
junitVersion = "1.3.0"
@@ -139,7 +139,7 @@ kotest-arrow = { module = "io.kotest.extensions:kotest-assertions-arrow", versio
139139
kotest-assertion = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
140140
kotest-jUnit5runner = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
141141
kotest-property = { module = "io.kotest:kotest-property", version.ref = "kotest" }
142-
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom" }
142+
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" }
143143
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" }
144144
kotlin-standardLib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" }
145145
kotlin-test-annotation = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common" }
@@ -251,9 +251,9 @@ ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlintGradle" }
251251
lastaapps-android-app = "android-app-convention:none"
252252
lastaapps-android-library = "android-library-convention:none"
253253
lastaapps-common-compose = "common-compose-convention:none"
254+
lastaapps-common-sqldelight = "common-sqldelight-convention:none"
254255
lastaapps-jvm-app = "jvm-app-convention:none"
255256
lastaapps-kmp-library = "kmp-library-convention:none"
256-
lastaapps-kmp-sqldelight = "kmp-sqldelight-convention:none"
257257
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
258258
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
259259
versionCatalogUpdate = "nl.littlerobots.version-catalog-update:1.0.1"

gradle/plugins/convention/build.gradle.kts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,13 @@ gradlePlugin {
9494
ids.common.compose,
9595
pkg("common.ComposeUIConvention"),
9696
)
97-
// plugin(
98-
// ids.common.coil,
99-
// pkg("common.CoilConvention"),
100-
// )
10197
plugin(
102-
ids.kmp.library,
103-
pkg("multiplatform.KMPLibraryConvention"),
98+
ids.common.sqldelight,
99+
pkg("common.SqlDelightConvention"),
104100
)
105101
plugin(
106-
ids.kmp.sqldelight,
107-
pkg("multiplatform.SqlDelightConvention"),
102+
ids.kmp.library,
103+
pkg("multiplatform.KMPLibraryConvention"),
108104
)
109105
plugin(
110106
ids.jvm.app,

0 commit comments

Comments
 (0)