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 non-deprecated Kotlin DSL for Kotlin compile options #1495

Closed
CXwudi opened this issue Jan 1, 2024 · 1 comment
Closed

Use non-deprecated Kotlin DSL for Kotlin compile options #1495

CXwudi opened this issue Jan 1, 2024 · 1 comment

Comments

@CXwudi
Copy link

CXwudi commented Jan 1, 2024

In recent version of Kotlin Gradle Plugin, tasks.withType<KotlinCompile>.kotlinOptions is marked as deprecated

image

A better DSL is:

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

kotlin {
  compilerOptions {
    freeCompilerArgs = freeCompilerArgs.get() + listOf("-Xjsr305=strict")
    jvmTarget = JvmTarget.JVM_21
  }
}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 1, 2024
@snicoll snicoll changed the title [Enhancement] New DSL for configuring Kotlin Use non-deprecated Kotlin DSL Jan 2, 2024
@mhalbritter mhalbritter added type: enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 31, 2024
@mhalbritter mhalbritter changed the title Use non-deprecated Kotlin DSL Use non-deprecated Kotlin DSL for Kotlin compile options Jan 31, 2024
@mhalbritter
Copy link
Contributor

One problem I stumbled upon is that there's no JvmTarget.JVM_22.

@mhalbritter mhalbritter added this to the 0.21.0 milestone Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants