Skip to content

Commit e1a4b3e

Browse files
chore: upgrade Kotlin toolchain and align Compose 1.9.1
1 parent 59d980a commit e1a4b3e

File tree

18 files changed

+77
-70
lines changed

18 files changed

+77
-70
lines changed

sdks/community/kotlin/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
22

3-
plugins {
4-
kotlin("multiplatform") version "2.1.21"
5-
kotlin("plugin.serialization") version "2.1.21"
3+
plugins {
4+
kotlin("multiplatform") version "2.2.20"
5+
kotlin("plugin.serialization") version "2.2.20"
66
id("com.android.library") version "8.2.2"
77
id("io.gitlab.arturbosch.detekt") version "1.23.4"
88
id("maven-publish")
@@ -34,8 +34,8 @@ kotlin {
3434
freeCompilerArgs.add("-Xopt-in=kotlin.RequiresOptIn")
3535
freeCompilerArgs.add("-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi")
3636
freeCompilerArgs.add("-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi")
37-
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_1)
38-
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_1)
37+
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_2)
38+
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_2)
3939
}
4040
}
4141
}
@@ -226,4 +226,4 @@ tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
226226
sarif.required.set(true)
227227
md.required.set(true)
228228
}
229-
}
229+
}

sdks/community/kotlin/examples/chatapp/androidApp/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ android {
2121
}
2222

2323
composeOptions {
24-
kotlinCompilerExtensionVersion = "1.6.21"
24+
kotlinCompilerExtensionVersion = "1.5.15"
2525
}
2626

2727
packagingOptions {
@@ -62,4 +62,4 @@ dependencies {
6262
// }
6363
// }
6464
// }
65-
//}
65+
//}

sdks/community/kotlin/examples/chatapp/gradle.properties

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ kotlin.code.style=official
1010
kotlin.mpp.androidSourceSetLayoutVersion=2
1111
kotlin.mpp.applyDefaultHierarchyTemplate=false
1212
kotlin.native.cacheKind=none
13-
kotlin.native.useEmbeddableCompilerJar=true
1413
kotlin.mpp.enableCInteropCommonization=true
1514

1615
# Compose
@@ -26,10 +25,10 @@ android.nonTransitiveRClass=true
2625
xcodeproj=./iosApp
2726

2827
# K2 Compiler Settings
29-
kotlin.compiler.version=2.2.0
28+
kotlin.compiler.version=2.2.20
3029
kotlin.compiler.languageVersion=2.2
3130
kotlin.compiler.apiVersion=2.2
3231
kotlin.compiler.k2=true
3332

3433
# Disable Kotlin Native bundling service
35-
kotlin.native.disableCompilerDaemon=true
34+
kotlin.native.disableCompilerDaemon=true

sdks/community/kotlin/examples/chatapp/gradle/libs.versions.toml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ core = "1.6.1"
66
core-ktx = "1.16.0"
77
junit = "4.13.2"
88
junit-version = "1.2.1"
9-
kotlin = "2.1.21"
9+
kotlin = "2.2.20"
1010
#Downgrading to avoid an R8 error
1111
ktor = "3.1.3"
1212
kotlinx-serialization = "1.8.1"
@@ -19,17 +19,18 @@ multiplatform-settings-coroutines = "1.2.0"
1919
okio = "3.13.0"
2020
runner = "1.6.2"
2121
slf4j = "2.0.9"
22-
ui-test-junit4 = "1.8.3"
2322
voyager-navigator = "1.0.0"
24-
compose-richtext = "1.0.0-alpha03"
23+
markdown-renderer = "0.37.0"
24+
compose = "1.9.1"
25+
compose-material3 = "1.4.0"
2526

2627
[libraries]
2728
# Ktor
2829
activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity-compose" }
2930
agui-client = { module = "com.agui:kotlin-client", version.ref = "agui-core" }
3031
agui-core = { module = "com.agui:kotlin-core", version.ref = "agui-core" }
3132
agui-tools = { module = "com.agui:kotlin-tools", version.ref = "agui-core" }
32-
androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "ui-test-junit4" }
33+
androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
3334
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
3435
core = { module = "androidx.test:core", version.ref = "core" }
3536
core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" }
@@ -59,13 +60,19 @@ multiplatform-settings-coroutines = { module = "com.russhwolf:multiplatform-sett
5960
okio = { module = "com.squareup.okio:okio", version.ref = "okio" }
6061
runner = { module = "androidx.test:runner", version.ref = "runner" }
6162
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }
62-
ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "ui-test-junit4" }
63+
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" }
64+
androidx-compose-runtime-saveable = { module = "androidx.compose.runtime:runtime-saveable", version.ref = "compose" }
65+
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
66+
androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "compose" }
67+
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
68+
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
69+
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
70+
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" }
71+
ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" }
6372
voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager-navigator" }
6473
voyager-screenmodel = { module = "cafe.adriel.voyager:voyager-screenmodel", version.ref = "voyager-navigator" }
6574
voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", version.ref = "voyager-navigator" }
66-
richtext-commonmark = { module = "com.halilibo.compose-richtext:richtext-commonmark", version.ref = "compose-richtext" }
67-
richtext-ui = { module = "com.halilibo.compose-richtext:richtext-ui", version.ref = "compose-richtext" }
68-
richtext-ui-material3 = { module = "com.halilibo.compose-richtext:richtext-ui-material3", version.ref = "compose-richtext" }
75+
markdown-renderer-m3 = { module = "com.mikepenz:multiplatform-markdown-renderer-m3", version.ref = "markdown-renderer" }
6976

