Skip to content

Commit 2319143

Browse files
chore(deps): update all dependencies (#3536)
* chore(deps): update all dependencies | datasource | package | from | to | | -------------- | ------------------------------------------------------------------------------------------------- | --------------- | ---------------- | | gradle-version | gradle | 8.11 | 8.11.1 | | maven | org.jetbrains.compose:org.jetbrains.compose.gradle.plugin | 1.7.1 | 1.8.0+check | | maven | com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin | 2.1.0-RC-1.0.27 | 2.1.0-RC2-1.0.28 | | maven | com.google.devtools.ksp:symbol-processing-api | 2.1.0-RC-1.0.27 | 2.1.0-RC2-1.0.28 | | maven | org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin | 2.1.0-RC | 2.1.0-RC2 | | maven | org.jetbrains.kotlin.plugin.serialization:org.jetbrains.kotlin.plugin.serialization.gradle.plugin | 2.1.0-RC | 2.1.0-RC2 | | maven | org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin | 2.1.0-RC | 2.1.0-RC2 | | maven | org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin | 2.1.0-RC | 2.1.0-RC2 | | maven | ru.vyarus.animalsniffer:ru.vyarus.animalsniffer.gradle.plugin | 1.7.1 | 1.7.2 | * Remove context receivers --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Alejandro Serrano Mena <[email protected]>
1 parent b490817 commit 2319143

File tree

10 files changed

+19
-44
lines changed

10 files changed

+19
-44
lines changed

arrow-libs/core/arrow-autoclose/build.gradle.kts

-5
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,3 @@ kotlin {
5151
(project.rootProject.properties["kotlin_api_version"] as? String)?.also { apiVersion = KotlinVersion.fromVersion(it) }
5252
}
5353
}
54-
55-
// enables context receivers for Jvm Tests
56-
tasks.named<KotlinCompile>("compileTestKotlinJvm") {
57-
compilerOptions.freeCompilerArgs.add("-Xcontext-receivers")
58-
}

arrow-libs/core/arrow-autoclose/src/commonMain/kotlin/arrow/AutoCloseScope.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ import kotlin.coroutines.cancellation.CancellationException
4747
* So both [AutoCloseScope], and `ResourceScope` behave correctly when encountering cancellation, by closing the source,
4848
* but `ResourceScope` allows inspecting _complete_, _failure_, **and** _cancellation_ in the finalizer.
4949
*
50-
* This DSL works very well with Kotlin's experimental feature context receivers, soon called context parameters.
51-
* We can write the same code from above as a function:
50+
* We can write the same code from above as a function by adding the scope as receiver:
51+
*
5252
* ```kotlin
53-
* context(AutoCloseScope)
54-
* fun copyFiles(input: String, output: String) {
53+
* fun AutoCloseScope.copyFiles(input: String, output: String) {
5554
* val scanner = install(Scanner(input))
5655
* val printer = install(Printer(output))
5756
* for(line in scanner) {

arrow-libs/core/arrow-autoclose/src/jvmTest/kotlin/examples/example-autocloseable-02.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public class Printer(private val path: String) : AutoCloseable {
1515
override fun close(): Unit = Unit
1616
}
1717

18-
context(AutoCloseScope)
19-
fun copyFiles(input: String, output: String) {
18+
fun AutoCloseScope.copyFiles(input: String, output: String) {
2019
val scanner = install(Scanner(input))
2120
val printer = install(Printer(output))
2221
for(line in scanner) {

arrow-libs/core/arrow-cache4k/build.gradle.kts

-5
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,3 @@ tasks.named<Jar>("jvmJar").configure {
8383
attributes["Automatic-Module-Name"] = "arrow.cache4k"
8484
}
8585
}
86-
87-
// enables context receivers for Jvm Tests
88-
tasks.named<KotlinCompile>("compileTestKotlinJvm") {
89-
compilerOptions.freeCompilerArgs.add("-Xcontext-receivers")
90-
}

arrow-libs/core/arrow-core/build.gradle.kts

-5
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ kotlin {
7979
}
8080
}
8181

82-
// enables context receivers for Jvm Tests
83-
tasks.named<KotlinCompile>("compileTestKotlinJvm") {
84-
compilerOptions.freeCompilerArgs.add("-Xcontext-receivers")
85-
}
86-
8782
tasks.withType<Test>().configureEach {
8883
useJUnitPlatform()
8984
}

arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Effect.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,17 @@ import kotlin.jvm.JvmName
164164
* ```
165165
* <!--- KNIT example-raise-03.kt -->
166166
*
167-
* Adding your own syntax to `Raise<R>` is not advised, yet, but will be easy once "Multiple Receivers" become available.
167+
* Adding your own syntax to `Raise<R>` is not advised, yet, but will be easy once context parameters become available.
168168
*
169169
* ```
170-
* context(Raise<R>)
170+
* context(_: Raise<R>)
171171
* suspend fun <R, A> Either<R, A>.bind(): A =
172172
* when (this) {
173173
* is Either.Left -> raise(value)
174174
* is Either.Right -> value
175175
* }
176176
*
177-
* context(Raise<None>)
177+
* context(_: Raise<None>)
178178
* fun <A> Option<A>.bind(): A =
179179
* fold({ raise(it) }, ::identity)
180180
* ```

arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Raise.kt

+3-6
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ public interface Raise<in Error> {
168168
*
169169
* data class Config(val mode: Int, val role: String, val serviceType: ServiceType)
170170
*
171-
* context(Raise<String>)
172-
* fun readConfig(): Config {
171+
* fun Raise<String>.readConfig(): Config {
173172
* val mode = ensureNotNull(readln().toIntOrNull()) {
174173
* "Mode should be a valid integer"
175174
* }
@@ -530,8 +529,7 @@ public inline fun <reified T : Throwable, A> catch(block: () -> A, catch: (t: T)
530529
* object ContainsInvalidChars : CountryCodeError
531530
* }
532531
*
533-
* context(Raise<CountryCodeError>)
534-
* fun countryCode(rawCode: String): CountryCode {
532+
* fun Raise<CountryCodeError>.countryCode(rawCode: String): CountryCode {
535533
* ensure(rawCode.length == 2) { CountryCodeError.InvalidLength(rawCode.length) }
536534
* ensure(rawCode.any { !it.isLetter() }) { CountryCodeError.ContainsInvalidChars }
537535
* return CountryCode(rawCode)
@@ -600,8 +598,7 @@ public inline fun <Error> Raise<Error>.ensure(condition: Boolean, raise: () -> E
600598
* object NullValue : NameError
601599
* }
602600
*
603-
* context(Raise<NameError>)
604-
* fun fullName(name: String?): FullName {
601+
* fun Raise<NameError>.fullName(name: String?): FullName {
605602
* val nonNullName = ensureNotNull(name) { NameError.NullValue }
606603
* return FullName(nonNullName)
607604
* }

arrow-libs/core/arrow-core/src/jvmTest/kotlin/arrow/core/raise/EffectUsage.kt

+5-10
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@ sealed interface OtherError : MyError {
99
object Actual : OtherError
1010
}
1111

12-
context(Raise<SubError>)
13-
suspend fun subprogram(): Unit =
12+
suspend fun Raise<SubError>.subprogram(): Unit =
1413
println("Hello SubProgram!")
1514

16-
context(Raise<OtherError>)
17-
suspend fun otherprogram(): Unit =
15+
suspend fun Raise<OtherError>.otherprogram(): Unit =
1816
println("Hello OtherProgram!")
1917

20-
context(Raise<OtherError>)
21-
suspend fun fail(): MyResponse =
18+
suspend fun Raise<OtherError>.fail(): MyResponse =
2219
raise(OtherError.Actual)
2320

2421
fun main() =
@@ -38,12 +35,10 @@ object EmptyResponse : MyResponse
3835
data class ErrorResponse(val error: Throwable) : MyResponse
3936
data class BodyResponse(val body: String) : MyResponse
4037

41-
context(Raise<SubError>)
42-
suspend fun respondWithBody(): BodyResponse =
38+
suspend fun Raise<SubError>.respondWithBody(): BodyResponse =
4339
BodyResponse("Hello Program!")
4440

45-
context(Raise<OtherError>)
46-
suspend fun attemptOrError(): MyResponse =
41+
suspend fun Raise<OtherError>.attemptOrError(): MyResponse =
4742
ErrorResponse(RuntimeException("Oh no!"))
4843

4944
fun respond(): Effect<MyError, MyResponse> =

gradle/libs.versions.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[versions]
2-
animalSniffer = "1.7.1"
2+
animalSniffer = "1.7.2"
33
arrowGradleConfig = "0.12.0-rc.24"
44
coroutines = "1.9.0"
55
classgraph = "4.8.179"
66
dokka = "1.9.20"
77
kotest = "6.0.0.M1"
88
kover = "0.8.3"
9-
kotlin = "2.1.0-RC"
9+
kotlin = "2.1.0-RC2"
1010
kotlinBinaryCompatibilityValidator = "0.16.3"
1111
kotlinCompileTesting = "0.6.0"
1212
knit = "0.5.0"
13-
kspVersion = "2.1.0-RC-1.0.27"
13+
kspVersion = "2.1.0-RC2-1.0.28"
1414
kotlinxSerialization = "1.7.3"
1515
mockWebServer = "4.12.0"
1616
retrofit = "2.11.0"

gradle/wrapper/gradle-wrapper.properties

+1-1
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-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)