Examples of PhoneGapCommandLine


Examples of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.commandLine.PhoneGapCommandLine

          try {
            ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
            indicator.setText("Creating...");
            File tempProject = createTemp();
            PhoneGapCommandLine commandLine = new PhoneGapCommandLine(settings.getExecutable(), tempProject.getPath());

            if (!commandLine.isCorrectExecutable()) {
              showErrorMessage("Incorrect path");
              return;
            }
            commandLine.createNewProject(settings.name());

            File[] array = tempProject.listFiles();
            if (array != null && array.length != 0) {
              File from = ContainerUtil.getFirstItem(ContainerUtil.newArrayList(array));
              assert from != null;
View Full Code Here

Examples of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.commandLine.PhoneGapCommandLine

    final Ref<PhoneGapPackageManagementService> service = new Ref<PhoneGapPackageManagementService>();
    final Ref<String> error = new Ref<String>();
    final Ref<String> warning = new Ref<String>();
    final Ref<String> version = new Ref<String>();
    try {
      PhoneGapCommandLine commandLine = checkParams(error, warning, version, path, workDir);

      if (error.get() == null) {
        service.set(new PhoneGapPackageManagementService(commandLine, repositoryStore));
      }
    }
View Full Code Here

Examples of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.commandLine.PhoneGapCommandLine

    if (!new File(workDir).exists()) {
      pathError = true;
      workDir = myProject.getBasePath();
    }

    PhoneGapCommandLine commandLine = new PhoneGapCommandLine(path, workDir);
    if (!commandLine.isCorrectExecutable()) {
      error.set(PhoneGapBundle.message("phonegap.plugins.executable.error"));
      return commandLine;
    }
    version.set(commandLine.version());

    if (pathError) {
      error.set(PhoneGapBundle.message("phonegap.plugins.executable.work.path.error", commandLine.getPlatformName()));
      return commandLine;
    }

    ProcessOutput output = commandLine.pluginListRaw();
    if (!StringUtil.isEmpty(output.getStderr())) {
      error.set(PhoneGapBundle.message("phonegap.plugins.executable.work.path.error", commandLine.getPlatformName()));
      return commandLine;
    }

    if (commandLine.isOld()) {
      warning.set(PhoneGapBundle.message("phonegap.plugins.executable.version.error"));
    }

    return commandLine;
  }
View Full Code Here

Examples of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.commandLine.PhoneGapCommandLine

      try {
        if (StringUtil.isEmpty(path)) {
          return new ValidationInfo("Please select path to executable");
        }

        new PhoneGapCommandLine(path, null).version();
        error = false;
      }
      catch (Exception e) {
        error = true;
      }
View Full Code Here

Examples of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.commandLine.PhoneGapCommandLine

                             final RunConfiguration configuration,
                             ExecutionEnvironment env,
                             PhoneGapAddPlatformTask task) {

    final PhoneGapRunConfiguration phoneGapRunConfiguration = (PhoneGapRunConfiguration)configuration;
    final PhoneGapCommandLine line = phoneGapRunConfiguration.getCommandLine();

    //skip for phonegap (it do platform add in run command)
    if (!line.needAddPlatform()) {
      return true;
    }

    final Project project = configuration.getProject();
    final Semaphore targetDone = new Semaphore();
    final Ref<Boolean> result = new Ref<Boolean>(true);
    final List<Exception> exceptions = new ArrayList<Exception>();
    ApplicationManager.getApplication().invokeAndWait(new Runnable() {
      public void run() {

        //Save all opened documents
        FileDocumentManager.getInstance().saveAllDocuments();
        targetDone.down();

        new Task.Backgroundable(project, "Init PhoneGap/Cordova platform", true) {

          public boolean shouldStartInBackground() {
            return true;
          }

          public void run(@NotNull final ProgressIndicator indicator) {
            try {
              String platform = phoneGapRunConfiguration.getPlatform();
              assert platform != null;
              ProcessOutput output = line.platformAdd(platform);
              if (output.getExitCode() != 0) {
                ExecutionHelper.showOutput(project, output, "Init PhoneGap/Cordova platform", null, true);
                result.set(false);
                targetDone.up();
                return;
View Full Code Here

Examples of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.commandLine.PhoneGapCommandLine

      checkExistsSdkWithWarning(PhoneGapTargets.getIosSimName(), "Cannot detect ios-sim in path");
    }
  }

  public PhoneGapCommandLine getCommandLine() {
    PhoneGapCommandLine current = myCommandLine;
    String executable = getExecutable();
    String workDir = getWorkDir();
    if (current != null && StringUtil.equals(current.getPath(), executable) && StringUtil.equals(current.getWorkDir(), workDir)) {
      return current;
    }
    assert executable != null;
    assert workDir != null;

    current = new PhoneGapCommandLine(executable, workDir);
    myCommandLine = current;

    return current;
  }
View Full Code Here

Examples of com.github.masahirosuzuka.PhoneGapIntelliJPlugin.commandLine.PhoneGapCommandLine

  }

  @NotNull
  @Override
  protected ProcessHandler startProcess() throws ExecutionException {
    PhoneGapCommandLine line = phoneGapRunConfiguration.getCommandLine();
    String command = phoneGapRunConfiguration.getCommand();
    assert command != null;
    String platform = phoneGapRunConfiguration.getPlatform();
    assert platform != null;
    return line.runCommand(command, platform, phoneGapRunConfiguration.hasTarget() ? phoneGapRunConfiguration.getTarget() : null, phoneGapRunConfiguration.getExtraArgs());
  }
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.