Skip to content

Commit

Permalink
Use fixated Kotlin compiler 2.0.20 for compiling Dokka
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Nov 1, 2024
1 parent 0ddbc9c commit 866ae14
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

import dokkabuild.utils.excludeGradleEmbeddedDependencies
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
Expand All @@ -12,10 +13,13 @@ plugins {
}

kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerVersion = libs.versions.gradlePlugin.kotlin.compiler
@Suppress("DEPRECATION", "DEPRECATION_ERROR")
compilerOptions {
// Must use Kotlin 1.4 to support Gradle 7
languageVersion = @Suppress("DEPRECATION") KotlinVersion.KOTLIN_1_4
apiVersion = @Suppress("DEPRECATION") KotlinVersion.KOTLIN_1_4
languageVersion = KotlinVersion.KOTLIN_1_4
apiVersion = KotlinVersion.KOTLIN_1_4
}
}

Expand Down
7 changes: 7 additions & 0 deletions build-logic/src/main/kotlin/dokkabuild.kotlin-jvm.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
id("dokkabuild.java")
kotlin("jvm")
Expand All @@ -11,6 +13,11 @@ val rootProjectsWithoutDependencyOnDokkaCore = listOf("dokka-integration-tests")

kotlin {
explicitApi()

if (dokkaBuild.kotlinLanguageLevel.isPresent) {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerVersion = libs.versions.gradlePlugin.kotlin.compiler
}
compilerOptions {
allWarningsAsErrors = true
languageVersion = dokkaBuild.kotlinLanguageLevel
Expand Down
1 change: 1 addition & 0 deletions dokka-runners/dokka-gradle-plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ version=2.0.20-SNAPSHOT
org.jetbrains.dokka.javaToolchain.mainCompiler=8
org.jetbrains.dokka.javaToolchain.testLauncher=8
org.jetbrains.dokka.kotlinLanguageLevel=1.4
kotlin.compiler.runViaBuildToolsApi=true

# Gradle settings
org.gradle.jvmargs=-Dfile.encoding=UTF-8
Expand Down
1 change: 1 addition & 0 deletions dokka-runners/runner-cli/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ version=2.0.20-SNAPSHOT
org.jetbrains.dokka.javaToolchain.mainCompiler=8
org.jetbrains.dokka.javaToolchain.testLauncher=8
org.jetbrains.dokka.kotlinLanguageLevel=1.4
kotlin.compiler.runViaBuildToolsApi=true
1 change: 1 addition & 0 deletions dokka-runners/runner-maven-plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ version=2.0.20-SNAPSHOT
org.jetbrains.dokka.javaToolchain.mainCompiler=8
org.jetbrains.dokka.javaToolchain.testLauncher=8
org.jetbrains.dokka.kotlinLanguageLevel=1.4
kotlin.compiler.runViaBuildToolsApi=true
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ version=2.0.20-SNAPSHOT
org.jetbrains.dokka.javaToolchain.mainCompiler=8
org.jetbrains.dokka.javaToolchain.testLauncher=8
org.jetbrains.dokka.kotlinLanguageLevel=1.4
kotlin.compiler.runViaBuildToolsApi=true

# Code style
kotlin.code.style=official
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[versions]

gradlePlugin-kotlin = "2.0.20"
# We use a different compiler version to use Kotlin Language/API version 1.4 to compile modules
# to be able to be compatible with Gradle 7.
gradlePlugin-kotlin-compiler = "2.0.20"
# See: https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin
gradlePlugin-android = "7.1.3"
gradlePlugin-dokka = "1.9.20"
Expand Down

0 comments on commit 866ae14

Please sign in to comment.