7077
[plugins]
7178
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
@@ -84,4 +91,4 @@ kotlinx-common = [
8491
"kotlinx-coroutines-core",
8592
"kotlinx-serialization-json",
8693
"kotlinx-datetime"
87-
]
94+
]

sdks/community/kotlin/examples/chatapp/iosApp/iosApp.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 54;
6+
objectVersion = 56;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -286,6 +286,7 @@
286286
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
287287
CODE_SIGN_STYLE = Automatic;
288288
DEVELOPMENT_ASSET_PATHS = "";
289+
DEVELOPMENT_TEAM = 96FAHJ5ZD7;
289290
ENABLE_PREVIEWS = YES;
290291
FRAMEWORK_SEARCH_PATHS = (
291292
"$(inherited)",
@@ -301,7 +302,7 @@
301302
"-framework",
302303
shared,
303304
);
304-
PRODUCT_BUNDLE_IDENTIFIER = "com.agui.example.chatapp";
305+
PRODUCT_BUNDLE_IDENTIFIER = com.agui.example.chatapp;
305306
PRODUCT_NAME = "$(TARGET_NAME)";
306307
SWIFT_VERSION = 5.0;
307308
TARGETED_DEVICE_FAMILY = "1,2";
@@ -314,6 +315,7 @@
314315
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
315316
CODE_SIGN_STYLE = Automatic;
316317
DEVELOPMENT_ASSET_PATHS = "";
318+
DEVELOPMENT_TEAM = 96FAHJ5ZD7;
317319
ENABLE_PREVIEWS = YES;
318320
FRAMEWORK_SEARCH_PATHS = (
319321
"$(inherited)",
@@ -329,7 +331,7 @@
329331
"-framework",
330332
shared,
331333
);
332-
PRODUCT_BUNDLE_IDENTIFIER = "com.agui.example.chatapp";
334+
PRODUCT_BUNDLE_IDENTIFIER = com.agui.example.chatapp;
333335
PRODUCT_NAME = "$(TARGET_NAME)";
334336
SWIFT_VERSION = 5.0;
335337
TARGETED_DEVICE_FAMILY = "1,2";
@@ -360,4 +362,4 @@
360362
/* End XCConfigurationList section */
361363
};
362364
rootObject = 7555FF73242A565900829871 /* Project object */;
363-
}
365+
}

sdks/community/kotlin/examples/chatapp/settings.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pluginManagement {
1919
}
2020

2121
plugins {
22-
val kotlinVersion = "2.1.21"
23-
val composeVersion = "1.7.3"
22+
val kotlinVersion = "2.2.20"
23+
val composeVersion = "1.9.0-rc02"
2424
val agpVersion = "8.10.1"
2525

2626
kotlin("multiplatform") version kotlinVersion
@@ -43,4 +43,4 @@ dependencyResolutionManagement {
4343
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
4444
mavenLocal()
4545
}
46-
}
46+
}

