Package com.intellij.execution.configurations

Examples of com.intellij.execution.configurations.GeneralCommandLine


  public FetchCommand(GitConfiguration configuration) {
    super(configuration);
  }

  public void run() throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("fetch");
    cli.addParameter("-v");
    exec(cli);
  }
View Full Code Here


  public CheckoutCommand(GitConfiguration configuration) {
    super(configuration);
  }
 
  public void forceCheckout(String ref) throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("checkout");
    cli.addParameter("-f");
    cli.addParameter(ref);
    exec(cli);
  }
View Full Code Here

  public BranchCommand(GitConfiguration configuration) {
    super(configuration);
  }
 
  public String[] local() throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("branch");
    cli.addParameter("--no-color");
    return parse(exec(cli).getStdout());
  }
View Full Code Here

    cli.addParameter("--no-color");
    return parse(exec(cli).getStdout());
  }

  public String[] remote() throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("branch");
    cli.addParameter("--no-color");
    cli.addParameter("-r");
    return parse(exec(cli).getStdout());
  }
View Full Code Here

    }
    return branches.toArray(new String[0]);
  }
 
  public void delete(String branch) throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("branch");
    cli.addParameter("--no-color");
    cli.addParameter("-D");
    cli.addParameter(branch);
    exec(cli);
  }
View Full Code Here

    cli.addParameter(branch);
    exec(cli);
  }
 
  public void track(String branch, String remote) throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("branch");
    cli.addParameter(branch);
    cli.addParameter("--no-color");
    cli.addParameter("--track");
    cli.addParameter(remote);
    exec(cli);
  }
View Full Code Here

  public DiffCommand(GitConfiguration configuration) {
    super(configuration);
  }

  public Collection<NameAndStatus> run(VersionNumber from, VersionNumber to)throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("diff");
    cli.addParameter("--no-color");
    cli.addParameter("--name-status");
    cli.addParameter(from.getHash());
    cli.addParameter(to.getHash());
    return parseNamesAndStatuses(exec(cli).getStdout());
  }
View Full Code Here

    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

  public static RustSdkData getCompilerInfo(File rustc) {
        final RustSdkData sdkData = new RustSdkData(rustc.getAbsolutePath());

    try {
      GeneralCommandLine command = new GeneralCommandLine();
      command.setExePath(rustc.getAbsolutePath());
      command.addParameter("--version");
      command.setWorkDirectory(rustc.getParent());

      ProcessOutput output = new CapturingProcessHandler(
          command.createProcess(),
          Charset.defaultCharset(),
          command.getCommandLineString()).runProcess();

      if (output.getExitCode() != 0) {
        LOG.error(
                    "rustc exited with invalid exit code: " +
                    output.getExitCode() + "\n" +
View Full Code Here

      throw new ExecutionException("No SDK configured for this project.");
    }
    if (!(defaultSdk.getSdkType() instanceof RustSdkType)) {
      throw new ExecutionException("This project doesn't have a Rust SDK configured.");
    }
    final GeneralCommandLine cmdLine = new GeneralCommandLine();

    final RunConfiguration runConfig = scope.getUserData(CompileStepBeforeRun.RUN_CONFIGURATION);
    if (runConfig == null) {
      throw new ExecutionException("'Run Configuration' not found. If you're trying to compile without running, that's not yet supported");
    }
    final RustConfiguration rustConfiguration = (RustConfiguration) runConfig;
    final CompilerModuleExtension compilerModuleExtension = CompilerModuleExtension.getInstance(rustConfiguration.getModules()[0]);
    if (compilerModuleExtension == null) {
      throw new ExecutionException("Cannot find compiler module extension from module");
    }

        final String outputPathUrl = CompilerPaths.getModuleOutputPath(rustConfiguration.getModules()[0], false);

    File outputPathFile = new File(outputPathUrl);
    if (!outputPathFile.exists()) {
      if (!outputPathFile.mkdirs()) {
        throw new ExecutionException("Cannot create output path '" + outputPathUrl + "'");
      }
    }

    cmdLine.setWorkDirectory(new File(project.getBasePath()));
    cmdLine.setExePath(RustSdkUtil.testRustSdk(defaultSdk.getHomePath()).pathRustc);
    cmdLine.addParameter(rustConfiguration.mainFile);
    cmdLine.addParameters("-o", outputPathUrl.concat("/").concat(rustConfiguration.getName()));

    final Process process = cmdLine.createProcess();

    return new OSProcessHandler(process, null, mySystemCharset) {
      @Override
      protected boolean shouldDestroyProcessRecursively() {
        return true;
View Full Code Here

TOP

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

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.