Skip to content

Commit 5ff50ac

Browse files
authored
Merge pull request #59 from huanshankeji/upgrade-compose
Update Kotlin to 2.2.0-RC2, Compose to v1.8.1, the Gradle wrapper to v8.14.2, and AGP to v8.10.1
2 parents 73efae4 + db7c876 commit 5ff50ac

17 files changed

+2939
-55
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: huanshankeji/.github/actions/gradle-test-and-check@v0.1.0
2121
with:
22-
jdk-versions: 8-zulu, 17-temurin
22+
jdk-versions: 17-temurin
2323

2424
dependency-submission:
2525
strategy:

buildSrc/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ repositories {
1010
}
1111

1212
dependencies {
13-
val kotlinVersion = "2.1.0"
13+
val kotlinVersion = "2.2.0-RC2"
1414
implementation(kotlin("gradle-plugin", kotlinVersion))
1515
implementation("org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlinVersion")
16-
implementation("org.jetbrains.compose:compose-gradle-plugin:1.7.3")
16+
implementation("org.jetbrains.compose:compose-gradle-plugin:1.8.1")
1717
implementation("com.huanshankeji.team:gradle-plugins:0.9.0") // don't use a snapshot version in a main branch
18-
implementation("com.android.tools.build:gradle:8.7.3")
18+
implementation("com.android.tools.build:gradle:8.10.1")
1919
implementation("com.huanshankeji:common-gradle-dependencies:0.9.0-20241203") // don't use a snapshot version in a main branch
2020
}

buildSrc/src/main/kotlin/Android.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
val androidSdkVersion = 34 // bump to 35 when AGP and Kotlin are bumped
1+
val androidSdkVersion = 35

buildSrc/src/main/kotlin/VersionsAndDependencies.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ val commonDependencies = CommonDependencies()
77

88
object DependencyVersions {
99
const val composeMultiplatform = ComposeBuildConfig.composeVersion // for "ui-unit"
10+
11+
// https://slack-chats.kotlinlang.org/t/27579160/after-updating-to-1-8-0-rc01-package-androidx-compose-materi
12+
// https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.8.0-rc01
13+
const val composeMultiplatformMaterialIconsExtended = "1.7.3"
1014
val kobweb = "0.19.2"
1115
val huanshankejiComposeHtml = "0.4.0" // don't use a snapshot version in a main branch
1216
val kmdc = "0.1.2"

buildSrc/src/main/kotlin/common-conventions.gradle.kts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ kotlin {
2121
// for Compose UI
2222

2323
jvm() // TODO: `jvm("desktop")`?
24-
jvmToolchain(8)
24+
jvmToolchain(17)
2525

2626
//androidTarget()
2727

@@ -30,12 +30,17 @@ kotlin {
3030
iosSimulatorArm64()
3131

3232
@OptIn(ExperimentalWasmDsl::class)
33-
wasmJs()
33+
wasmJs {
34+
browser()
35+
}
3436

3537

3638
// for JS and HTML wrappers
3739

38-
js()
40+
js {
41+
// The project works without this, but it can be added to avoid potential issues.
42+
browser()
43+
}
3944

4045

4146

common/api/android/compose-multiplatform-html-unified-common.api

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public final class com/huanshankeji/compose/foundation/layout/Arrangement$Vertic
146146
}
147147

148148
public abstract interface class com/huanshankeji/compose/foundation/layout/BoxScope {
149-
public abstract fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment;)Lcom/huanshankeji/compose/ui/Modifier;
149+
public fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment;)Lcom/huanshankeji/compose/ui/Modifier;
150150
public abstract fun getPlatformBoxScope ()Landroidx/compose/foundation/layout/BoxScope;
151151
}
152152

@@ -180,9 +180,9 @@ public final class com/huanshankeji/compose/foundation/layout/ColumnKt {
180180
}
181181

