From 3b97bfb426dd78f03f4c40bdb83b90f809d318ef Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sun, 19 Feb 2023 08:01:21 +0100 Subject: [PATCH] Extract kotlinLanguageVersion to gradle.properties Read it when building docs in order to keep docs version filter/language analyzer version in sync with the language version used to compile libraries. --- build.gradle.kts | 2 +- gradle.properties | 1 + libraries/tools/kotlin-stdlib-docs/build.gradle.kts | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8e602fc4d31..dd7c2790b25 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -63,7 +63,7 @@ val kotlinVersion by extra( } ?: buildNumber ) -val kotlinLanguageVersion by extra("1.9") +val kotlinLanguageVersion: String by extra extra["kotlin_root"] = rootDir diff --git a/gradle.properties b/gradle.properties index 9ffe19b274f..7b606afb726 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,6 +31,7 @@ systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true cacheRedirectorEnabled=true defaultSnapshotVersion=1.9.255-SNAPSHOT +kotlinLanguageVersion=1.9 kotlin.build.gradlePlugin.version=0.0.39 diff --git a/libraries/tools/kotlin-stdlib-docs/build.gradle.kts b/libraries/tools/kotlin-stdlib-docs/build.gradle.kts index fc4dd3ab366..fde39dc6fef 100644 --- a/libraries/tools/kotlin-stdlib-docs/build.gradle.kts +++ b/libraries/tools/kotlin-stdlib-docs/build.gradle.kts @@ -18,6 +18,7 @@ val rootProperties = java.util.Properties().apply { file(kotlin_root).resolve("gradle.properties").inputStream().use { stream -> load(stream) } } val defaultSnapshotVersion: String by rootProperties +val kotlinLanguageVersion: String by rootProperties val githubRevision = if (isTeamcityBuild) project.property("githubRevision") else "master" val artifactsVersion by extra(if (isTeamcityBuild) project.property("deployVersion") as String else defaultSnapshotVersion) @@ -28,6 +29,7 @@ println("# Parameters summary:") println(" isTeamcityBuild: $isTeamcityBuild") println(" dokka version: $dokka_version") println(" githubRevision: $githubRevision") +println(" language version: $kotlinLanguageVersion") println(" artifacts version: $artifactsVersion") println(" artifacts repo: $artifactsRepo") @@ -387,7 +389,7 @@ fun GradleDokkaSourceSetBuilder.sourceLinksFromRoot() { } run { - val versions = listOf(/*"1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7",*/ "1.8") + val versions = listOf(/*"1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7",*/ kotlinLanguageVersion) val latestVersion = versions.last() // builds this version/all versions as historical for the next versions builds