fun parseOptions()

in common/src/main/kotlin/com/jetbrains/teamcity/plugins/unrealengine/common/buildgraph/BuildGraphParameters.kt [67:91]


    fun parseOptions(runnerParameters: Map<String, String>): List<BuildGraphOption> {
        val optionsString = runnerParameters[name]
        if (optionsString.isNullOrEmpty()) {
            return emptyList()
        }

        return optionsString
            .split("\r\n", "\r", "\n")
            .filter { it.isNotEmpty() }
            .map { optionString ->
                val indexOfEqual = optionString.indexOf('=')
                if (indexOfEqual == -1) {
                    raise(PropertyValidationError(name, "Make sure all options are in the required 'OPTION_NAME=OPTION_VALUE' format."))
                }

                val optionName = optionString.substring(0, indexOfEqual)
                val optionValue = optionString.substring(indexOfEqual + 1)

                if (optionName.isEmpty()) {
                    raise(PropertyValidationError(BuildGraphOptionsParameter.name, "All options must have a name."))
                }

                BuildGraphOption(optionName, optionValue)
            }
    }