Skip to content

Commit 31d036e

Browse files
authored
Merge pull request #74 from joreilly/dependency_updates
Kotlin 2.0.0-RC2, new compose compiler plugin + related dependencies
2 parents f86a51e + 80d2eba commit 31d036e

File tree

7 files changed

+12
-45
lines changed

7 files changed

+12
-45
lines changed

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ Running on
1010
* Kotlin Notebook
1111

1212

13-
14-
Code is very minimal right now with Compose code using remote apis directly. Will choose/add persistence library once those libraries support Wasm along
15-
with associated Repository. Also need to add some sort of shared view model/state holder. Have started using Voyager for navigation in the Android client
16-
and need to evaulate whether this could/should be used for other clients (again needs Wasm support first).
17-
18-
1913
### Android (Compose)
2014

2115

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
alias(libs.plugins.androidApplication) apply false
33
alias(libs.plugins.ksp) apply false
44
alias(libs.plugins.androidLibrary) apply false
5+
alias(libs.plugins.compose.compiler) apply false
56
alias(libs.plugins.jetbrainsCompose) apply false
67
alias(libs.plugins.kotlinMultiplatform) apply false
78
alias(libs.plugins.kmpNativeCoroutines) apply false

composeApp/build.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ plugins {
66
alias(libs.plugins.kotlinMultiplatform)
77
alias(libs.plugins.androidApplication)
88
alias(libs.plugins.jetbrainsCompose)
9+
alias(libs.plugins.compose.compiler)
910
alias(libs.plugins.kotlinx.serialization)
1011
alias(libs.plugins.ksp)
1112
alias(libs.plugins.kmpNativeCoroutines)
@@ -174,14 +175,6 @@ compose.experimental {
174175
web.application {}
175176
}
176177

177-
compose {
178-
kotlinCompilerPlugin.set(libs.versions.compose.compiler)
179-
kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=${libs.versions.kotlin}")
180-
}
181-
182-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
183-
kotlinOptions.jvmTarget = "17"
184-
}
185178

