Search in sources :

Example 1 with EnvironmentVariablesData

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();
}
Also used : KarmaScopeKind(com.intellij.javascript.karma.scope.KarmaScopeKind) EnvironmentVariablesData(com.intellij.execution.configuration.EnvironmentVariablesData) NodePackage(com.intellij.javascript.nodejs.util.NodePackage)

Aggregations

EnvironmentVariablesData (com.intellij.execution.configuration.EnvironmentVariablesData)1 KarmaScopeKind (com.intellij.javascript.karma.scope.KarmaScopeKind)1 NodePackage (com.intellij.javascript.nodejs.util.NodePackage)1