Skip to content

Commit 0eb291c

Browse files
feat: Update internal Kotlin version to 2.1.21-embedded
This commit updates the primary Kotlin version used by kscript for its own build and for the Gradle scripts it generates (e.g., for --idea and --package) from 1.7.21 to 2.1.21-embedded. Changes include: 1. **`build.gradle.kts`:** * The `kotlinVersion` property has been changed to "2.1.21-embedded". * The `kotlin("jvm")` plugin version has been updated to "2.1.21-embedded". * Dependencies on `org.jetbrains.kotlin:*` artifacts were already parameterized to use `kotlinVersion`, so they will automatically adopt the new version. 2. **`GradleTemplates.kt`:** * Verified that generated Gradle scripts for `--idea` and `--package` already use `KotlinVersion.CURRENT` to dynamically set their Kotlin plugin and `kotlin-script-runtime` versions. This ensures they will use the new "2.1.21-embedded" version. * Updated `kotlin-stdlib` declarations within these templates to also explicitly use the dynamic `kotlinVersion` for consistency and clarity. No other hardcoded references to the old Kotlin version were found in kscript's core operational code that required changes for this update. Runtime version information displayed to you (e.g., via `kscript --version`) should dynamically reflect this new version through `BuildConfig.KOTLIN_VERSION`.
1 parent 48c185a commit 0eb291c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import org.jetbrains.kotlin.util.capitalizeDecapitalize.toLowerCaseAsciiOnly
44
import java.time.ZoneOffset
55
import java.time.ZonedDateTime
66

7-
val kotlinVersion: String = "1.7.21"
7+
val kotlinVersion: String = "2.1.21-embedded"
88

99
plugins {
10-
kotlin("jvm") version "1.7.21"
10+
kotlin("jvm") version "2.1.21-embedded"
1111
application
1212
id("com.adarshr.test-logger") version "3.2.0"
1313
id("com.github.gmazzo.buildconfig") version "3.1.0"

src/main/kotlin/io/github/kscripting/kscript/code/GradleTemplates.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object GradleTemplates {
1010
fun createGradleIdeaScript(script: Script): String {
1111
val kotlinVersion = KotlinVersion.CURRENT
1212
val extendedDependencies = setOf(
13-
Dependency("org.jetbrains.kotlin:kotlin-stdlib"),
13+
Dependency("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"),
1414
Dependency("org.jetbrains.kotlin:kotlin-script-runtime:$kotlinVersion"),
1515
Dependency("io.github.kscripting:kscript-annotations:1.5.0"),
1616
) + script.dependencies
@@ -42,7 +42,7 @@ object GradleTemplates {
4242

4343
val kotlinVersion = KotlinVersion.CURRENT
4444
val extendedDependencies = setOf(
45-
Dependency("org.jetbrains.kotlin:kotlin-stdlib"),
45+
Dependency("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"),
4646
Dependency("org.jetbrains.kotlin:kotlin-script-runtime:$kotlinVersion")
4747
) + script.dependencies
4848

0 commit comments

Comments
 (0)