182182
public abstract interface class com/huanshankeji/compose/foundation/layout/ColumnScope {
183-
public abstract fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment$Horizontal;)Lcom/huanshankeji/compose/ui/Modifier;
183+
public fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment$Horizontal;)Lcom/huanshankeji/compose/ui/Modifier;
184184
public abstract fun getPlatformValue ()Landroidx/compose/foundation/layout/ColumnScope;
185-
public abstract fun weight (Lcom/huanshankeji/compose/ui/Modifier;F)Lcom/huanshankeji/compose/ui/Modifier;
185+
public fun weight (Lcom/huanshankeji/compose/ui/Modifier;F)Lcom/huanshankeji/compose/ui/Modifier;
186186
}
187187

188188
public final class com/huanshankeji/compose/foundation/layout/ColumnScope$DefaultImpls {
@@ -261,9 +261,9 @@ public final class com/huanshankeji/compose/foundation/layout/RowKt {
261261
}
262262

263263
public abstract interface class com/huanshankeji/compose/foundation/layout/RowScope {
264-
public abstract fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment$Vertical;)Lcom/huanshankeji/compose/ui/Modifier;
264+
public fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment$Vertical;)Lcom/huanshankeji/compose/ui/Modifier;
265265
public abstract fun getPlatformValue ()Landroidx/compose/foundation/layout/RowScope;
266-
public abstract fun weight (Lcom/huanshankeji/compose/ui/Modifier;F)Lcom/huanshankeji/compose/ui/Modifier;
266+
public fun weight (Lcom/huanshankeji/compose/ui/Modifier;F)Lcom/huanshankeji/compose/ui/Modifier;
267267
}
268268

269269
public final class com/huanshankeji/compose/foundation/layout/RowScope$DefaultImpls {
@@ -665,10 +665,10 @@ public final class com/huanshankeji/compose/ui/Alignment$Vertical$Impl : com/hua
665665

666666
public abstract interface class com/huanshankeji/compose/ui/Modifier {
667667
public static final field Companion Lcom/huanshankeji/compose/ui/Modifier$Companion;
668-
public abstract fun foldIn (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
668+
public fun foldIn (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
669669
public abstract fun getPlatformModifier ()Landroidx/compose/ui/Modifier;
670-
public abstract fun platformModify (Lkotlin/jvm/functions/Function1;)Lcom/huanshankeji/compose/ui/Modifier;
671-
public abstract fun then (Lcom/huanshankeji/compose/ui/Modifier;)Lcom/huanshankeji/compose/ui/Modifier;
670+
public fun platformModify (Lkotlin/jvm/functions/Function1;)Lcom/huanshankeji/compose/ui/Modifier;
671+
public fun then (Lcom/huanshankeji/compose/ui/Modifier;)Lcom/huanshankeji/compose/ui/Modifier;
672672
}
673673

674674
public final class com/huanshankeji/compose/ui/Modifier$Companion : com/huanshankeji/compose/ui/Modifier {

common/api/jvm/compose-multiplatform-html-unified-common.api

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public final class com/huanshankeji/compose/foundation/layout/Arrangement$Vertic
146146
}
147147

148148
public abstract interface class com/huanshankeji/compose/foundation/layout/BoxScope {
149-
public abstract fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment;)Lcom/huanshankeji/compose/ui/Modifier;
149+
public fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment;)Lcom/huanshankeji/compose/ui/Modifier;
150150
public abstract fun getPlatformBoxScope ()Landroidx/compose/foundation/layout/BoxScope;
151151
}
152152

@@ -180,9 +180,9 @@ public final class com/huanshankeji/compose/foundation/layout/ColumnKt {
180180
}
181181

182182
public abstract interface class com/huanshankeji/compose/foundation/layout/ColumnScope {
183-
public abstract fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment$Horizontal;)Lcom/huanshankeji/compose/ui/Modifier;
183+
public fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment$Horizontal;)Lcom/huanshankeji/compose/ui/Modifier;
184184
public abstract fun getPlatformValue ()Landroidx/compose/foundation/layout/ColumnScope;
185-
public abstract fun weight (Lcom/huanshankeji/compose/ui/Modifier;F)Lcom/huanshankeji/compose/ui/Modifier;
185+
public fun weight (Lcom/huanshankeji/compose/ui/Modifier;F)Lcom/huanshankeji/compose/ui/Modifier;
186186
}
187187

