Examples of GeneralCommandLine


Examples of com.intellij.execution.configurations.GeneralCommandLine

    final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
    assert sdk != null;
    assert settings.getHaxeTarget() == HaxeTarget.NEKO;
    final HaxeSdkData sdkData = sdk.getSdkAdditionalData() instanceof HaxeSdkData ? (HaxeSdkData)sdk.getSdkAdditionalData() : null;

    GeneralCommandLine commandLine = getCommandForNeko(sdkData, settings);

    return new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  private GeneralCommandLine getCommandForNeko(@Nullable HaxeSdkData sdkData, HaxeModuleSettings settings) throws ExecutionException {
    if (sdkData == null || sdkData.getNekoBinPath() == null || sdkData.getNekoBinPath().isEmpty()) {
      throw new ExecutionException(HaxeBundle.message("haxe.run.bad.neko.bin.path"));
    }

    GeneralCommandLine commandLine = new GeneralCommandLine();

    commandLine.setExePath(sdkData.getNekoBinPath());
    //commandLine.setWorkDirectory(PathUtil.getParentPath(module.getModuleFilePath()));

    //Get output path provided in settings
    //Neko is always compiled to /release/ folder
    String workDirectory = settings.getOutputFolder() + "/release/";

    commandLine.setWorkDirectory(workDirectory);
    if (customFileToLaunch != null) {
      commandLine.addParameter(customFileToLaunch);
    }
    else {
      final VirtualFile outputDirectory = CompilerPaths.getModuleOutputDirectory(module, false);
      final VirtualFile fileToLaunch = outputDirectory != null ? outputDirectory.findChild(settings.getOutputFileName()) : null;
      String outputFileName = settings.getOutputFileName();
      if (fileToLaunch != null) {
        commandLine.addParameter(fileToLaunch.getPath());
      }
      else if (outputFileName != null) {
        commandLine.addParameter(outputFileName);
      }
    }

    //Make sure to have one command line parameter which contains file name
    assert commandLine.getParametersList().getArray().length == 1;

    final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(module.getProject());
    setConsoleBuilder(consoleBuilder);
    return commandLine;
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

    if (exePath == null) {
      return null;
    }

    final GeneralCommandLine command = new GeneralCommandLine();
    command.setExePath(exePath);
    command.addParameter("-help");
    command.setWorkDirectory(path);

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

      if (output.getExitCode() != 0) {
        LOG.error("Haxe compiler exited with invalid exit code: " + output.getExitCode());
        return null;
      }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  protected ProcessHandler startProcess() throws ExecutionException {
    return doStartProcess(null);
  }

  protected ProcessHandler doStartProcess(final @Nullable String overriddenMainFilePath) throws ExecutionException {
    final GeneralCommandLine commandLine = createCommandLine(overriddenMainFilePath);
    final OSProcessHandler processHandler = new OSProcessHandler(commandLine);
    ProcessTerminatedListener.attach(processHandler, getEnvironment().getProject());
    return processHandler;
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

    final String workingDir = StringUtil.isEmptyOrSpaces(myRunnerParameters.getWorkingDirectory())
                              ? dartFile.getParent().getPath()
                              : myRunnerParameters.getWorkingDirectory();

    final GeneralCommandLine commandLine = new GeneralCommandLine().withWorkDirectory(workingDir);
    commandLine.setExePath(FileUtil.toSystemDependentName(dartExePath));
    commandLine.getEnvironment().putAll(myRunnerParameters.getEnvs());
    commandLine.setPassParentEnvironment(myRunnerParameters.isIncludeParentEnvs());
    setupParameters(getEnvironment().getProject(), commandLine, myRunnerParameters, overriddenMainFilePath);

    return commandLine;
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

  @Nullable
  protected OSProcessHandler createProcessHandler(@NotNull final Project project, final int port) throws ExecutionException {
    final DartSdk dartSdk = DartSdk.getGlobalDartSdk();
    if (dartSdk == null) return null;

    final GeneralCommandLine commandLine = new GeneralCommandLine().withWorkDirectory(firstServedDir.getParent().getPath());
    commandLine.setExePath(FileUtil.toSystemDependentName(DartSdkUtil.getPubPath(dartSdk)));
    commandLine.addParameter("serve");
    commandLine.addParameter(firstServedDir.getName());
    commandLine.addParameter("--port=" + String.valueOf(port));
    //commandLine.addParameter("--admin-port=" + String.valueOf(PubServerManager.findOneMoreAvailablePort(port))); // todo uncomment and use

    final OSProcessHandler processHandler = new OSProcessHandler(commandLine);
    processHandler.addProcessListener(new PubServeOutputListener(project));
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

    if (!pubFile.isFile()) return;

    final String[] pubParameters = calculatePubParameters(module.getProject());

    if (pubParameters != null) {
      final GeneralCommandLine command = new GeneralCommandLine().withWorkDirectory(pubspecYamlFile.getParent().getPath());
      command.setExePath(pubFile.getPath());
      command.addParameters(pubParameters);

      doPerformPubAction(module, pubspecYamlFile, command, getTitle());
    }
  }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

    this.project = project;
  }

  @Override
  public void run() {
    final GeneralCommandLine generalCommandLine = new GeneralCommandLine(PhoneGapSettings.IOS_SIM, "--version");
    generalCommandLine.setWorkDirectory(project.getBasePath());
    try {
      generalCommandLine.createProcess();
    } catch (Exception e) {
      /* ios-sim not run */
      String groupeDisplayId = "PhoneGap notification";
      String notificationTitle = "PhoneGap Plugin";
      String notificationMessage = "ios-sim not detected";
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

            noPhoneGap();
            return;
        }

        String phoneGapExecutablePath = instance.getExecutablePath();
        final GeneralCommandLine generalCommandLine = new GeneralCommandLine(phoneGapExecutablePath, "--version");
        generalCommandLine.setWorkDirectory(myProject.getBasePath());
        try {
            final OSProcessHandler handler = new OSProcessHandler(generalCommandLine);
            //handler.addProcessListener(this);
            handler.startNotify();
            generalCommandLine.createProcess();
        } catch (Exception e) {
            noPhoneGap();

        }
    }
View Full Code Here

Examples of com.intellij.execution.configurations.GeneralCommandLine

      return Collections.emptyList();
    }
  }

  private OSProcessHandler serve(String extraArg) throws ExecutionException {
    GeneralCommandLine commandLine = new GeneralCommandLine(concat(newArrayList(myPath, "serve"), parseArgs(extraArg)));
    commandLine.withWorkDirectory(myWorkDir);
    return KillableColoredProcessHandler.create(commandLine);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.