Skip to content

Commit 3ace7d2

Browse files
committed
update versions
1 parent e35630f commit 3ace7d2

File tree

6 files changed

+23
-11
lines changed

6 files changed

+23
-11
lines changed

gradle/libs.versions.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[versions]
2-
compose-multiplatform = "1.7.0"
3-
kotlin = "2.1.0"
4-
kotlinx-coroutines = "1.9.0"
5-
kotlinx-datetime = "0.6.1"
6-
kotlinx-io = "0.6.0"
2+
compose-multiplatform = "1.9.3"
3+
kotlin = "2.2.21"
4+
kotlinx-coroutines = "1.10.2"
5+
kotlinx-datetime = "0.7.1"
6+
kotlinx-browser = "0.5.0"
7+
kotlinx-io = "0.8.2"
78
kotlin-bignum = "0.3.10"
89

910
[libraries]
@@ -12,6 +13,7 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c
1213
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
1314
kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version.ref = "kotlinx-io" }
1415
kotlin-bignum = { module = "com.ionspin.kotlin:bignum", version.ref = "kotlin-bignum" }
16+
kotlinx-browser = { module = "org.jetbrains.kotlinx:kotlinx-browser", version.ref = "kotlinx-browser" }
1517

1618
[plugins]
1719
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }

runner/src/commonMain/kotlin/in/procyk/adventofcode/runner/Advent.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import `in`.procyk.adventofcode.solutions.Advent
44
import kotlinx.coroutines.*
55
import kotlinx.coroutines.channels.Channel
66
import kotlinx.coroutines.flow.consumeAsFlow
7+
import kotlin.time.ExperimentalTime
78
import kotlin.time.measureTime
89

910
fun Advent.solve(
1011
with: FileAdventInputReader = FileAdventInputReader(),
1112
) {
1213
runBlocking(Dispatchers.Default) {
14+
@OptIn(ExperimentalTime::class)
1315
val today = today()
1416
val debug = Channel<String>()
1517
try {
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
package `in`.procyk.adventofcode.solutions
22

3-
import kotlinx.datetime.Clock
4-
import kotlinx.datetime.Instant
53
import kotlinx.datetime.TimeZone
4+
import kotlinx.datetime.number
65
import kotlinx.datetime.toLocalDateTime
6+
import kotlin.time.Clock
7+
import kotlin.time.ExperimentalTime
8+
import kotlin.time.Instant
79

810
abstract class Advent {
911
abstract val year: Int
1012
abstract val days: List<AdventDay>
1113

14+
@OptIn(ExperimentalTime::class)
1215
fun today(now: Instant = Clock.System.now()): AdventDay? {
1316
val localDateTime = now.toLocalDateTime(TimeZone.of("UTC-5"))
1417
if (localDateTime.year != year) return null
15-
if (localDateTime.monthNumber != 12) return null
16-
return days.firstOrNull { it.n == localDateTime.dayOfMonth }
18+
if (localDateTime.month.number != 12) return null
19+
return days.firstOrNull { it.n == localDateTime.day }
1720
}
1821
}

solver/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ kotlin {
2222

2323
implementation(compose.foundation)
2424
implementation(compose.material3)
25+
implementation(compose.materialIconsExtended)
2526
implementation(compose.components.resources)
2627
}
28+
29+
webMain.dependencies {
30+
api(libs.kotlinx.browser)
31+
}
2732
}
2833
}

solver/src/commonMain/kotlin/in/procyk/adventofcode/solver/AdventSolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ private inline fun <R : Any> Builder.withColorStyle(
222222
private enum class AdventYearStyle(val prefix: String, val suffix: String) {
223223
Clean("", ""),
224224
Json("{'year': ", "}"),
225-
Php("\$year = ", ";"),
225+
Php($$"$year = ", ";"),
226226
Yaml("year: ", ""),
227227
Python("year = ", ""),
228228
Haskell("λy.", ""),

solver/src/wasmJsMain/kotlin/in/procyk/adventofcode/solver/AdventWebSolver.kt renamed to solver/src/webMain/kotlin/in/procyk/adventofcode/solver/AdventWebSolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import kotlinx.browser.document
88

99
@OptIn(ExperimentalComposeUiApi::class)
1010
fun adventWebSolver(advent: Advent) {
11-
ComposeViewport(document.body!!) {
11+
ComposeViewport {
1212
AdventSolver(
1313
advent = advent,
1414
onDaySelected = { selectedDay ->

0 commit comments

Comments
 (0)