Package org.eclim.installer.step.command

Examples of org.eclim.installer.step.command.Command


                parts[0].replace(".feature.group", ""), parts[1]);
            }
          }
        };
        if (sites.size() > 0){
          Command command = new ListCommand(
            handler, sites.toArray(new String[sites.size()]));
          try{
            command.start();
            command.join();
            if(command.getReturnCode() != 0){
              throw new RuntimeException(
                  "error: " + command.getErrorMessage() +
                  " out: " + command.getResult());
            }
          }finally{
            command.destroy();
          }
        }
        return availableFeatures;
      }
    });
View Full Code Here


                }

                taskProgress.setValue(0);
                taskProgress.setIndeterminate(true);

                Command command = new InstallCommand(
                    EclipsePluginsStep.this,
                    dependency.getSite(),
                    dependency.getId());
                try{
                  command.start();
                  command.join();
                  if(command.getReturnCode() != 0){
                    if (command.isShutdown()){
                      return Boolean.TRUE;
                    }
                    throw new RuntimeException(
                        "error: " + command.getErrorMessage() +
                        " out: " + command.getResult());
                  }
                }finally{
                  command.destroy();
                }

                ii.remove();
                tableModel.removeRow(removeIndex);
              }else{
View Full Code Here

  {
    File updateDir = Installer.tempDir("update");
    Extractor.extractResource("/files/installer-update-site.zip", updateDir);

    String url = "file://" + updateDir;
    Command command = new InstallCommand(
        null, url, "org.eclim.installer", "org.eclipse.equinox.p2.director");

    try{
      command.start();
      command.join();
      if(command.getReturnCode() != 0){
        if (command.isShutdown()){
          return false;
        }
        RuntimeException re = new RuntimeException(
            "error: " + command.getErrorMessage() +
            " out: " + command.getResult());

        logger.warn(
            "Error installing eclim installer feature, " +
            "attempting uninstall/reinstall.");

        // attempt to uninstall the feature
        Command uninstall = new UninstallCommand(
            null, url, "org.eclim.installer", "org.eclipse.equinox.p2.director");
        uninstall.start();
        uninstall.join();

        // now try to install again
        command = new InstallCommand(
            null, url, "org.eclim.installer", "org.eclipse.equinox.p2.director");
        command.start();
View Full Code Here

    throws Exception
  {
    final Map<String,Feature> installedFeatures = new HashMap<String,Feature>();

    // run eclipse to get a list of existing installed features
    Command command = new InfoCommand(new OutputHandler(){
      public void process(String line){
        logger.info(line);
        if(line.startsWith(FEATURE)){
          String[] attrs = StringUtils.split(line.substring(FEATURE.length()));
          File site = null;
          try{
            site = new File(new URL(attrs[2]).getFile());
          }catch(Exception e){
            logger.error("Failed to parse feature: " + line, e);
          }
          installedFeatures.put(attrs[0], new Feature(attrs[1], site));
        }else if(line.startsWith(CONFIGURATION)){
          String config = line.substring(CONFIGURATION.length());
          if (config.startsWith("file:")){
            config = config.substring(5);
          }
          if(Os.isFamily(Os.FAMILY_WINDOWS) && config.startsWith("/")){
            config = config.substring(1);
          }
          String local = new File(config).getParent();
          logger.info("eclipse.local=" + local);
          Installer.getContext().setValue("eclipse.local", local);
        }else if(line.startsWith(PROFILE)){
          String profile = line.substring(PROFILE.length());
          logger.info("eclipse.profile=" + profile);
          Installer.getContext().setValue("eclipse.profile", profile);
        }
      }
    });
    try{
      command.start();
      command.join();
      if(command.getReturnCode() != 0){
        if (command.isShutdown()){
          return null;
        }
        throw new RuntimeException(
            "error: " + command.getErrorMessage() +
            " out: " + command.getResult());
      }
    }finally{
      command.destroy();
    }

    return new EclipseInfo(
        (String)Installer.getContext().getValue("eclipse.profile"),
        (String)Installer.getContext().getValue("eclipse.local"),
View Full Code Here

  {
    if (iu == null || repository == null){
      throw new BuildException("Attributes 'iu' and 'repository' must be set.");
    }

    Command command = null;
    try{
      log("Installing " + iu + "...");

      command = new InstallCommand(
          null, repository, iu, "org.eclipse.equinox.p2.director");
      command.start();
      command.join();
      if(command.getReturnCode() != 0){
        throw new BuildException(
            "error: " + command.getErrorMessage() +
            " out: " + command.getResult());
      }
    }catch(BuildException e){
      throw e;
    }catch(Exception e){
      throw new BuildException(e);
    }finally{
      if (command != null){
        command.destroy();
      }
    }
  }
View Full Code Here

        this, repository, iu, "org.eclipse.equinox.p2.director"),
        "uninstalling " + iu);

    // http://wiki.eclipse.org/Equinox/p2/FAQ
    // run p2 gc to fully remove feature artifacts
    runCommand(new Command(
        this,
        new String[]{"-profile", info.getProfileName()},
        "org.eclipse.equinox.p2.garbagecollector.application"),
        "invoking p2 gc");
View Full Code Here

TOP

Related Classes of org.eclim.installer.step.command.Command

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.