Package org.eclipse.dltk.launching

Examples of org.eclipse.dltk.launching.IInterpreterInstallType


    checkTestSetupInvariants();
  }
 
  protected static void createFakeDeeInstall(String installTypeId, String installName, Path installExePath,
      boolean setAsDefault) {
    IInterpreterInstallType deeDmdInstallType = ScriptRuntime.getInterpreterInstallType(installTypeId);
    InterpreterStandin install = new InterpreterStandin(deeDmdInstallType, installName + ".id");
   
    assertTrue(installExePath.toFile().exists());
   
    install.setInstallLocation(new LazyFileHandle(LocalEnvironment.ENVIRONMENT_ID,
View Full Code Here


          Services.getMessage("nature.alias.not.found", alias));
    }

    String interpreterPath = commandLine.getValue(Options.PATH_OPTION);

    IInterpreterInstallType type = getInterpreterInstallType(nature, commandLine);
    if (type == null){
      throw new RuntimeException(
          Services.getMessage("interpreter.type.not.found"));
    }

    IEnvironment env = EnvironmentManager.getLocalEnvironment();
    IFileHandle file = PlatformFileUtils
      .findAbsoluteOrEclipseRelativeFile(env, new Path(interpreterPath));
    if (!file.exists()){
      throw new RuntimeException(
          Services.getMessage("interpreter.path.not.found", interpreterPath));
    }

    EnvironmentVariableContentProvider envVarsProvider =
      new EnvironmentVariableContentProvider();
    EnvironmentVariable[] envVars = envVarsProvider.getVariables();
    LibraryLocation[] libs = type.getDefaultLibraryLocations(
        file, envVars, new NullProgressMonitor());

    IStatus status = type.validateInstallLocation(
        file, envVars, libs, new NullProgressMonitor());
    if (!status.isOK()){
      throw new RuntimeException(status.getMessage());
    }

    IInterpreterInstall deflt =
      ScriptRuntime.getDefaultInterpreterInstall(
          new ScriptRuntime.DefaultInterpreterEntry(nature, env.getId()));
    if (deflt != null && deflt.getInstallLocation().equals(file)){
      throw new RuntimeException(
          Services.getMessage("interpreter.already.exists", interpreterPath));
    }

    ArrayList<IInterpreterInstall> interpreters =
      new ArrayList<IInterpreterInstall>();
    IInterpreterInstallType[] types =
      ScriptRuntime.getInterpreterInstallTypes(nature);

    for (IInterpreterInstallType iit : types){
      IInterpreterInstall[] installs = iit.getInterpreterInstalls();
      for (IInterpreterInstall install : installs){
        if (install.getInstallLocation().equals(file)){
          throw new RuntimeException(
              Services.getMessage("interpreter.already.exists", interpreterPath));
        }
        interpreters.add(install);
      }
    }

    String name = commandLine.getValue(Options.NAME_OPTION);
    if (name == null){
      name = generateInterpreterName(file, nature);
    }

    String id = null;
    do {
      id = String.valueOf(System.currentTimeMillis());
    } while (type.findInterpreterInstall(id) != null);

    IInterpreterInstall install = new InterpreterStandin(type, id);
    install.setInstallLocation(
        new LazyFileHandle(env.getId(), new Path(interpreterPath)));
    install.setName(name);
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.launching.IInterpreterInstallType

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.