Package com.intellij.execution.configurations

Examples of com.intellij.execution.configurations.SimpleProgramParameters


    if (projectDir == null) {
      throw new CantRunException("Could not retrieve the project directory");
    }

    final SimpleProgramParameters params = new SimpleProgramParameters();
    ProgramParametersUtil.configureConfiguration(params, rustConfiguration);

    String outputPath = CompilerPaths.getModuleOutputPath(rustConfiguration.getModules()[0], false);
    if (outputPath == null) {
      throw new CantRunException("Could not retrieve the output directory");
    }

    // Build and run
    String execName = outputPath.concat("/").concat(rustConfiguration.getName());

    if (execName.endsWith(".rs")) {
      execName = execName.substring(0, execName.length() - 3);
    }

    if (SystemInfo.isWindows) {
      execName = execName.concat(".exe");
    }

    // Now run the build
    GeneralCommandLine commandLine = new GeneralCommandLine();

    commandLine.setExePath(execName);
    commandLine.addParameters(params.getProgramParametersList().getParameters());
    commandLine.getEnvironment().putAll(params.getEnv());
    commandLine.setWorkDirectory(params.getWorkingDirectory());

    return RustProcessHandler.runCommandLine(commandLine);
  }
View Full Code Here

TOP

Related Classes of com.intellij.execution.configurations.SimpleProgramParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.