diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8607894e725..6af3f70f8a2 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=2.0.0-dev-4562 -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/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!!) } } }