diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 740cf2c4855..59c2be88b75 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -165,9 +165,6 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 - env: - KOTLIN_OVERRIDE: 1.9.30-dev-1098 - steps: - uses: actions/checkout@v4 with: @@ -182,7 +179,7 @@ jobs: - name: jvmTest (K2 enabled) uses: gradle/gradle-build-action@v2 with: - arguments: jvmTest -Pkotlin.experimental.tryK2=true + arguments: "jvmTest -Pkotlin_version=1.9.30-dev-2548 -Pkotlin_repo_url=https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap -Pkotlin_language_version=2.0" - name: Upload reports if: failure() diff --git a/arrow-libs/core/arrow-atomic/build.gradle.kts b/arrow-libs/core/arrow-atomic/build.gradle.kts index c5930a388cc..53e4715ae43 100644 --- a/arrow-libs/core/arrow-atomic/build.gradle.kts +++ b/arrow-libs/core/arrow-atomic/build.gradle.kts @@ -1,5 +1,8 @@ @file:Suppress("DSL_SCOPE_VIOLATION") +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + + plugins { id(libs.plugins.kotlin.multiplatform.get().pluginId) alias(libs.plugins.arrowGradleConfig.kotlin) @@ -77,3 +80,9 @@ kotlin { } } } + +tasks.withType().configureEach { + kotlinOptions { + freeCompilerArgs = freeCompilerArgs + "-Xexpect-actual-classes" + } +} 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 4b1a23e872e..b33d6f29d9a 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 @@ -18,13 +18,13 @@ public typealias ValidatedNel = Validated, A> @Deprecated( ValidatedDeprMsg + "Use Right to construct Either values instead", - ReplaceWith("Either.Right(value)", "arrow.core.Either") + ReplaceWith("Either.Right", "arrow.core.Either") ) public typealias Valid = Validated.Valid @Deprecated( ValidatedDeprMsg + "Use Left to construct Either values instead", - ReplaceWith("Either.Left(value)", "arrow.core.Either") + ReplaceWith("Either.Left", "arrow.core.Either") ) public typealias Invalid = Validated.Invalid @@ -318,7 +318,7 @@ public sealed class Validated { @Deprecated( ValidatedDeprMsg + "Use Right to construct Either values instead", - ReplaceWith("Either.Right(value)", "arrow.core.Either") + ReplaceWith("Either.Right", "arrow.core.Either") ) public data class Valid(val value: A) : Validated() { override fun toString(): String = "Validated.Valid($value)" @@ -332,7 +332,7 @@ public sealed class Validated { @Deprecated( ValidatedDeprMsg + "Use Left to construct Either values instead", - ReplaceWith("Either.Left(value)", "arrow.core.Either") + ReplaceWith("Either.Left", "arrow.core.Either") ) public data class Invalid(val value: E) : Validated() { override fun toString(): String = "Validated.Invalid($value)" diff --git a/build.gradle.kts b/build.gradle.kts index 1f29a72bc3e..004599263ac 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,7 @@ import kotlinx.knit.KnitPluginExtension import org.jetbrains.dokka.gradle.DokkaMultiModuleTask import org.jetbrains.dokka.gradle.DokkaTaskPartial import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { repositories { @@ -21,7 +22,16 @@ allprojects { repositories { mavenCentral() maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") + (project.rootProject.properties["kotlin_repo_url"] as? String)?.also { maven(it) } + } + + tasks { + withType { + kotlinOptions { + (project.rootProject.properties["kotlin_language_version"] as? String)?.also { languageVersion = it } + (project.rootProject.properties["kotlin_api_version"] as? String)?.also { apiVersion = it } + } + } } } diff --git a/settings.gradle.kts b/settings.gradle.kts index bb9ced41f33..771956c34f2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,11 +3,12 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") rootProject.name = "arrow" pluginManagement { + @Suppress("LocalVariableName") val kotlin_repo_url: String? by settings repositories { gradlePluginPortal() mavenCentral() mavenLocal() - maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") + kotlin_repo_url?.also { maven(it) } } } @@ -17,17 +18,20 @@ plugins { } dependencyResolutionManagement { + @Suppress("LocalVariableName") val kotlin_repo_url: String? by settings + @Suppress("LocalVariableName") val kotlin_version: String? by settings + repositories { mavenCentral() gradlePluginPortal() mavenLocal() + kotlin_repo_url?.also { maven(it) } } versionCatalogs { create("libs") { - val kotlinOverride = System.getenv("KOTLIN_OVERRIDE") - if (!kotlinOverride.isNullOrBlank()) { - println("Overriding Kotlin version with $kotlinOverride") - version("kotlin", kotlinOverride) + if (!kotlin_version.isNullOrBlank()) { + println("Overriding Kotlin version with $kotlin_version") + version("kotlin", kotlin_version!!) } } }