188188
public final class com/huanshankeji/compose/foundation/layout/ColumnScope$DefaultImpls {
@@ -261,9 +261,9 @@ public final class com/huanshankeji/compose/foundation/layout/RowKt {
261261
}
262262

263263
public abstract interface class com/huanshankeji/compose/foundation/layout/RowScope {
264-
public abstract fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment$Vertical;)Lcom/huanshankeji/compose/ui/Modifier;
264+
public fun align (Lcom/huanshankeji/compose/ui/Modifier;Lcom/huanshankeji/compose/ui/Alignment$Vertical;)Lcom/huanshankeji/compose/ui/Modifier;
265265
public abstract fun getPlatformValue ()Landroidx/compose/foundation/layout/RowScope;
266-
public abstract fun weight (Lcom/huanshankeji/compose/ui/Modifier;F)Lcom/huanshankeji/compose/ui/Modifier;
266+
public fun weight (Lcom/huanshankeji/compose/ui/Modifier;F)Lcom/huanshankeji/compose/ui/Modifier;
267267
}
268268

269269
public final class com/huanshankeji/compose/foundation/layout/RowScope$DefaultImpls {
@@ -665,10 +665,10 @@ public final class com/huanshankeji/compose/ui/Alignment$Vertical$Impl : com/hua
665665

666666
public abstract interface class com/huanshankeji/compose/ui/Modifier {
667667
public static final field Companion Lcom/huanshankeji/compose/ui/Modifier$Companion;
668-
public abstract fun foldIn (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
668+
public fun foldIn (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
669669
public abstract fun getPlatformModifier ()Landroidx/compose/ui/Modifier;
670-
public abstract fun platformModify (Lkotlin/jvm/functions/Function1;)Lcom/huanshankeji/compose/ui/Modifier;
671-
public abstract fun then (Lcom/huanshankeji/compose/ui/Modifier;)Lcom/huanshankeji/compose/ui/Modifier;
670+
public fun platformModify (Lkotlin/jvm/functions/Function1;)Lcom/huanshankeji/compose/ui/Modifier;
671+
public fun then (Lcom/huanshankeji/compose/ui/Modifier;)Lcom/huanshankeji/compose/ui/Modifier;
672672
}
673673

674674
public final class com/huanshankeji/compose/ui/Modifier$Companion : com/huanshankeji/compose/ui/Modifier {

demo/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ android {
113113
}
114114
}
115115

116-
val jsBrowserDistribution by tasks.getting(Copy::class)
117-
val wasmJsBrowserDistribution by tasks.getting(Copy::class)
116+
val jsBrowserDistribution by tasks.getting(Sync::class)
117+
val wasmJsBrowserDistribution by tasks.getting(Sync::class)
118118

119119
tasks.register<Sync>("sideBySideBrowserDistribution") {
120120
group = "kotlin browser"

gradle/wrapper/gradle-wrapper.jar

181 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ done
8686
# shellcheck disable=SC2034
8787
APP_BASE_NAME=${0##*/}
8888
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90-
' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
9190

9291
# Use the maximum available, or set MAX_FD != -1 to use that value.
9392
MAX_FD=maximum
@@ -115,7 +114,7 @@ case "$( uname )" in #(
115114
NONSTOP* ) nonstop=true ;;
116115
esac
117116

118-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
119118

120119

121120
# Determine the Java command to use to start the JVM.
@@ -206,15 +205,15 @@ fi
206205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
207206

208207
# Collect all arguments for the java command:
209-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210209
# and any embedded shellness will be escaped.
211210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212211
# treated as '${Hostname}' itself on the command line.
213212

214213
set -- \
215214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
216215
-classpath "$CLASSPATH" \
217-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
218217
"$@"
219218

220219
# Stop when "xargs" is not available.

gradlew.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7474

7575

7676
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7878

7979
:end
8080
@rem End local scope for the variables with windows NT shell

0 commit comments

Comments
 (0)