186179
kotlin.sourceSets.all {
187180
languageSettings.optIn("kotlin.experimental.ExperimentalObjCName")

composeApp/src/commonMain/kotlin/dev/johnoreilly/climatetrace/ui/ClimateTraceScreen.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import androidx.compose.animation.core.animateDpAsState
77
import androidx.compose.animation.fadeIn
88
import androidx.compose.animation.fadeOut
99
import androidx.compose.foundation.background
10-
import androidx.compose.foundation.border
1110
import androidx.compose.foundation.clickable
1211
import androidx.compose.foundation.layout.Arrangement
1312
import androidx.compose.foundation.layout.Box
@@ -44,28 +43,22 @@ import androidx.compose.runtime.getValue
4443
import androidx.compose.runtime.mutableStateOf
4544
import androidx.compose.runtime.remember
4645
import androidx.compose.ui.Alignment
47-
import androidx.compose.ui.ExperimentalComposeUiApi
4846
import androidx.compose.ui.Modifier
4947
import androidx.compose.ui.graphics.Color
5048
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
5149
import androidx.compose.ui.unit.dp
5250
import cafe.adriel.voyager.core.screen.Screen
53-
import cafe.adriel.voyager.navigator.LocalNavigator
54-
import cafe.adriel.voyager.navigator.currentOrThrow
55-
import dev.johnoreilly.climatetrace.remote.ClimateTraceApi
5651
import dev.johnoreilly.climatetrace.remote.Country
5752
import dev.johnoreilly.climatetrace.ui.utils.PanelState
5853
import dev.johnoreilly.climatetrace.ui.utils.ResizablePanel
5954
import dev.johnoreilly.climatetrace.viewmodel.ClimateTraceViewModel
6055
import org.koin.compose.koinInject
61-
import org.koin.core.component.inject
6256

6357

6458
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
6559
class ClimateTraceScreen: Screen {
6660
@Composable
6761
override fun Content() {
68-
val navigator = LocalNavigator.currentOrThrow
6962
val windowSizeClass = calculateWindowSizeClass()
7063
val viewModel = koinInject<ClimateTraceViewModel>()
7164

@@ -179,7 +172,7 @@ fun CountryListView(
179172
}
180173
}
181174

182-
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
175+
@OptIn(ExperimentalMaterial3Api::class)
183176
@Composable
184177
fun SearchableList(
185178
isLoading: Boolean,

composeApp/src/commonMain/kotlin/dev/johnoreilly/climatetrace/ui/CountryAssetEmissionsInfoTreeMapChart.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fun CountryAssetEmissionsInfoTreeMapChart(countryAssetEmissions: List<CountryAss
4141
var tree by remember { mutableStateOf<Tree<ChartNode>?>(null) }
4242

4343
LaunchedEffect(countryAssetEmissions) {
44-
tree = buildAssetTree(countryAssetEmissions ?: emptyList())
44+
tree = buildAssetTree(countryAssetEmissions)
4545
}
4646

4747
Column(Modifier.height(500.dp).fillMaxWidth(0.8f)) {

composeApp/src/commonMain/kotlin/dev/johnoreilly/climatetrace/ui/CountryEmissionsScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package dev.johnoreilly.climatetrace.ui
33
import androidx.compose.foundation.layout.Column
44
import androidx.compose.foundation.layout.padding
55
import androidx.compose.material.icons.Icons
6-
import androidx.compose.material.icons.filled.ArrowBack
6+
import androidx.compose.material.icons.automirrored.filled.ArrowBack
77
import androidx.compose.material3.*
88
import androidx.compose.runtime.Composable
99
import androidx.compose.runtime.LaunchedEffect
@@ -41,7 +41,7 @@ data class CountryEmissionsScreen(val country: Country) : Screen {
4141
},
4242
navigationIcon = {
4343
IconButton(onClick = { navigator.pop() }) {
44-
Icon(Icons.Filled.ArrowBack, contentDescription = "Back")
44+
Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Back")
4545
}
4646
}
4747
)

gradle/libs.versions.toml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@ agp = "8.2.2"
33
android-compileSdk = "34"
44
android-minSdk = "24"
55
android-targetSdk = "34"
6-
androidx-activityCompose = "1.8.2"
6+
androidx-activityCompose = "1.9.0"
77
androidx-appcompat = "1.6.1"
88
androidx-constraintlayout = "2.1.4"
9-
androidx-core-ktx = "1.12.0"
9+
androidx-core-ktx = "1.13.0"
1010
androidx-espresso-core = "3.5.1"
1111
androidx-material = "1.11.0"
1212
androidx-test-junit = "1.1.5"
13-
compose = "1.6.5"
14-
compose-compiler = "1.5.11-kt-2.0.0-RC1"
15-
compose-plugin = "1.6.2"
13+
compose = "1.6.6"
14+
compose-plugin = "1.6.10-beta03"
1615
composeWindowSize = "0.5.0"
1716
harawata-appdirs = "1.2.1"
1817
imageLoader = "1.7.8"
1918
junit = "4.13.2"
2019
koalaplot = "0.5.3"
2120
koin = "3.6.0-alpha3"
2221
koinCompose = "1.2.0-alpha3"
23-
kotlin = "2.0.0-RC1"
22+
kotlin = "2.0.0-RC2"
2423
kotlinx-coroutines = "1.8.0"
2524
kmpNativeCoroutines = "1.0.0-ALPHA-28-kotlin-2.0.0-RC1"
2625
kmmViewModel = "1.0.0-ALPHA-20-kotlin-2.0.0-RC1"
@@ -32,22 +31,10 @@ voyager= "1.1.0-alpha03"
3231

3332

3433
[libraries]
35-
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
36-
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
37-
junit = { group = "junit", name = "junit", version.ref = "junit" }
38-
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidx-core-ktx" }
39-
androidx-test-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-junit" }
40-
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso-core" }
41-
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidx-appcompat" }
42-
androidx-material = { group = "com.google.android.material", name = "material", version.ref = "androidx-material" }
43-
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }
4434
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
4535

46-
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
4736
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
4837
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
49-
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
50-
compose-material = { module = "androidx.compose.material:material", version.ref = "compose" }
5138
compose-window-size = { module = "dev.chrisbanes.material3:material3-window-size-class-multiplatform", version.ref = "composeWindowSize" }
5239

5340
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
@@ -62,7 +49,6 @@ kstore = { module = "io.github.xxfast:kstore", version.ref = "kstore" }
6249
kstore-file = { module = "io.github.xxfast:kstore-file", version.ref = "kstore" }
6350
kstore-storage = { module = "io.github.xxfast:kstore-storage", version.ref = "kstore" }
6451

65-
ktor = { group = "io.ktor", name = "ktor", version.ref = "ktor" }
6652
ktor-client-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
6753
ktor-client-json = { group = "io.ktor", name = "ktor-client-json", version.ref = "ktor" }
6854
ktor-client-logging = { group = "io.ktor", name = "ktor-client-logging", version.ref = "ktor" }
@@ -75,7 +61,6 @@ ktor-client-java = { group = "io.ktor", name = "ktor-client-java", version.ref =
7561

7662
voyager = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" }
7763
harawata-appdirs = { module = "net.harawata:appdirs", version.ref = "harawata-appdirs" }
78-
imageLoader = { module = "io.github.qdsfdhvh:image-loader", version.ref = "imageLoader" }
7964
koalaplot = { module = "io.github.koalaplot:koalaplot-core", version.ref = "koalaplot" }
8065
treemap-chart = { module = "io.github.overpas:treemap-chart", version.ref = "treemapChart" }
8166
treemap-chart-compose = { module = "io.github.overpas:treemap-chart-compose", version.ref = "treemapChart" }
@@ -89,6 +74,7 @@ ktor-common = ["ktor-client-core", "ktor-client-json", "ktor-client-logging", "k
8974
androidApplication = { id = "com.android.application", version.ref = "agp" }
9075
androidLibrary = { id = "com.android.library", version.ref = "agp" }
9176
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
77+
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
9278
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
9379
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
9480
kmpNativeCoroutines = { id = "com.rickclephas.kmp.nativecoroutines", version.ref = "kmpNativeCoroutines" }

0 commit comments

Comments
 (0)