Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fixated Kotlin compiler 2.0.20 for compiling Dokka #3896

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading