for (String name : optionList.split("\\s*,\\s*")) {
String[] parts = name.split("=", 2);
String optName = parts[0];
try {
// The Option constants are upper caseā¦
Option o = Option.valueOf(optName.toUpperCase(Locale.getDefault()));
// If an argument has been specified, use it.
String value = parts.length == 2 ? parts[1] : null;
options.put(o, value);
} catch (IllegalArgumentException e) {
throw new BuildException("Unknown option " + optName);