diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9e219e90f94..cbd5fc8a299 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -161,6 +161,36 @@ jobs: name: 'reports-jvmTest' path: '**/build/reports/**' + jvmTestK2: + runs-on: ubuntu-latest + timeout-minutes: 60 + + env: + KOTLIN_OVERRIDE: 1.9.30-dev-1098 + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 11 + + - name: jvmTest (K2 enabled) + uses: gradle/gradle-build-action@v2 + with: + arguments: jvmTest -Pkotlin.experimental.tryK2=true + + - name: Upload reports + if: failure() + uses: actions/upload-artifact@v3 + with: + name: 'reports-jvmTest' + path: '**/build/reports/**' + js: runs-on: ubuntu-latest timeout-minutes: 60 diff --git a/arrow-libs/core/arrow-annotations/build.gradle.kts b/arrow-libs/core/arrow-annotations/build.gradle.kts index 828b110afeb..53ddc3b9140 100644 --- a/arrow-libs/core/arrow-annotations/build.gradle.kts +++ b/arrow-libs/core/arrow-annotations/build.gradle.kts @@ -4,7 +4,6 @@ plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) alias(libs.plugins.arrowGradleConfig.publish) - alias(libs.plugins.spotless) } @@ -37,12 +36,14 @@ kotlin { } } } -} - -apply(from = property("ANIMALSNIFFER_MPP")) -tasks.jar { - manifest { - attributes["Automatic-Module-Name"] = "arrow.annotations" + jvm { + tasks.jvmJar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.annotations" + } + } } } + +apply(from = property("ANIMALSNIFFER_MPP")) diff --git a/arrow-libs/core/arrow-atomic/build.gradle.kts b/arrow-libs/core/arrow-atomic/build.gradle.kts index 81779297831..c5930a388cc 100644 --- a/arrow-libs/core/arrow-atomic/build.gradle.kts +++ b/arrow-libs/core/arrow-atomic/build.gradle.kts @@ -67,12 +67,13 @@ kotlin { runtimeOnly(libs.kotest.runnerJUnit5) } } - } -} -tasks.jar { - manifest { - attributes["Automatic-Module-Name"] = "arrow.atomic" + jvm { + tasks.jvmJar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.atomic" + } + } } } diff --git a/arrow-libs/core/arrow-continuations/api/arrow-continuations.api b/arrow-libs/core/arrow-continuations/api/arrow-continuations.api index 5e268c691e4..8816ae2818c 100644 --- a/arrow-libs/core/arrow-continuations/api/arrow-continuations.api +++ b/arrow-libs/core/arrow-continuations/api/arrow-continuations.api @@ -26,6 +26,10 @@ public class arrow/continuations/generic/ControlThrowable : java/lang/Throwable public fun fillInStackTrace ()Ljava/lang/Throwable; } +public final class arrow/continuations/generic/ControlThrowableKt { + public static final field deprecateArrowContinuation Ljava/lang/String; +} + public abstract interface class arrow/continuations/generic/DelimitedContinuation { public abstract fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } diff --git a/arrow-libs/core/arrow-continuations/build.gradle.kts b/arrow-libs/core/arrow-continuations/build.gradle.kts index b5cf03d996b..a8cdbbf8d0e 100644 --- a/arrow-libs/core/arrow-continuations/build.gradle.kts +++ b/arrow-libs/core/arrow-continuations/build.gradle.kts @@ -49,10 +49,12 @@ kotlin { } } } -} -tasks.jar { - manifest { - attributes["Automatic-Module-Name"] = "arrow.continuations" + jvm { + tasks.jvmJar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.continuations" + } + } } } diff --git a/arrow-libs/core/arrow-continuations/src/commonMain/kotlin/arrow/continuations/generic/ControlThrowable.kt b/arrow-libs/core/arrow-continuations/src/commonMain/kotlin/arrow/continuations/generic/ControlThrowable.kt index 98f2d55e8ee..62420ca41df 100644 --- a/arrow-libs/core/arrow-continuations/src/commonMain/kotlin/arrow/continuations/generic/ControlThrowable.kt +++ b/arrow-libs/core/arrow-continuations/src/commonMain/kotlin/arrow/continuations/generic/ControlThrowable.kt @@ -9,5 +9,5 @@ package arrow.continuations.generic @Deprecated(deprecateArrowContinuation) public expect open class ControlThrowable() : Throwable -internal const val deprecateArrowContinuation: String = +@PublishedApi internal const val deprecateArrowContinuation: String = "arrow.continuation is being discontinued and will be removed in the next version in favor of the Effect/ EagerEffect Runtime. If you depend on low-level APIs as in arrow.continuation, feel free to write us in the Kotlin Slack channel for guidance." diff --git a/arrow-libs/core/arrow-core-retrofit/build.gradle.kts b/arrow-libs/core/arrow-core-retrofit/build.gradle.kts index 6ff3a453467..92b0fa63f7c 100644 --- a/arrow-libs/core/arrow-core-retrofit/build.gradle.kts +++ b/arrow-libs/core/arrow-core-retrofit/build.gradle.kts @@ -34,5 +34,10 @@ dependencies { testImplementation(libs.squareup.retrofitConverterMoshi) testImplementation(libs.kotlinx.serializationJson) testImplementation(libs.jakewharton.retrofitConverterKotlinxSerialization) +} +tasks.jar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.core.retrofit" + } } diff --git a/arrow-libs/core/arrow-core-serialization/build.gradle.kts b/arrow-libs/core/arrow-core-serialization/build.gradle.kts index 475f58234f0..e635f691b12 100644 --- a/arrow-libs/core/arrow-core-serialization/build.gradle.kts +++ b/arrow-libs/core/arrow-core-serialization/build.gradle.kts @@ -36,4 +36,12 @@ kotlin { } } } + + jvm { + tasks.jvmJar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.core.serialization" + } + } + } } diff --git a/arrow-libs/core/arrow-core/api/arrow-core.api b/arrow-libs/core/arrow-core/api/arrow-core.api index 2d0d8535a87..271226603a7 100644 --- a/arrow-libs/core/arrow-core/api/arrow-core.api +++ b/arrow-libs/core/arrow-core/api/arrow-core.api @@ -1622,6 +1622,7 @@ public final class arrow/core/PredefKt { } public final class arrow/core/ResultKt { + public static final field deprecateZip Ljava/lang/String; public static final fun composeErrors ([Ljava/lang/Throwable;)Ljava/lang/Throwable; public static final fun flatMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun getUnitResult ()Ljava/lang/Object; @@ -2598,6 +2599,8 @@ public final class arrow/core/Validated$Valid$Companion { } public final class arrow/core/ValidatedKt { + public static final field DeprAndNicheMsg Ljava/lang/String; + public static final field ValidatedDeprMsg Ljava/lang/String; public static final fun andThen (Larrow/core/Validated;Lkotlin/jvm/functions/Function1;)Larrow/core/Validated; public static final fun attempt (Larrow/core/Validated;)Larrow/core/Validated; public static final fun bisequence (Larrow/core/Validated;)Ljava/util/List; @@ -2671,6 +2674,7 @@ public final class arrow/core/computations/EitherEffect$DefaultImpls { } public final class arrow/core/computations/EitherKt { + public static final field eitherDSLDeprecation Ljava/lang/String; public static final fun ensureNotNull (Larrow/core/computations/EitherEffect;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } @@ -2695,6 +2699,7 @@ public final class arrow/core/computations/NullableEffect$DefaultImpls { } public final class arrow/core/computations/NullableKt { + public static final field nullableDSLDeprecation Ljava/lang/String; public static final fun ensureNotNull (Larrow/core/computations/NullableEffect;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } @@ -2709,6 +2714,7 @@ public final class arrow/core/computations/OptionEffect$DefaultImpls { } public final class arrow/core/computations/OptionKt { + public static final field optionDSLDeprecation Ljava/lang/String; public static final fun ensureNotNull (Larrow/core/computations/OptionEffect;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } @@ -2753,6 +2759,10 @@ public final class arrow/core/computations/ResultEffect { public final fun bind (Ljava/lang/Object;)Ljava/lang/Object; } +public final class arrow/core/computations/ResultKt { + public static final field resultDSLDeprecation Ljava/lang/String; +} + public final class arrow/core/computations/either { public static final field INSTANCE Larrow/core/computations/either; public final fun eager (Lkotlin/jvm/functions/Function2;)Larrow/core/Either; @@ -2938,6 +2948,10 @@ public final class arrow/core/continuations/EffectScopeKt { public static final fun ensureNotNull (Larrow/core/continuations/EffectScope;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } +public final class arrow/core/continuations/EitherKt { + public static final field eitherDSLDeprecation Ljava/lang/String; +} + public final class arrow/core/continuations/FoldContinuation : arrow/core/continuations/Token, arrow/core/continuations/EffectScope, kotlin/coroutines/Continuation { public field recover Lkotlin/jvm/functions/Function2; public fun (Larrow/core/continuations/Token;Lkotlin/coroutines/CoroutineContext;Lkotlin/coroutines/Continuation;)V @@ -3007,6 +3021,10 @@ public final class arrow/core/continuations/IorEffectScope : arrow/core/continua public fun shift (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } +public final class arrow/core/continuations/IorKt { + public static final field iorDSLDeprecation Ljava/lang/String; +} + public final class arrow/core/continuations/NullableEagerEffectScope : arrow/core/continuations/EagerEffectScope { public fun attempt (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static fun attempt-impl (Larrow/core/continuations/EagerEffectScope;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -3088,6 +3106,7 @@ public final class arrow/core/continuations/NullableEffectScope : arrow/core/con } public final class arrow/core/continuations/NullableKt { + public static final field nullableDSLDeprecation Ljava/lang/String; public static final fun ensureNotNull-0Rsnnio (Larrow/core/continuations/EffectScope;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun ensureNotNull-7s8y1X8 (Larrow/core/continuations/EagerEffectScope;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } @@ -3171,6 +3190,7 @@ public final class arrow/core/continuations/OptionEffectScope : arrow/core/conti } public final class arrow/core/continuations/OptionKt { + public static final field optionDSLDeprecation Ljava/lang/String; public static final fun ensureNotNull-09sQPHg (Larrow/core/continuations/EffectScope;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun ensureNotNull-dxZa7OQ (Larrow/core/continuations/EagerEffectScope;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun toOption (Larrow/core/continuations/EagerEffect;)Larrow/core/Option; @@ -3254,6 +3274,7 @@ public final class arrow/core/continuations/ResultEffectScope : arrow/core/conti } public final class arrow/core/continuations/ResultKt { + public static final field resultDSLDeprecation Ljava/lang/String; public static final fun toResult (Larrow/core/continuations/EagerEffect;)Ljava/lang/Object; public static final fun toResult (Larrow/core/continuations/Effect;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } diff --git a/arrow-libs/core/arrow-core/build.gradle.kts b/arrow-libs/core/arrow-core/build.gradle.kts index e54c3b056c8..1826798c008 100644 --- a/arrow-libs/core/arrow-core/build.gradle.kts +++ b/arrow-libs/core/arrow-core/build.gradle.kts @@ -57,15 +57,17 @@ kotlin { } } } + + jvm { + tasks.jvmJar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.core" + } + } + } } // enables context receivers for Jvm Tests tasks.named("compileTestKotlinJvm") { kotlinOptions.freeCompilerArgs += "-Xcontext-receivers" } - -tasks.jar { - manifest { - attributes["Automatic-Module-Name"] = "arrow.core" - } -} diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Ior.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Ior.kt index 939fafc86f8..ebab0368966 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Ior.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Ior.kt @@ -116,8 +116,7 @@ public sealed class Ior { public fun isLeft(): Boolean { contract { returns(true) implies (this@Ior is Ior.Left) - returns(false) implies (this@Ior is Ior.Right) - returns(false) implies (this@Ior is Ior.Both) + returns(false) implies (this@Ior is Ior.Right || this@Ior is Ior.Both) } return this@Ior is Ior.Left } @@ -127,8 +126,7 @@ public sealed class Ior { public fun isRight(): Boolean { contract { returns(true) implies (this@Ior is Ior.Right) - returns(false) implies (this@Ior is Ior.Left) - returns(false) implies (this@Ior is Ior.Both) + returns(false) implies (this@Ior is Ior.Left || this@Ior is Ior.Both) } return this@Ior is Ior.Right } @@ -137,8 +135,7 @@ public sealed class Ior { @JvmName("_isBoth") public fun isBoth(): Boolean { contract { - returns(false) implies (this@Ior is Ior.Right) - returns(false) implies (this@Ior is Ior.Left) + returns(false) implies (this@Ior is Ior.Right || this@Ior is Ior.Left) returns(true) implies (this@Ior is Ior.Both) } return this@Ior is Ior.Both diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Result.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Result.kt index 521e04d78e0..5a4ba04e090 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Result.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Result.kt @@ -8,7 +8,7 @@ import kotlin.contracts.ExperimentalContracts import kotlin.contracts.InvocationKind import kotlin.contracts.contract -internal const val deprecateZip: String = +@PublishedApi internal const val deprecateZip: String = "Prefer using the inline result DSL + bind(). Please, be aware that all the errors are no longer accumulated, just the first error found is considered." + "In case you think this behaviour should stay, please provide feedback and your use-case on https://github.com/arrow-kt/arrow/issues" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Validated.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Validated.kt index baef295a4b4..4b1a23e872e 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Validated.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Validated.kt @@ -1305,7 +1305,8 @@ public inline fun A.validNel(): ValidatedNel = public inline fun E.invalidNel(): ValidatedNel = Validated.invalidNel(this) -internal const val ValidatedDeprMsg = "Validated functionality is being merged into Either.\n" +@PublishedApi internal const val ValidatedDeprMsg: String = + "Validated functionality is being merged into Either.\n" -private const val DeprAndNicheMsg = +@PublishedApi internal const val DeprAndNicheMsg: String = "Validated functionality is being merged into Either, but this API is niche and will be removed in the future. If this method is crucial for you, please let us know on the Arrow Github. Thanks!\n https://github.com/arrow-kt/arrow/issues\n" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/either.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/either.kt index d283dfb31f4..50a3bef68bb 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/either.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/either.kt @@ -125,6 +125,6 @@ public object either { Effect.suspended(eff = { EitherEffect { it } }, f = c, just = { it.right() }) } -private const val eitherDSLDeprecation = +@PublishedApi internal const val eitherDSLDeprecation: String = "The either DSL has been moved to arrow.core.raise.either.\n" + "Replace import arrow.core.computations.* with arrow.core.raise.*" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/nullable.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/nullable.kt index 2a27aed11e6..0932324e801 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/nullable.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/nullable.kt @@ -106,6 +106,6 @@ public object nullable { Effect.suspended(eff = { NullableEffect { it } }, f = func, just = { it }) } -private const val nullableDSLDeprecation = +@PublishedApi internal const val nullableDSLDeprecation: String = "The nullable DSL has been moved to arrow.core.raise.nullable.\n" + "Replace import arrow.core.computations.* with arrow.core.raise.*" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/option.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/option.kt index 778dd8d3408..f65ad18c8a1 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/option.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/option.kt @@ -111,6 +111,6 @@ public object option { Effect.suspended(eff = { OptionEffect { it } }, f = func, just = { Option.fromNullable(it) }) } -private const val optionDSLDeprecation = +@PublishedApi internal const val optionDSLDeprecation: String = "The option DSL has been moved to arrow.core.raise.option.\n" + "Replace import arrow.core.computations.* with arrow.core.raise.*" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/result.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/result.kt index 99b5bd715c9..9e41353282d 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/result.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/computations/result.kt @@ -65,6 +65,6 @@ public object result { kotlin.runCatching { block(ResultEffect) } } -private const val resultDSLDeprecation = +@PublishedApi internal const val resultDSLDeprecation: String = "The result DSL has been moved to arrow.core.raise.result.\n" + "Replace import arrow.core.computations.* with arrow.core.raise.*" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/either.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/either.kt index f249fc67893..b6cd126398f 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/either.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/either.kt @@ -14,6 +14,6 @@ public object either { effect(f).toEither() } -private const val eitherDSLDeprecation = +@PublishedApi internal const val eitherDSLDeprecation: String = "The either DSL has been moved to arrow.core.raise.either.\n" + "Replace import arrow.core.computations.either with arrow.core.raise.either" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/ior.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/ior.kt index 7c56ee9eb90..57effe8cbf6 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/ior.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/ior.kt @@ -93,6 +93,6 @@ public class IorEagerEffectScope(semigroup: Semigroup, private val effect: override suspend fun shift(r: E): B = effect.shift(combine(r)) } -private const val iorDSLDeprecation = +@PublishedApi internal const val iorDSLDeprecation: String = "The ior DSL has been moved to arrow.core.raise.ior.\n" + "Replace import arrow.core.computations.ior with arrow.core.raise.ior" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/nullable.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/nullable.kt index 4a1c72d3a20..5923e079957 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/nullable.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/nullable.kt @@ -77,6 +77,6 @@ public object nullable { effect { f(NullableEffectScope(this)) }.orNull() } -private const val nullableDSLDeprecation = +@PublishedApi internal const val nullableDSLDeprecation: String = "The nullable DSL has been moved to arrow.core.raise.nullable.\n" + "Replace import arrow.core.computations.nullable with arrow.core.raise.nullable" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/option.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/option.kt index 1d31ed25ec3..6131238b622 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/option.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/option.kt @@ -75,6 +75,6 @@ public object option { effect { f(OptionEffectScope(this)) }.toOption() } -private const val optionDSLDeprecation = +@PublishedApi internal const val optionDSLDeprecation: String = "The option DSL has been moved to arrow.core.raise.option.\n" + "Replace import arrow.core.computations.option with arrow.core.raise.option" diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/result.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/result.kt index 453b8830ab3..1256bf2d503 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/result.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/result.kt @@ -49,6 +49,6 @@ public object result { effect { f(ResultEffectScope(this)) }.toResult() } -private const val resultDSLDeprecation = +@PublishedApi internal const val resultDSLDeprecation: String = "The result DSL has been moved to arrow.core.raise.result.\n" + "Replace import arrow.core.computations.* with arrow.core.raise.*" diff --git a/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api b/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api index e36acf270bb..8ed38b63fb5 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api +++ b/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api @@ -471,6 +471,7 @@ public final class arrow/fx/coroutines/ResourceExtensionsKt { } public final class arrow/fx/coroutines/ResourceKt { + public static final field nextVersionRemoved Ljava/lang/String; public static final fun asFlow (Larrow/fx/coroutines/Resource;)Lkotlinx/coroutines/flow/Flow; public static final fun release (Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource; public static final fun release-zgiIeyo (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource; diff --git a/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts b/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts index 1515ede66c2..b7127588481 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts +++ b/arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts @@ -51,10 +51,12 @@ kotlin { } } } -} -tasks.jar { - manifest { - attributes["Automatic-Module-Name"] = "arrow.fx.coroutines" + jvm { + tasks.jvmJar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.fx.coroutines" + } + } } } diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt index 4aba7585776..6fba7032cfe 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt @@ -1164,6 +1164,6 @@ private suspend fun List Unit>.cancelAll( } ?: acc } -private const val nextVersionRemoved: String = +@PublishedApi internal const val nextVersionRemoved: String = "is redundant and will be removed in Arrow 2.x.x in favor of the DSL.\n" + "In case you think this method should stay, please provide feedback and your use-case on https://github.com/arrow-kt/arrow/issues" diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/RaceNTest.kt b/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/RaceNTest.kt index 017541553af..8a1e9e3e3e0 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/RaceNTest.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/commonTest/kotlin/arrow/fx/coroutines/RaceNTest.kt @@ -3,6 +3,7 @@ package arrow.fx.coroutines import arrow.core.Either import arrow.core.identity import arrow.core.merge +import io.kotest.assertions.retry import io.kotest.core.spec.style.StringSpec import io.kotest.matchers.should import io.kotest.matchers.shouldBe @@ -17,6 +18,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.async import kotlinx.coroutines.awaitCancellation import kotlinx.coroutines.channels.Channel +import kotlin.time.Duration.Companion.seconds fun Either.rethrow(): A = fold({ throw it }, ::identity) @@ -105,34 +107,39 @@ class RaceNTest : StringSpec({ } "Cancelling race 3 cancels all participants" { - checkAll(Arb.int(), Arb.int(), Arb.int()) { a, b, c -> - val s = Channel() - val pa = CompletableDeferred>() - val pb = CompletableDeferred>() - val pc = CompletableDeferred>() - - val loserA: suspend CoroutineScope.() -> Int = { guaranteeCase({ s.receive(); awaitCancellation() }) { ex -> pa.complete(Pair(a, ex)) } } - val loserB: suspend CoroutineScope.() -> Int = { guaranteeCase({ s.receive(); awaitCancellation() }) { ex -> pb.complete(Pair(b, ex)) } } - val loserC: suspend CoroutineScope.() -> Int = { guaranteeCase({ s.receive(); awaitCancellation() }) { ex -> pc.complete(Pair(c, ex)) } } - - val f = async { raceN(loserA, loserB, loserC) } - - s.send(Unit) // Suspend until all racers started - s.send(Unit) - s.send(Unit) - f.cancel() - - pa.await().let { (res, exit) -> - res shouldBe a - exit.shouldBeInstanceOf() - } - pb.await().let { (res, exit) -> - res shouldBe b - exit.shouldBeInstanceOf() - } - pc.await().let { (res, exit) -> - res shouldBe c - exit.shouldBeInstanceOf() + retry(10, 1.seconds) { + checkAll(Arb.int(), Arb.int(), Arb.int()) { a, b, c -> + val s = Channel() + val pa = CompletableDeferred>() + val pb = CompletableDeferred>() + val pc = CompletableDeferred>() + + val loserA: suspend CoroutineScope.() -> Int = + { guaranteeCase({ s.receive(); awaitCancellation() }) { ex -> pa.complete(Pair(a, ex)) } } + val loserB: suspend CoroutineScope.() -> Int = + { guaranteeCase({ s.receive(); awaitCancellation() }) { ex -> pb.complete(Pair(b, ex)) } } + val loserC: suspend CoroutineScope.() -> Int = + { guaranteeCase({ s.receive(); awaitCancellation() }) { ex -> pc.complete(Pair(c, ex)) } } + + val f = async { raceN(loserA, loserB, loserC) } + + s.send(Unit) // Suspend until all racers started + s.send(Unit) + s.send(Unit) + f.cancel() + + pa.await().let { (res, exit) -> + res shouldBe a + exit.shouldBeInstanceOf() + } + pb.await().let { (res, exit) -> + res shouldBe b + exit.shouldBeInstanceOf() + } + pc.await().let { (res, exit) -> + res shouldBe c + exit.shouldBeInstanceOf() + } } } } diff --git a/arrow-libs/fx/arrow-fx-stm/build.gradle.kts b/arrow-libs/fx/arrow-fx-stm/build.gradle.kts index a6c6c9664e4..31786faea44 100644 --- a/arrow-libs/fx/arrow-fx-stm/build.gradle.kts +++ b/arrow-libs/fx/arrow-fx-stm/build.gradle.kts @@ -52,10 +52,12 @@ kotlin { } } } -} -tasks.jar { - manifest { - attributes["Automatic-Module-Name"] = "arrow.fx.stm" + jvm { + tasks.jvmJar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.fx.stm" + } + } } } diff --git a/arrow-libs/optics/arrow-optics-reflect/build.gradle.kts b/arrow-libs/optics/arrow-optics-reflect/build.gradle.kts index 45ca0f8cab2..13e73874df1 100644 --- a/arrow-libs/optics/arrow-optics-reflect/build.gradle.kts +++ b/arrow-libs/optics/arrow-optics-reflect/build.gradle.kts @@ -31,3 +31,9 @@ dependencies { testImplementation(libs.kotest.property) testRuntimeOnly(libs.kotest.runnerJUnit5) } + +tasks.jar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.optics.reflect" + } +} diff --git a/arrow-libs/optics/arrow-optics/api/arrow-optics.api b/arrow-libs/optics/arrow-optics/api/arrow-optics.api index 9a570cb45a7..bf78e859048 100644 --- a/arrow-libs/optics/arrow-optics/api/arrow-optics.api +++ b/arrow-libs/optics/arrow-optics/api/arrow-optics.api @@ -173,12 +173,6 @@ public abstract interface class arrow/optics/PEvery : arrow/optics/Fold, arrow/o public abstract fun compose (Larrow/optics/PEvery;)Larrow/optics/PEvery; public static fun either ()Larrow/optics/PEvery; public abstract fun foldMap (Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; - public abstract fun getEvery (Larrow/optics/PIso;)Larrow/optics/PEvery; - public abstract fun getEvery (Larrow/optics/PLens;)Larrow/optics/PEvery; - public abstract fun getEvery (Larrow/optics/POptional;)Larrow/optics/PEvery; - public abstract fun getEvery (Larrow/optics/PPrism;)Larrow/optics/PEvery; - public abstract fun getEvery (Larrow/optics/PSetter;)Larrow/optics/PSetter; - public abstract fun getEvery (Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun list ()Larrow/optics/PEvery; public static fun map ()Larrow/optics/PEvery; public abstract fun modify (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -236,13 +230,6 @@ public final class arrow/optics/PEvery$DefaultImpls { public static fun fold (Larrow/optics/PEvery;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;)Ljava/lang/Object; public static fun foldMap (Larrow/optics/PEvery;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static fun getAll (Larrow/optics/PEvery;Ljava/lang/Object;)Ljava/util/List; - public static fun getEvery (Larrow/optics/PEvery;Larrow/optics/PEvery;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PEvery;Larrow/optics/PIso;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PEvery;Larrow/optics/PLens;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PEvery;Larrow/optics/POptional;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PEvery;Larrow/optics/PPrism;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PEvery;Larrow/optics/PSetter;)Larrow/optics/PSetter; - public static fun getEvery (Larrow/optics/PEvery;Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun isEmpty (Larrow/optics/PEvery;Ljava/lang/Object;)Z public static fun isNotEmpty (Larrow/optics/PEvery;Ljava/lang/Object;)Z public static fun lastOrNull (Larrow/optics/PEvery;Ljava/lang/Object;)Ljava/lang/Object; @@ -339,13 +326,6 @@ public final class arrow/optics/PIso$DefaultImpls { public static fun foldMap (Larrow/optics/PIso;Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static fun foldMap (Larrow/optics/PIso;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static fun getAll (Larrow/optics/PIso;Ljava/lang/Object;)Ljava/util/List; - public static fun getEvery (Larrow/optics/PIso;Larrow/optics/PEvery;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PIso;Larrow/optics/PIso;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PIso;Larrow/optics/PLens;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PIso;Larrow/optics/POptional;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PIso;Larrow/optics/PPrism;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PIso;Larrow/optics/PSetter;)Larrow/optics/PSetter; - public static fun getEvery (Larrow/optics/PIso;Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun getOrModify (Larrow/optics/PIso;Ljava/lang/Object;)Larrow/core/Either; public static fun getOrNull (Larrow/optics/PIso;Ljava/lang/Object;)Ljava/lang/Object; public static fun isEmpty (Larrow/optics/PIso;Ljava/lang/Object;)Z @@ -451,13 +431,6 @@ public final class arrow/optics/PLens$DefaultImpls { public static fun foldMap (Larrow/optics/PLens;Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static fun foldMap (Larrow/optics/PLens;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static fun getAll (Larrow/optics/PLens;Ljava/lang/Object;)Ljava/util/List; - public static fun getEvery (Larrow/optics/PLens;Larrow/optics/PEvery;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PLens;Larrow/optics/PIso;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PLens;Larrow/optics/PLens;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PLens;Larrow/optics/POptional;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PLens;Larrow/optics/PPrism;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PLens;Larrow/optics/PSetter;)Larrow/optics/PSetter; - public static fun getEvery (Larrow/optics/PLens;Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun getOrModify (Larrow/optics/PLens;Ljava/lang/Object;)Larrow/core/Either; public static fun getOrNull (Larrow/optics/PLens;Ljava/lang/Object;)Ljava/lang/Object; public static fun isEmpty (Larrow/optics/PLens;Ljava/lang/Object;)Z @@ -536,13 +509,6 @@ public final class arrow/optics/POptional$DefaultImpls { public static fun foldMap (Larrow/optics/POptional;Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static fun foldMap (Larrow/optics/POptional;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static fun getAll (Larrow/optics/POptional;Ljava/lang/Object;)Ljava/util/List; - public static fun getEvery (Larrow/optics/POptional;Larrow/optics/PEvery;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/POptional;Larrow/optics/PIso;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/POptional;Larrow/optics/PLens;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/POptional;Larrow/optics/POptional;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/POptional;Larrow/optics/PPrism;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/POptional;Larrow/optics/PSetter;)Larrow/optics/PSetter; - public static fun getEvery (Larrow/optics/POptional;Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun getOrNull (Larrow/optics/POptional;Ljava/lang/Object;)Ljava/lang/Object; public static fun isEmpty (Larrow/optics/POptional;Ljava/lang/Object;)Z public static fun isNotEmpty (Larrow/optics/POptional;Ljava/lang/Object;)Z @@ -673,13 +639,6 @@ public final class arrow/optics/PPrism$DefaultImpls { public static fun foldMap (Larrow/optics/PPrism;Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static fun foldMap (Larrow/optics/PPrism;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static fun getAll (Larrow/optics/PPrism;Ljava/lang/Object;)Ljava/util/List; - public static fun getEvery (Larrow/optics/PPrism;Larrow/optics/PEvery;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PPrism;Larrow/optics/PIso;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PPrism;Larrow/optics/PLens;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PPrism;Larrow/optics/POptional;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PPrism;Larrow/optics/PPrism;)Larrow/optics/PEvery; - public static fun getEvery (Larrow/optics/PPrism;Larrow/optics/PSetter;)Larrow/optics/PSetter; - public static fun getEvery (Larrow/optics/PPrism;Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun getOrNull (Larrow/optics/PPrism;Ljava/lang/Object;)Ljava/lang/Object; public static fun isEmpty (Larrow/optics/PPrism;Ljava/lang/Object;)Z public static fun isNotEmpty (Larrow/optics/PPrism;Ljava/lang/Object;)Z @@ -731,13 +690,6 @@ public abstract interface class arrow/optics/PTraversal : arrow/optics/PSetter { public abstract fun choice (Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public abstract fun compose (Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun either ()Larrow/optics/PTraversal; - public abstract fun getEvery (Larrow/optics/PEvery;)Larrow/optics/PTraversal; - public abstract fun getEvery (Larrow/optics/PIso;)Larrow/optics/PTraversal; - public abstract fun getEvery (Larrow/optics/PLens;)Larrow/optics/PTraversal; - public abstract fun getEvery (Larrow/optics/POptional;)Larrow/optics/PTraversal; - public abstract fun getEvery (Larrow/optics/PPrism;)Larrow/optics/PTraversal; - public abstract fun getEvery (Larrow/optics/PSetter;)Larrow/optics/PSetter; - public abstract fun getEvery (Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun list ()Larrow/optics/PTraversal; public static fun map ()Larrow/optics/PTraversal; public abstract fun modify (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; @@ -811,13 +763,6 @@ public final class arrow/optics/PTraversal$DefaultImpls { public static fun choice (Larrow/optics/PTraversal;Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun compose (Larrow/optics/PTraversal;Larrow/optics/PSetter;)Larrow/optics/PSetter; public static fun compose (Larrow/optics/PTraversal;Larrow/optics/PTraversal;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PTraversal;Larrow/optics/PEvery;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PTraversal;Larrow/optics/PIso;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PTraversal;Larrow/optics/PLens;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PTraversal;Larrow/optics/POptional;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PTraversal;Larrow/optics/PPrism;)Larrow/optics/PTraversal; - public static fun getEvery (Larrow/optics/PTraversal;Larrow/optics/PSetter;)Larrow/optics/PSetter; - public static fun getEvery (Larrow/optics/PTraversal;Larrow/optics/PTraversal;)Larrow/optics/PTraversal; public static fun lift (Larrow/optics/PTraversal;Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function1; public static fun plus (Larrow/optics/PTraversal;Larrow/optics/PSetter;)Larrow/optics/PSetter; public static fun plus (Larrow/optics/PTraversal;Larrow/optics/PTraversal;)Larrow/optics/PTraversal; diff --git a/arrow-libs/optics/arrow-optics/build.gradle.kts b/arrow-libs/optics/arrow-optics/build.gradle.kts index ec3fa24f68a..eeda41cffd8 100644 --- a/arrow-libs/optics/arrow-optics/build.gradle.kts +++ b/arrow-libs/optics/arrow-optics/build.gradle.kts @@ -53,6 +53,14 @@ kotlin { } } } + + jvm { + tasks.jvmJar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.optics" + } + } + } } //fun DependencyHandlerScope.kspTest(dependencyNotation: Any): Unit { @@ -71,9 +79,3 @@ kotlin { //dependencies { // kspTest(projects.arrowOpticsKspPlugin) //} - -tasks.jar { - manifest { - attributes["Automatic-Module-Name"] = "arrow.optics" - } -} diff --git a/arrow-libs/optics/arrow-optics/src/commonMain/kotlin/arrow/optics/Every.kt b/arrow-libs/optics/arrow-optics/src/commonMain/kotlin/arrow/optics/Every.kt index dc8fdad411f..561f6774b1c 100644 --- a/arrow-libs/optics/arrow-optics/src/commonMain/kotlin/arrow/optics/Every.kt +++ b/arrow-libs/optics/arrow-optics/src/commonMain/kotlin/arrow/optics/Every.kt @@ -330,58 +330,4 @@ public interface PEvery : PTraversal, Fold, PSette .foldMap(M, map) } } - - /** - * DSL to compose [Every] with a [Lens] for a structure [S] to see all its foci [A] - * - * @receiver [Lens] with a focus in [S] - * @return [Every] with a focus in [A] - */ - override val PLens.every: PEvery - get() = this@every.compose(this@PEvery) - - /** - * DSL to compose [Every] with a [Iso] for a structure [S] to see all its foci [A] - * - * @receiver [Iso] with a focus in [S] - * @return [Every] with a focus in [A] - */ - override val PIso.every: PEvery - get() = this@every.compose(this@PEvery) - - /** - * DSL to compose [Every] with a [Prism] for a structure [S] to see all its foci [A] - * - * @receiver [Prism] with a focus in [S] - * @return [Every] with a focus in [A] - */ - override val PPrism.every: PEvery - get() = this.compose(this@PEvery) - - /** - * DSL to compose [Every] with a [Optional] for a structure [S] to see all its foci [A] - * - * @receiver [Optional] with a focus in [S] - * @return [Every] with a focus in [A] - */ - override val POptional.every: PEvery - get() = this.compose(this@PEvery) - - /** - * DSL to compose [Every] with a [Setter] for a structure [S] to see all its foci [A] - * - * @receiver [Setter] with a focus in [S] - * @return [Setter] with a focus in [A] - */ - override val PSetter.every: PSetter - get() = this.compose(this@PEvery) - - /** - * DSL to compose [Every] with a [Traversal] for a structure [S] to see all its foci [A] - * - * @receiver [Traversal] with a focus in [S] - * @return [Traversal] with a focus in [A] - */ - override val PTraversal.every: PTraversal - get() = this.compose(this@PEvery) } diff --git a/arrow-libs/optics/arrow-optics/src/commonMain/kotlin/arrow/optics/Traversal.kt b/arrow-libs/optics/arrow-optics/src/commonMain/kotlin/arrow/optics/Traversal.kt index 8577383c007..e58035b2b0a 100644 --- a/arrow-libs/optics/arrow-optics/src/commonMain/kotlin/arrow/optics/Traversal.kt +++ b/arrow-libs/optics/arrow-optics/src/commonMain/kotlin/arrow/optics/Traversal.kt @@ -452,67 +452,4 @@ public fun interface PTraversal : PSetter { public fun tuple10(): Traversal, A> = pTuple10() } - - /** - * DSL to compose [Traversal] with a [Lens] for a structure [S] to see all its foci [A] - * - * @receiver [Lens] with a focus in [S] - * @return [Traversal] with a focus in [A] - */ - public val PLens.every: PTraversal - get() = this@every.compose(this@PTraversal) - - /** - * DSL to compose [Traversal] with a [Iso] for a structure [S] to see all its foci [A] - * - * @receiver [Iso] with a focus in [S] - * @return [Traversal] with a focus in [A] - */ - public val PIso.every: PTraversal - get() = this@every.compose(this@PTraversal) - - /** - * DSL to compose [Traversal] with a [Prism] for a structure [S] to see all its foci [A] - * - * @receiver [Prism] with a focus in [S] - * @return [Traversal] with a focus in [A] - */ - public val PPrism.every: PTraversal - get() = this@every.compose(this@PTraversal) - - /** - * DSL to compose [Traversal] with a [Optional] for a structure [S] to see all its foci [A] - * - * @receiver [Optional] with a focus in [S] - * @return [Traversal] with a focus in [A] - */ - public val POptional.every: PTraversal - get() = this@every.compose(this@PTraversal) - - /** - * DSL to compose [Traversal] with a [Setter] for a structure [S] to see all its foci [A] - * - * @receiver [Setter] with a focus in [S] - * @return [Setter] with a focus in [A] - */ - public val PSetter.every: PSetter - get() = this@every.compose(this@PTraversal) - - /** - * DSL to compose [Traversal] with a [Traversal] for a structure [S] to see all its foci [A] - * - * @receiver [Traversal] with a focus in [S] - * @return [Traversal] with a focus in [A] - */ - public val PTraversal.every: PTraversal - get() = this@every.compose(this@PTraversal) - - /** - * DSL to compose [Traversal] with a [PEvery] for a structure [S] to see all its foci [A] - * - * @receiver [PEvery] with a focus in [S] - * @return [PEvery] with a focus in [A] - */ - public val PEvery.every: PTraversal - get() = this@every.compose(this@PTraversal) } diff --git a/arrow-libs/resilience/arrow-resilience/build.gradle.kts b/arrow-libs/resilience/arrow-resilience/build.gradle.kts index c1baf1feef0..ba9d3ca78a8 100644 --- a/arrow-libs/resilience/arrow-resilience/build.gradle.kts +++ b/arrow-libs/resilience/arrow-resilience/build.gradle.kts @@ -32,10 +32,12 @@ kotlin { } } } -} -tasks.jar { - manifest { - attributes["Automatic-Module-Name"] = "arrow.resilience" + jvm { + tasks.jvmJar { + manifest { + attributes["Automatic-Module-Name"] = "arrow.resilience" + } + } } } diff --git a/build.gradle.kts b/build.gradle.kts index f6d07222544..ec3a43d240b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,6 +9,7 @@ buildscript { repositories { mavenCentral() maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") } dependencies { @@ -20,6 +21,7 @@ allprojects { repositories { mavenCentral() maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") } } diff --git a/gradle.properties b/gradle.properties index bce2b6e057d..2f87e20b88c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -29,6 +29,7 @@ kotlin.native.ignoreDisabledTargets=true kotlin.native.cacheKind.linuxX64=none # https://youtrack.jetbrains.com/issue/KT-45545#focus=Comments-27-4773544.0-0 kapt.use.worker.api=false +kotlin.mpp.applyDefaultHierarchyTemplate=false COMMON_SETUP=../gradle/setup.gradle ROOT_PROJECT=../gradle/main.gradle diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6484db25557..c6ff83549b2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,6 +12,7 @@ kotest = "5.6.2" kotestGradle = "5.6.2" kover = "0.7.3" kotlin = "1.9.0" +kotlinxSerializationPlugin = "1.9.0" kotlinBinaryCompatibilityValidator = "0.13.2" kotlinCompileTesting = "1.5.0" knit = "0.4.0" @@ -23,7 +24,6 @@ retrofitKotlinxSerialization = "1.0.0" spotlessVersion = "6.20.0" [libraries] -arrow-kotlinMetadata = { module = "io.arrow-kt:kotlin-metadata", version.ref = "kotlin" } coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } jUnitJUnit = { module = "junit:junit", version.ref = "jUnit" } @@ -67,6 +67,6 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref kotlin-binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinBinaryCompatibilityValidator" } kotlinx-knit = { id = "org.jetbrains.kotlinx.knit", version.ref = "knit" } kotlinx-kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } -kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlinxSerializationPlugin" } ksp = { id = "com.google.devtools.ksp", version.ref = "kspVersion" } spotless = { id = "com.diffplug.spotless", version.ref = "spotlessVersion" } diff --git a/settings.gradle.kts b/settings.gradle.kts index f055978731c..10289047764 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,6 +7,7 @@ pluginManagement { gradlePluginPortal() mavenCentral() mavenLocal() + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") } } @@ -21,6 +22,15 @@ dependencyResolutionManagement { gradlePluginPortal() mavenLocal() } + versionCatalogs { + create("libs") { + val kotlinOverride = System.getenv("KOTLIN_OVERRIDE") + if (!kotlinOverride.isNullOrBlank()) { + println("Overriding Kotlin version with $kotlinOverride") + version("kotlin", kotlinOverride) + } + } + } } //CORE