mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[Java] Add new options for java command in terminal
IDEA-359564 GitOrigin-RevId: 378df84aca4ba2f6ab42562c27cca4a68400a3d2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
657d58b6c4
commit
396a161c7a
@@ -70,5 +70,14 @@ java.command.terminal.source.option.argument.text=version
|
||||
java.command.terminal.disable.@files.option.description=Disable further argument file expansion.
|
||||
java.command.terminal.illegal.access.option.description=\\<value\\> permit or deny access to members of types in named modules by code in unnamed modules. \\<value\\> is one of "deny", "permit", "warn", or "debug" This option will be removed in a future release.
|
||||
java.command.terminal.illegal.access.option.argument.text=value
|
||||
java.command.terminal.disable.system.assertions.option.description=Disables assertions in all system classes.
|
||||
java.command.terminal.disable.assertions.option.description=Disables assertions with specified granularity.
|
||||
java.command.terminal.enable.system.assertions.option.description=Enables assertions in all system classes.
|
||||
java.command.terminal.enable.assertions.option.description=Enables assertions with specified granularity.
|
||||
java.command.terminal.assertions.option.argument.text=<package>|<class>
|
||||
java.command.terminal.enable.preview.option.description=Allows classes to depend on preview features of the release.
|
||||
java.command.terminal.verbose.option.description=Enables verbose output for the given subsystem.
|
||||
java.command.terminal.verbose.option.argument.text.8=class|gc|gni
|
||||
java.command.terminal.verbose.option.argument.text.11=class|module|gc|gni
|
||||
error.stream.name=error
|
||||
output.stream.name=output
|
||||
@@ -23,7 +23,9 @@ class JavaShellCommandSpecsProvider : ShellCommandSpecsProvider {
|
||||
addOptionsFromVM(javaContext.getJrePath())
|
||||
val version = javaContext.getJavaVersion() ?: return@dynamicOptions
|
||||
if (version.isAtLeast(11)) {
|
||||
addDoubleDashedOptions()
|
||||
addOptionsFromJava11()
|
||||
} else if (version.isAtLeast(8)) {
|
||||
addOptionsFromJava8()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +65,30 @@ class JavaShellCommandSpecsProvider : ShellCommandSpecsProvider {
|
||||
exclusiveOn = listOf("--show-version")
|
||||
description(JavaTerminalBundle.message("java.command.terminal.show.version.option.description", errorStreamName))
|
||||
}
|
||||
option("-dsa", "-enablesystemassertions") {
|
||||
description(JavaTerminalBundle.message("java.command.terminal.disable.system.assertions.option.description"))
|
||||
}
|
||||
option("-esa", "-disablesystemassertions") {
|
||||
description(JavaTerminalBundle.message("java.command.terminal.enable.system.assertions.option.description"))
|
||||
}
|
||||
option("-ea", "-enableassertions") {
|
||||
repeatTimes = 0
|
||||
separator = ":"
|
||||
description(JavaTerminalBundle.message("java.command.terminal.enable.assertions.option.description"))
|
||||
argument {
|
||||
displayName(JavaTerminalBundle.message("java.command.terminal.assertions.option.argument.text"))
|
||||
isOptional = true
|
||||
}
|
||||
}
|
||||
option("-da", "-disableassertions") {
|
||||
repeatTimes = 0
|
||||
description(JavaTerminalBundle.message("java.command.terminal.disable.assertions.option.description"))
|
||||
separator = ":"
|
||||
argument {
|
||||
displayName(JavaTerminalBundle.message("java.command.terminal.assertions.option.argument.text"))
|
||||
isOptional = true
|
||||
}
|
||||
}
|
||||
argument {
|
||||
displayName(JavaTerminalBundle.message("java.command.terminal.argument.main.class.text"))
|
||||
suggestions(ShellDataGenerators.fileSuggestionsGenerator())
|
||||
@@ -105,7 +131,7 @@ class JavaShellCommandSpecsProvider : ShellCommandSpecsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private fun ShellChildOptionsContext.addDoubleDashedOptions() {
|
||||
private fun ShellChildOptionsContext.addOptionsFromJava11() {
|
||||
val outputStreamName = JavaTerminalBundle.message("output.stream.name")
|
||||
option("--version") {
|
||||
exclusiveOn = listOf("-version")
|
||||
@@ -130,6 +156,31 @@ class JavaShellCommandSpecsProvider : ShellCommandSpecsProvider {
|
||||
exclusiveOn = listOf("-?", "-help", "-h")
|
||||
description(JavaTerminalBundle.message("java.command.terminal.help.option.description", outputStreamName))
|
||||
}
|
||||
option("--enable-preview") {
|
||||
description(JavaTerminalBundle.message("java.command.terminal.enable.preview.option.description"))
|
||||
}
|
||||
|
||||
option("-verbose") {
|
||||
description(JavaTerminalBundle.message("java.command.terminal.verbose.option.description"))
|
||||
separator=":"
|
||||
repeatTimes = 0
|
||||
argument {
|
||||
isOptional = true
|
||||
displayName(JavaTerminalBundle.message("java.command.terminal.verbose.option.argument.text.11"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun ShellChildOptionsContext.addOptionsFromJava8() {
|
||||
option("-verbose") {
|
||||
description(JavaTerminalBundle.message("java.command.terminal.verbose.option.description"))
|
||||
separator=":"
|
||||
repeatTimes = 0
|
||||
argument {
|
||||
isOptional = true
|
||||
displayName(JavaTerminalBundle.message("java.command.terminal.verbose.option.argument.text.8"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getOptionBundleKey(option: String): String = "java.command.terminal.${getCanonicalOptionName(option)}.option.description"
|
||||
|
||||
Reference in New Issue
Block a user