sdks/community/kotlin/examples/chatapp/shared/build.gradle.kts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ kotlin {
8282
implementation(libs.okio)
8383

8484
// Markdown rendering
85-
implementation(libs.richtext.commonmark)
86-
implementation(libs.richtext.ui)
87-
implementation(libs.richtext.ui.material3)
85+
implementation(libs.markdown.renderer.m3)
8886
}
8987
}
9088

@@ -101,6 +99,13 @@ kotlin {
10199
api(libs.activity.compose)
102100
api(libs.appcompat)
103101
api(libs.core.ktx)
102+
implementation(libs.androidx.compose.runtime)
103+
implementation(libs.androidx.compose.runtime.saveable)
104+
implementation(libs.androidx.compose.foundation)
105+
implementation(libs.androidx.compose.material)
106+
implementation(libs.androidx.compose.material3)
107+
implementation(libs.androidx.compose.ui)
108+
implementation(libs.androidx.compose.ui.tooling.preview)
104109
implementation(libs.ktor.client.android)
105110
}
106111
}
@@ -123,7 +128,7 @@ kotlin {
123128

124129
// Fixed Compose testing dependencies with explicit versions
125130
implementation(libs.ui.test.junit4)
126-
implementation("androidx.compose.ui:ui-test-manifest:1.8.3")
131+
implementation(libs.androidx.compose.ui.test.manifest)
127132
implementation(libs.activity.compose)
128133
implementation(libs.androidx.ui.tooling)
129134
}

sdks/community/kotlin/examples/chatapp/shared/src/commonMain/kotlin/com/agui/example/chatapp/ui/screens/chat/components/MessageBubble.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import androidx.compose.ui.text.style.TextAlign
2222
import androidx.compose.ui.unit.dp
2323
import com.agui.example.chatapp.ui.screens.chat.DisplayMessage
2424
import com.agui.example.chatapp.ui.screens.chat.MessageRole
25-
import com.halilibo.richtext.commonmark.Markdown
26-
import com.halilibo.richtext.ui.material3.RichText
25+
import com.mikepenz.markdown.m3.Markdown
2726
import kotlinx.datetime.Instant
2827
import kotlinx.datetime.TimeZone
2928
import kotlinx.datetime.toLocalDateTime
@@ -166,13 +165,12 @@ fun MessageBubble(
166165
// Regular text for non-ephemeral messages
167166
ProvideTextStyle(MaterialTheme.typography.bodyLarge) {
168167
CompositionLocalProvider(LocalContentColor provides messageTextColor) {
169-
RichText(
168+
Markdown(
169+
content = message.content,
170170
modifier = Modifier
171171
.fillMaxWidth()
172172
.semantics { text = AnnotatedString(message.content) }
173-
) {
174-
Markdown(message.content)
175-
}
173+
)
176174
}
177175
}
178176
}

sdks/community/kotlin/examples/tools/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ kotlin {
2323
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
2424
freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi")
2525
freeCompilerArgs.add("-opt-in=kotlinx.serialization.ExperimentalSerializationApi")
26-
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_1)
27-
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_1)
26+
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_2)
27+
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_2)
2828
}
2929
}
3030
}
@@ -131,4 +131,4 @@ android {
131131

132132
tasks.withType<Test> {
133133
useJUnitPlatform()
134-
}
134+
}

sdks/community/kotlin/examples/tools/gradle.properties

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ kotlin.code.style=official
99
kotlin.mpp.androidSourceSetLayoutVersion=2
1010
kotlin.mpp.applyDefaultHierarchyTemplate=false
1111
kotlin.native.cacheKind=none
12-
kotlin.native.useEmbeddableCompilerJar=true
1312
kotlin.mpp.enableCInteropCommonization=true
1413

1514
# Compose
@@ -25,10 +24,10 @@ android.nonTransitiveRClass=true
2524
xcodeproj=./iosApp
2625

2726
# K2 Compiler Settings
28-
kotlin.compiler.version=2.1.21
29-
kotlin.compiler.languageVersion=2.1
30-
kotlin.compiler.apiVersion=2.1
27+
kotlin.compiler.version=2.2.20
28+
kotlin.compiler.languageVersion=2.2
29+
kotlin.compiler.apiVersion=2.2
3130
kotlin.compiler.k2=true
3231

3332
# Disable Kotlin Native bundling service
34-
kotlin.native.disableCompilerDaemon=true
33+
kotlin.native.disableCompilerDaemon=true

0 commit comments

Comments
 (0)