mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[gui-test] do not add empty string to args if the platform prefix is empty or null
Signed-off-by: Sergey Karashevich <sergey.karashevich@jetbrains.com>
This commit is contained in:
+13
-1
@@ -223,7 +223,7 @@ object GuiTestLocalLauncher {
|
||||
.plus("-Didea.config.path=${GuiTestOptions.getConfigPath()}")
|
||||
.plus("-Didea.system.path=${GuiTestOptions.getSystemPath()}")
|
||||
.plus("-Dfile.encoding=${GuiTestOptions.getEncoding()}")
|
||||
.plus(if (ide.ideType.platformPrefix.isNullOrEmpty()) "" else "-Didea.platform.prefix=${ide.ideType.platformPrefix}")
|
||||
.plusIf(!ide.ideType.platformPrefix.isNullOrEmpty(), "-Didea.platform.prefix=${ide.ideType.platformPrefix}")
|
||||
.plus(customVmOptions)
|
||||
.plus("-Xdebug")
|
||||
.plus("-Xrunjdwp:transport=dt_socket,server=y,suspend=${GuiTestOptions.suspendDebug()},address=${GuiTestOptions.getDebugPort()}")
|
||||
@@ -390,4 +390,16 @@ object GuiTestLocalLauncher {
|
||||
return Paths.get(this.toURI()).toFile().path
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements of the original collection and then the given [element].
|
||||
*/
|
||||
private fun <T> List<T>.plusIf(condition: Boolean, element: T): List<T> {
|
||||
if (!condition) return this
|
||||
val result = ArrayList<T>(size + 1)
|
||||
result.addAll(this)
|
||||
result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user