Package org.eclipse.dltk.core.environment

Examples of org.eclipse.dltk.core.environment.IDeployment


  public static void error(Throwable t) {
    error(t.getMessage(), t);
  }

  public IFileHandle getConsoleProxy(IExecutionEnvironment exeEnv) throws IOException {
    IDeployment deployment = exeEnv.createDeployment();
    IPath path = deployment.add(this.getBundle(), "console");
    path.append("ConsoleProxy.ruta");
    return deployment.getFile(path);
  }
View Full Code Here


    return elements;
  }

  private static List deployExecute(IExecutionEnvironment exeEnv, String installLocation,
          String[] arguments, EnvironmentVariable[] env) {
    IDeployment deployment = exeEnv.createDeployment();
    IFileHandle script = deploy(deployment);
    if (script == null) {
      return null;
    }

    IFileHandle workingDir = script.getParent();
    InterpreterConfig config = ScriptLaunchUtil.createInterpreterConfig(exeEnv, script, workingDir,
            env);
    // For wish
    config.removeEnvVar("DISPLAY"); //$NON-NLS-1$

    if (arguments != null) {
      config.addScriptArgs(arguments);
    }

    Process process = null;
    try {
      process = ScriptLaunchUtil.runScriptWithInterpreter(exeEnv, installLocation, config);
    } catch (CoreException e) {
      if (DLTKCore.DEBUG) {
        e.printStackTrace();
      }
    }
    if (process == null) {
      return new ArrayList();
    }
    List output = getScriptOutput(process.getInputStream());
    getScriptOutput(process.getErrorStream());
    process.destroy();
    deployment.dispose();
    return output;
  }
View Full Code Here

    // return autoPath;
  }

  public static RutaPackage[] getSrcs(IExecutionEnvironment exeEnv, IFileHandle installLocation,
          EnvironmentVariable[] environment, String packageName) {
    IDeployment deployment = exeEnv.createDeployment();
    IFileHandle script = deploy(deployment);
    if (script == null) {
      return null;
    }

    IFileHandle workingDir = script.getParent();
    InterpreterConfig config = ScriptLaunchUtil.createInterpreterConfig(exeEnv, script, workingDir,
            environment);
    String names = packageName;
    ByteArrayInputStream bais = new ByteArrayInputStream(names.getBytes());
    IPath packagesPath = null;
    try {
      packagesPath = deployment.add(bais, "packages.txt"); //$NON-NLS-1$
    } catch (IOException e1) {
      if (DLTKCore.DEBUG) {
        e1.printStackTrace();
      }
      return null;
    }
    IFileHandle file = deployment.getFile(packagesPath);
    // For wish
    config.removeEnvVar("DISPLAY"); //$NON-NLS-1$
    String[] arguments = new String[] { "get-srcs", "-fpkgs", //$NON-NLS-1$ //$NON-NLS-2$
        file.toOSString() };

    config.addScriptArgs(arguments);

    Process process = null;
    try {
      process = ScriptLaunchUtil.runScriptWithInterpreter(exeEnv, installLocation.toOSString(),
              config);
    } catch (CoreException e) {
      if (DLTKCore.DEBUG) {
        e.printStackTrace();
      }
    }
    if (process == null) {
      return null;
    }
    List output = getScriptOutput(process.getInputStream());
    getScriptOutput(process.getErrorStream());
    process.destroy();
    deployment.dispose();
    return getPackagePath(output);
  }
View Full Code Here

  public static void error(Throwable t) {
    error(t.getMessage(), t);
  }

  public IFileHandle getConsoleProxy(IExecutionEnvironment exeEnv) throws IOException {
    IDeployment deployment = exeEnv.createDeployment();
    IPath path = deployment.add(this.getBundle(), "console");
    path.append("ConsoleProxy.ruta");
    return deployment.getFile(path);
  }
View Full Code Here

    return elements;
  }

  private static List deployExecute(IExecutionEnvironment exeEnv, String installLocation,
          String[] arguments, EnvironmentVariable[] env) {
    IDeployment deployment = exeEnv.createDeployment();
    IFileHandle script = deploy(deployment);
    if (script == null) {
      return null;
    }

    IFileHandle workingDir = script.getParent();
    InterpreterConfig config = ScriptLaunchUtil.createInterpreterConfig(exeEnv, script, workingDir,
            env);
    // For wish
    config.removeEnvVar("DISPLAY"); //$NON-NLS-1$

    if (arguments != null) {
      config.addScriptArgs(arguments);
    }

    Process process = null;
    try {
      process = ScriptLaunchUtil.runScriptWithInterpreter(exeEnv, installLocation, config);
    } catch (CoreException e) {
      if (DLTKCore.DEBUG) {
        e.printStackTrace();
      }
    }
    if (process == null) {
      return new ArrayList();
    }
    List output = getScriptOutput(process.getInputStream());
    getScriptOutput(process.getErrorStream());
    process.destroy();
    deployment.dispose();
    return output;
  }
View Full Code Here

    // return autoPath;
  }

  public static RutaPackage[] getSrcs(IExecutionEnvironment exeEnv, IFileHandle installLocation,
          EnvironmentVariable[] environment, String packageName) {
    IDeployment deployment = exeEnv.createDeployment();
    IFileHandle script = deploy(deployment);
    if (script == null) {
      return null;
    }

    IFileHandle workingDir = script.getParent();
    InterpreterConfig config = ScriptLaunchUtil.createInterpreterConfig(exeEnv, script, workingDir,
            environment);
    String names = packageName;
    ByteArrayInputStream bais = new ByteArrayInputStream(names.getBytes());
    IPath packagesPath = null;
    try {
      packagesPath = deployment.add(bais, "packages.txt"); //$NON-NLS-1$
    } catch (IOException e1) {
      if (DLTKCore.DEBUG) {
        e1.printStackTrace();
      }
      return null;
    }
    IFileHandle file = deployment.getFile(packagesPath);
    // For wish
    config.removeEnvVar("DISPLAY"); //$NON-NLS-1$
    String[] arguments = new String[] { "get-srcs", "-fpkgs", //$NON-NLS-1$ //$NON-NLS-2$
        file.toOSString() };

    config.addScriptArgs(arguments);

    Process process = null;
    try {
      process = ScriptLaunchUtil.runScriptWithInterpreter(exeEnv, installLocation.toOSString(),
              config);
    } catch (CoreException e) {
      if (DLTKCore.DEBUG) {
        e.printStackTrace();
      }
    }
    if (process == null) {
      return null;
    }
    List output = getScriptOutput(process.getInputStream());
    getScriptOutput(process.getErrorStream());
    process.destroy();
    deployment.dispose();
    return getPackagePath(output);
  }
View Full Code Here

  public static void error(Throwable t) {
    error(t.getMessage(), t);
  }

  public IFileHandle getConsoleProxy(IExecutionEnvironment exeEnv) throws IOException {
    IDeployment deployment = exeEnv.createDeployment();
    IPath path = deployment.add(this.getBundle(), "console");
    path.append("ConsoleProxy.ruta");
    return deployment.getFile(path);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.environment.IDeployment

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.