Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import io.cucumber.core.exception.CucumberException;
import io.cucumber.core.feature.FeatureWithLines;
import io.cucumber.core.feature.GluePath;
import io.cucumber.core.logging.Logger;
import io.cucumber.core.logging.LoggerFactory;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -35,6 +38,24 @@

public final class CucumberPropertiesParser {

private static final Logger log = LoggerFactory.getLogger(CucumberPropertiesParser.class);
private static final List<String> COMMANDLINE_OPTION_ALTERNATIVES = Arrays.asList(
ANSI_COLORS_DISABLED_PROPERTY_NAME,
EXECUTION_DRY_RUN_PROPERTY_NAME,
EXECUTION_LIMIT_PROPERTY_NAME,
EXECUTION_ORDER_PROPERTY_NAME,
EXECUTION_STRICT_PROPERTY_NAME,
WIP_PROPERTY_NAME,
FEATURES_PROPERTY_NAME,
FILTER_NAME_PROPERTY_NAME,
FILTER_TAGS_PROPERTY_NAME,
GLUE_PROPERTY_NAME,
OBJECT_FACTORY_PROPERTY_NAME,
PLUGIN_PROPERTY_NAME,
SNIPPET_TYPE_PROPERTY_NAME
);


private static <T> Function<String, Collection<T>> splitAndMap(Function<String, T> parse) {
return combined -> stream(combined.split(","))
.map(String::trim)
Expand All @@ -56,6 +77,10 @@ public RuntimeOptionsBuilder parse(Map<String, String> properties) {
String cucumberOptions = properties.get(OPTIONS_PROPERTY_NAME);
if (cucumberOptions != null) {
builder = parseCucumberOptions(cucumberOptions);
log.warn(() ->
"Passing commandline options via the property `" + OPTIONS_PROPERTY_NAME + "` has been deprecated" +
"in favour of explicitly using property names.\nPlease use these instead: " + COMMANDLINE_OPTION_ALTERNATIVES
);
} else {
builder = new RuntimeOptionsBuilder();
}
Expand Down