Skip to content

Commit

Permalink
Revert "Display dynamic --jvm-target values when using --help flag (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed Jun 1, 2022
1 parent a949686 commit 80bae4b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
Expand Up @@ -2,7 +2,6 @@ package io.gitlab.arturbosch.detekt.cli

import com.beust.jcommander.IStringConverter
import com.beust.jcommander.ParameterException
import org.jetbrains.kotlin.config.JvmTarget
import org.jetbrains.kotlin.config.LanguageVersion
import java.io.File
import java.net.URL
Expand Down Expand Up @@ -55,15 +54,6 @@ class LanguageVersionConverter : IStringConverter<LanguageVersion> {
}
}

class JvmTargetConverter : IStringConverter<JvmTarget> {
override fun convert(value: String): JvmTarget {
val validValues by lazy { JvmTarget.values().joinToString { it.description } }
return requireNotNull(JvmTarget.fromString(value)) {
"\"$value\" passed to --jvm-target, expected one of [$validValues]"
}
}
}

class ClasspathResourceConverter : IStringConverter<URL> {
override fun convert(resource: String): URL {
val relativeResource = if (resource.startsWith("/")) resource else "/$resource"
Expand Down
Expand Up @@ -188,11 +188,10 @@ class CliArgs {

@Parameter(
names = ["--jvm-target"],
converter = JvmTargetConverter::class,
description = "EXPERIMENTAL: Target version of the generated JVM bytecode that was generated during " +
"compilation and is now being used for type resolution"
"compilation and is now being used for type resolution (1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 16 or 17)"
)
var jvmTarget: JvmTarget = JvmTarget.DEFAULT
var jvmTarget: String = JvmTarget.DEFAULT.description

@Parameter(
names = ["--version"],
Expand Down
Expand Up @@ -65,7 +65,7 @@ internal fun CliArgs.createSpec(output: Appendable, error: Appendable): Processi
}

compiler {
jvmTarget = args.jvmTarget.toString()
jvmTarget = args.jvmTarget
languageVersion = args.languageVersion?.versionString
classpath = args.classpath?.trim()
}
Expand Down

0 comments on commit 80bae4b

Please sign in to comment.