Examples of AbsolutePath


Examples of org.sugarj.common.path.AbsolutePath

        }
     
      String classPath = thisClassURL.getPath();
      String binPath = classPath.substring(0, classPath.length() - thisClassPath.length());
     
      libDir = new AbsolutePath(binPath);
    }
   
    return libDir;
  }
View Full Code Here

Examples of org.sugarj.common.path.AbsolutePath

    List<Path> generatedFiles = new LinkedList<Path>();
    for (Path outFile : outFiles) {
      cmds.add(outFile.getAbsolutePath());
     
      String noExtPath = FileCommands.dropExtension(outFile.getAbsolutePath());
      if (FileCommands.fileExists(new AbsolutePath(noExtPath)))
        generatedFiles.add(new AbsolutePath(noExtPath));
      if (FileCommands.fileExists(new AbsolutePath(noExtPath + ".exe")))
        generatedFiles.add(new AbsolutePath(noExtPath + ".exe"));
      if (FileCommands.fileExists(new AbsolutePath(noExtPath + ".hi")))
        generatedFiles.add(new AbsolutePath(noExtPath + ".hi"));
      if (FileCommands.fileExists(new AbsolutePath(noExtPath + ".o")))
        generatedFiles.add(new AbsolutePath(noExtPath + ".o"));
    }
   
    if (!includePaths.isEmpty()) {
      StringBuilder searchPath = new StringBuilder("-i");
      for (Path path : includePaths)
View Full Code Here

Examples of org.sugarj.common.path.AbsolutePath

 
  protected void clean(IProgressMonitor monitor) throws CoreException {
    File f = getProject().getLocation().append(JavaCore.create(getProject()).getOutputLocation().makeRelativeTo(getProject().getFullPath())).toFile();
    Environment environment = SugarJParseController.makeProjectEnvironment(getProject());
    try {
      FileCommands.delete(new AbsolutePath(f.getPath()));
      FileCommands.delete(environment.getParseBin());
      FileCommands.delete(environment.getCacheDir());
    } catch (IOException e) {
    }
   
View Full Code Here

Examples of org.sugarj.common.path.AbsolutePath

      getProject().accept(new IResourceVisitor() {
        Environment environment = SugarJParseController.makeProjectEnvironment(getProject());
       
        @Override
        public boolean visit(IResource resource) throws CoreException {
          Path root = new AbsolutePath(getProject().getLocation().makeAbsolute().toString());
          IPath relPath = resource.getFullPath().makeRelativeTo(getProject().getFullPath());
          if (!relPath.isEmpty() &&
              (environment.getParseBin().equals(new RelativePath(root, relPath.toString())) ||
               environment.getIncludePath().contains(new RelativePath(root, relPath.toString()))))
            return false;
View Full Code Here

Examples of org.sugarj.common.path.AbsolutePath

 
  // without running eclipse platform,
  // set up a default environment reasonable for command-line execution.
  private static Environment getConsoleEnvironment() {
    Environment environment = new Environment(true, StdLib.stdLibDir);
    environment.setCacheDir(new RelativePath(new AbsolutePath(FileCommands.TMP_DIR), ".sugarjcache"));
    environment.addToSourcePath(new AbsolutePath("."));
    environment.setAtomicImportParsing(true);
    environment.setNoChecking(true);
   
    for (String cp : System.getProperty("java.class.path").split(System.getProperty("path.separator"))) {
      if (cp.length() > 0)
        environment.addToIncludePath(new AbsolutePath(cp));
    }
    return environment;
  }
View Full Code Here

Examples of org.sugarj.common.path.AbsolutePath

      if (path.startsWith(File.separator) || path.startsWith("/"))
        path = "." + path;
      else
        path = "./" + path;
    }
    return new AbsolutePath(path);
  }
View Full Code Here

Examples of org.sugarj.common.path.AbsolutePath

    Result r = new Result() {
      public boolean isUpToDate(int h, Environment env) { return false; }
    };
    r.setSugaredSyntaxTree(term);
    r.setDesugaredSyntaxTree(term);
    r.registerEditorDesugarings(new AbsolutePath(StdLib.failureTrans.getAbsolutePath()));
    return r;
  }
View Full Code Here

Examples of org.sugarj.common.path.AbsolutePath

      int colStart = s.indexOf("^", colMarkerStart);
      int colEnd = s.lastIndexOf("^", colMarkerEnd);
      int msgStart = colMarkerEnd + 1;
      int msgEnd = s.indexOf("\n", msgStart);
      String msg = s.substring(msgStart, msgEnd);
      errors.add(Pair.create(new SourceLocation(new AbsolutePath(file), line, line, colStart, colEnd), msg));
      index = msgEnd + 1;
    }
    return errors;
  }
View Full Code Here

Examples of org.sugarj.common.path.AbsolutePath

 
  private static Environment makeProjectEnvironment(IJavaProject project) throws JavaModelException {
    Environment env = new Environment(false, StdLib.stdLibDir);
   
    IPath fullPath = project.getProject().getFullPath();
    Path root = new AbsolutePath(project.getProject().getLocation().makeAbsolute().toString());
    Path bin = new RelativePath(root, project.getOutputLocation().makeRelativeTo(fullPath).toString());
    env.setRoot(root);
    env.setBin(bin);
   
    for (IPackageFragmentRoot fragment : project.getAllPackageFragmentRoots()) {
      IPath path = fragment.getPath();
      boolean externalPath = fragment.getResource() == null;
      String p = externalPath ? path.toString() : path.makeRelativeTo(fullPath).toString();

      Path includePath;
      if (fullPath.isPrefixOf(path))
        includePath = p.isEmpty() ? root : new RelativePath(root, p);
      else if (externalPath)
        includePath = new AbsolutePath(p);
      else
        includePath = new RelativePath(root, p);
     
      if (fragment.getKind() == IPackageFragmentRoot.K_SOURCE && fragment.getParent().equals(project))
        env.addToSourcePath(includePath);
View Full Code Here

Examples of org.sugarj.common.path.AbsolutePath

    if (environment.getCacheDir() == null)
      environment.setCacheDir(new RelativePath(environment.getRoot(), ".sugarjcache"));

    environment.setAtomicImportParsing(true);
    environment.setNoChecking(true);
    environment.addToIncludePath(new AbsolutePath(new StrategoJarAntPropertyProvider().getAntPropertyValue("")));
  }
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.