From d4921e3dd83e2ee6f396c394062f4175a5f32a57 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 23 Sep 2024 12:53:02 -0400 Subject: [PATCH 1/6] Prep for Kotlin 2.1.0 --- build.gradle.kts | 1 - gradle.properties | 1 - gradle/libs.versions.toml | 8 +++----- kotlin-js-store/yarn.lock | 7 +++++++ samples/counter/apps/gradle.properties | 3 --- samples/counter/gradle.properties | 6 +++++- 6 files changed, 15 insertions(+), 11 deletions(-) delete mode 100644 samples/counter/apps/gradle.properties diff --git a/build.gradle.kts b/build.gradle.kts index 3ec6e054a..cbcd844ba 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,7 +48,6 @@ plugins { alias(libs.plugins.mavenPublish) apply false alias(libs.plugins.dokka) alias(libs.plugins.ksp) apply false - alias(libs.plugins.versionsPlugin) alias(libs.plugins.dependencyGuard) apply false alias(libs.plugins.compose) apply false alias(libs.plugins.kotlin.plugin.compose) apply false diff --git a/gradle.properties b/gradle.properties index 51d4899b0..12801c482 100644 --- a/gradle.properties +++ b/gradle.properties @@ -48,7 +48,6 @@ dependency.analysis.compatibility=NONE # Disable noisy stability warning kotlin.mpp.stability.nowarn=true kotlin.mpp.androidSourceSetLayoutVersion=2 -kotlin.mpp.androidGradlePluginCompatibility.nowarn=true # Ignore disabled targets (i.e iOS on Linux) kotlin.native.ignoreDisabledTargets=true kotlin.apple.xcodeCompatibility.nowarn=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0b7bd6e88..ad5821ac9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -27,14 +27,14 @@ eithernet = "2.0.0-alpha01" jdk = "22" jvmTarget = "11" publishedJvmTarget = "1.8" -kct = "0.5.1" -kotlin = "2.0.20" +kct = "0.6.0-alpha01" +kotlin = "2.1.0-Beta1" kotlinInject = "0.7.2" kotlinInject-anvil = "0.0.4" kotlinpoet = "1.18.1" kotlinx-coroutines = "1.9.0" kotlinx-serialization = "1.7.3" -ksp = "2.0.20-1.0.25" +ksp = "2.1.0-Beta1-1.0.25" ktfmt = "0.52" ktor = "2.3.12" leakcanary = "2.14" @@ -54,7 +54,6 @@ sqldelight = "2.0.2" telephoto = "0.13.0" testParameterInjector = "1.17" turbine = "1.1.0" -versionsPlugin = "0.49.0" [plugins] agp-application = { id = "com.android.application", version.ref = "agp" } @@ -85,7 +84,6 @@ roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" } skie = { id = "co.touchlab.skie", version.ref = "skie"} spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } -versionsPlugin = { id = "com.github.ben-manes.versions", version.ref = "versionsPlugin" } [libraries] agp = { module = "com.android.tools.build:gradle", version.ref = "agp" } diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index 4401cd24e..358e32eda 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -1608,6 +1608,13 @@ kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +kotlin-web-helpers@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/kotlin-web-helpers/-/kotlin-web-helpers-2.0.0.tgz#b112096b273c1e733e0b86560998235c09a19286" + integrity sha512-xkVGl60Ygn/zuLkDPx+oHj7jeLR7hCvoNF99nhwXMn8a3ApB4lLiC9pk4ol4NHPjyoCbvQctBqvzUcp8pkqyWw== + dependencies: + format-util "^1.0.5" + launch-editor@^2.6.0: version "2.8.1" resolved "https://registry.yarnpkg.com/launch-editor/-/launch-editor-2.8.1.tgz#3bda72af213ec9b46b170e39661916ec66c2f463" diff --git a/samples/counter/apps/gradle.properties b/samples/counter/apps/gradle.properties deleted file mode 100644 index 5e6a37a18..000000000 --- a/samples/counter/apps/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Basically the JS equivalent of a fat jar -# TODO retry without this after 1.9.10 https://youtrack.jetbrains.com/issue/KT-60852 -kotlin.js.ir.output.granularity=whole-program \ No newline at end of file diff --git a/samples/counter/gradle.properties b/samples/counter/gradle.properties index e83f1e8f0..b0c25cfee 100644 --- a/samples/counter/gradle.properties +++ b/samples/counter/gradle.properties @@ -1,2 +1,6 @@ # https://kotlinlang.org/docs/native-ios-integration.html#calling-kotlin-suspending-functions -kotlin.native.binary.objcExportSuspendFunctionLaunchThreadRestriction=none \ No newline at end of file +kotlin.native.binary.objcExportSuspendFunctionLaunchThreadRestriction=none + +# Override for SKIE's KGP version check +# Comment this out when not used, as it's easier to find here when we need to test new versions +skie.kgpVersion=2.0.20 \ No newline at end of file From 342f96071ac40148a49b20b42c5de9159f67c79f Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 23 Sep 2024 12:56:33 -0400 Subject: [PATCH 2/6] K2 kapt wiring --- build.gradle.kts | 17 ++++++++++++----- gradle.properties | 1 - 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cbcd844ba..9d0aa9e21 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -166,15 +166,22 @@ subprojects { } val hasCompose = !project.hasProperty("circuit.noCompose") + val useK2Kapt = providers.gradleProperty("kapt.use.k2") + .map { it.toBooleanStrict() } + .getOrElse(false) plugins.withType { tasks.withType>().configureEach { - // Don't double apply to stub gen if (this is KaptGenerateStubsTask) { - // TODO due to Anvil we need to force language version 1.9 - compilerOptions { - progressiveMode.set(false) - languageVersion.set(KotlinVersion.KOTLIN_1_9) + if (useK2Kapt) { + // K2 Kapt is in alpha + compilerOptions.allWarningsAsErrors.set(false) + } else { + compilerOptions { + progressiveMode.set(false) + languageVersion.set(KotlinVersion.KOTLIN_1_9) + } } + // Don't double apply to stub gen return@configureEach } val isWasmTask = name.contains("wasm", ignoreCase = true) diff --git a/gradle.properties b/gradle.properties index 12801c482..f983fa888 100644 --- a/gradle.properties +++ b/gradle.properties @@ -34,7 +34,6 @@ android.lint.useK2Uast=true ksp.useKSP2=false # Use Kapt4 in K2 -# TODO doesn't work with Anvil yet kapt.use.k2=false org.gradle.parallel=true From 47a3759dd180444c6bf108d27313dac74978c913 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 23 Sep 2024 12:57:28 -0400 Subject: [PATCH 3/6] Fix --- build.gradle.kts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9d0aa9e21..ee4938c8b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -166,9 +166,8 @@ subprojects { } val hasCompose = !project.hasProperty("circuit.noCompose") - val useK2Kapt = providers.gradleProperty("kapt.use.k2") - .map { it.toBooleanStrict() } - .getOrElse(false) + val useK2Kapt = + providers.gradleProperty("kapt.use.k2").map { it.toBooleanStrict() }.getOrElse(false) plugins.withType { tasks.withType>().configureEach { if (this is KaptGenerateStubsTask) { @@ -258,10 +257,6 @@ subprojects { module("com.google.guava:listenablefuture") { replacedBy("com.google.guava:guava") } } - pluginManager.withPlugin("org.jetbrains.kotlin.kapt") { - tasks.withType().configureEach { useK2Kapt.set(true) } - } - pluginManager.withPlugin("com.vanniktech.maven.publish") { apply(plugin = "org.jetbrains.dokka") From baf8840b8dc9dcc749c09609f06710b074c7e3fe Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Tue, 22 Oct 2024 00:34:42 -0400 Subject: [PATCH 4/6] 2.1.0-beta2 --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4efb6bfb2..f1e7b412d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -29,13 +29,13 @@ jdk = "22" jvmTarget = "11" publishedJvmTarget = "1.8" kct = "0.6.0-alpha01" -kotlin = "2.1.0-Beta1" +kotlin = "2.1.0-Beta2" kotlinInject = "0.7.2" kotlinInject-anvil = "0.0.5" kotlinpoet = "1.18.1" kotlinx-coroutines = "1.9.0" kotlinx-serialization = "1.7.3" -ksp = "2.1.0-Beta1-1.0.25" +ksp = "2.1.0-Beta2-1.0.25" ktfmt = "0.52" ktor = "3.0.0" leakcanary = "2.14" From 22e43ced8c4bca757bb542feffcfb19b59089711 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Thu, 21 Nov 2024 13:52:14 -0500 Subject: [PATCH 5/6] Update API --- circuit-foundation/api/android/circuit-foundation.api | 1 - circuit-foundation/api/jvm/circuit-foundation.api | 1 - circuit-overlay/api/android/circuit-overlay.api | 1 - circuit-overlay/api/jvm/circuit-overlay.api | 1 - circuitx/overlays/api/android/overlays.api | 1 - circuitx/overlays/api/jvm/overlays.api | 1 - 6 files changed, 6 deletions(-) diff --git a/circuit-foundation/api/android/circuit-foundation.api b/circuit-foundation/api/android/circuit-foundation.api index 694aebd61..618426942 100644 --- a/circuit-foundation/api/android/circuit-foundation.api +++ b/circuit-foundation/api/android/circuit-foundation.api @@ -70,7 +70,6 @@ public final class com/slack/circuit/foundation/CircuitKt { public final class com/slack/circuit/foundation/ComposableSingletons$CircuitKt { public static final field INSTANCE Lcom/slack/circuit/foundation/ComposableSingletons$CircuitKt; - public static field lambda-1 Lkotlin/jvm/functions/Function4; public fun ()V public final fun getLambda-1$circuit_foundation_release ()Lkotlin/jvm/functions/Function4; } diff --git a/circuit-foundation/api/jvm/circuit-foundation.api b/circuit-foundation/api/jvm/circuit-foundation.api index d431f7fec..8e92cdad4 100644 --- a/circuit-foundation/api/jvm/circuit-foundation.api +++ b/circuit-foundation/api/jvm/circuit-foundation.api @@ -70,7 +70,6 @@ public final class com/slack/circuit/foundation/CircuitKt { public final class com/slack/circuit/foundation/ComposableSingletons$CircuitKt { public static final field INSTANCE Lcom/slack/circuit/foundation/ComposableSingletons$CircuitKt; - public static field lambda-1 Lkotlin/jvm/functions/Function4; public fun ()V public final fun getLambda-1$circuit_foundation ()Lkotlin/jvm/functions/Function4; } diff --git a/circuit-overlay/api/android/circuit-overlay.api b/circuit-overlay/api/android/circuit-overlay.api index ff1b96bd3..160198b78 100644 --- a/circuit-overlay/api/android/circuit-overlay.api +++ b/circuit-overlay/api/android/circuit-overlay.api @@ -9,7 +9,6 @@ public abstract class com/slack/circuit/overlay/AnimatedOverlay : com/slack/circ public final class com/slack/circuit/overlay/ComposableSingletons$ContentWithOverlaysKt { public static final field INSTANCE Lcom/slack/circuit/overlay/ComposableSingletons$ContentWithOverlaysKt; - public static field lambda-1 Lkotlin/jvm/functions/Function4; public fun ()V public final fun getLambda-1$circuit_overlay_release ()Lkotlin/jvm/functions/Function4; } diff --git a/circuit-overlay/api/jvm/circuit-overlay.api b/circuit-overlay/api/jvm/circuit-overlay.api index df0158cdc..835c16a7a 100644 --- a/circuit-overlay/api/jvm/circuit-overlay.api +++ b/circuit-overlay/api/jvm/circuit-overlay.api @@ -9,7 +9,6 @@ public abstract class com/slack/circuit/overlay/AnimatedOverlay : com/slack/circ public final class com/slack/circuit/overlay/ComposableSingletons$ContentWithOverlaysKt { public static final field INSTANCE Lcom/slack/circuit/overlay/ComposableSingletons$ContentWithOverlaysKt; - public static field lambda-1 Lkotlin/jvm/functions/Function4; public fun ()V public final fun getLambda-1$circuit_overlay ()Lkotlin/jvm/functions/Function4; } diff --git a/circuitx/overlays/api/android/overlays.api b/circuitx/overlays/api/android/overlays.api index cbf488ffb..021f028b0 100644 --- a/circuitx/overlays/api/android/overlays.api +++ b/circuitx/overlays/api/android/overlays.api @@ -28,7 +28,6 @@ public final class com/slack/circuitx/overlays/BottomSheetOverlay : com/slack/ci public final class com/slack/circuitx/overlays/ComposableSingletons$BottomSheetOverlayKt { public static final field INSTANCE Lcom/slack/circuitx/overlays/ComposableSingletons$BottomSheetOverlayKt; - public static field lambda-1 Lkotlin/jvm/functions/Function2; public fun ()V public final fun getLambda-1$overlays_release ()Lkotlin/jvm/functions/Function2; } diff --git a/circuitx/overlays/api/jvm/overlays.api b/circuitx/overlays/api/jvm/overlays.api index cfdb774b7..443ce8fb3 100644 --- a/circuitx/overlays/api/jvm/overlays.api +++ b/circuitx/overlays/api/jvm/overlays.api @@ -28,7 +28,6 @@ public final class com/slack/circuitx/overlays/BottomSheetOverlay : com/slack/ci public final class com/slack/circuitx/overlays/ComposableSingletons$BottomSheetOverlayKt { public static final field INSTANCE Lcom/slack/circuitx/overlays/ComposableSingletons$BottomSheetOverlayKt; - public static field lambda-1 Lkotlin/jvm/functions/Function2; public fun ()V public final fun getLambda-1$overlays ()Lkotlin/jvm/functions/Function2; } From 08d0a444f011ab1c480cd92c354432de4c1ae7d7 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Thu, 21 Nov 2024 14:14:43 -0500 Subject: [PATCH 6/6] yarn --- kotlin-js-store/yarn.lock | 52 +++++++++++---------------------------- 1 file changed, 15 insertions(+), 37 deletions(-) diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index 358e32eda..3b6813050 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -117,27 +117,6 @@ dependencies: "@types/node" "*" -"@types/eslint-scope@^3.7.3": - version "3.7.4" - resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" - integrity sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA== - dependencies: - "@types/eslint" "*" - "@types/estree" "*" - -"@types/eslint@*": - version "8.44.2" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.2.tgz#0d21c505f98a89b8dd4d37fa162b09da6089199a" - integrity sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg== - dependencies: - "@types/estree" "*" - "@types/json-schema" "*" - -"@types/estree@*": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194" - integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA== - "@types/estree@^1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" @@ -175,7 +154,7 @@ dependencies: "@types/node" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.8": +"@types/json-schema@^7.0.8": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== @@ -927,7 +906,7 @@ engine.io@~6.5.2: engine.io-parser "~5.2.1" ws "~8.11.0" -enhanced-resolve@^5.17.0: +enhanced-resolve@^5.17.1: version "5.17.1" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg== @@ -1573,10 +1552,10 @@ karma-webpack@5.0.1: minimatch "^9.0.3" webpack-merge "^4.1.5" -karma@6.4.3: - version "6.4.3" - resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.3.tgz#763e500f99597218bbb536de1a14acc4ceea7ce8" - integrity sha512-LuucC/RE92tJ8mlCwqEoRWXP38UMAqpnq98vktmS9SznSoUPPUJQbc91dHcxcunROvfQjdORVA/YFviH+Xci9Q== +karma@6.4.4: + version "6.4.4" + resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.4.tgz#dfa5a426cf5a8b53b43cd54ef0d0d09742351492" + integrity sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w== dependencies: "@colors/colors" "1.5.0" body-parser "^1.19.0" @@ -1766,10 +1745,10 @@ mkdirp@^0.5.5: dependencies: minimist "^1.2.6" -mocha@10.7.0: - version "10.7.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.0.tgz#9e5cbed8fa9b37537a25bd1f7fb4f6fc45458b9a" - integrity sha512-v8/rBWr2VO5YkspYINnvu81inSz2y3ODJrhO175/Exzor1RcEZZkizgE2A+w/CAXXoESS8Kys5E62dOHGHzULA== +mocha@10.7.3: + version "10.7.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" + integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A== dependencies: ansi-colors "^4.1.3" browser-stdout "^1.3.1" @@ -2667,12 +2646,11 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@5.93.0: - version "5.93.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.93.0.tgz#2e89ec7035579bdfba9760d26c63ac5c3462a5e5" - integrity sha512-Y0m5oEY1LRuwly578VqluorkXbvXKh7U3rLoQCEO04M97ScRr44afGVkI0FQFsXzysk5OgFAxjZAb9rsGQVihA== +webpack@5.94.0: + version "5.94.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f" + integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg== dependencies: - "@types/eslint-scope" "^3.7.3" "@types/estree" "^1.0.5" "@webassemblyjs/ast" "^1.12.1" "@webassemblyjs/wasm-edit" "^1.12.1" @@ -2681,7 +2659,7 @@ webpack@5.93.0: acorn-import-attributes "^1.9.5" browserslist "^4.21.10" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.17.0" + enhanced-resolve "^5.17.1" es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0"