use of com.intellij.execution.configuration.EnvironmentVariablesData in project intellij-plugins by JetBrains.
the class KarmaRunSettingsSerializationUtil method readXml.
public static KarmaRunSettings readXml(@NotNull Element element) {
KarmaRunSettings.Builder builder = new KarmaRunSettings.Builder();
builder.setConfigPath(JDOMExternalizerUtil.getFirstChildValueAttribute(element, CONFIG_FILE));
builder.setBrowsers(JDOMExternalizerUtil.getFirstChildValueAttribute(element, BROWSERS));
String karmaPackageDir = JDOMExternalizerUtil.getFirstChildValueAttribute(element, KARMA_PACKAGE_DIR);
if (karmaPackageDir != null) {
builder.setKarmaPackage(new NodePackage(karmaPackageDir));
}
String interpreterRefName = JDOMExternalizerUtil.getFirstChildValueAttribute(element, NODE_INTERPRETER);
builder.setInterpreterRef(NodeJsInterpreterRef.create(interpreterRefName));
EnvironmentVariablesData envData = EnvironmentVariablesData.readExternal(element);
builder.setEnvData(envData);
KarmaScopeKind scopeKind = readScopeKind(element);
builder.setScopeKind(scopeKind);
if (scopeKind == KarmaScopeKind.TEST_FILE) {
builder.setTestFilePath(JDOMExternalizerUtil.getFirstChildValueAttribute(element, TEST_FILE_PATH));
} else if (scopeKind == KarmaScopeKind.SUITE || scopeKind == KarmaScopeKind.TEST) {
builder.setTestNames(readTestNames(element));
}
return builder.build();
}
Aggregations