Examples of IScriptProject


Examples of org.eclipse.dltk.core.IScriptProject

  }

  @Test
  public void testNamespaceResolver() throws CoreException, IOException {

    IScriptProject scriptProject = ensureScriptProject("namespace-resolver");

    assertNotNull(scriptProject);

    IProjectDescription desc = scriptProject.getProject().getDescription();
    desc.setNatureIds(new String[] { PHPNature.ID });
    scriptProject.getProject().setDescription(desc, null);

    ProjectOptions.setPhpVersion(PHPVersion.PHP5_3, scriptProject.getProject());

    PHPFacets.setFacetedVersion(scriptProject.getProject(), PHPVersion.PHP5_3);
    FacetManager.installFacets(scriptProject.getProject(), PHPVersion.PHP5_3, new NullProgressMonitor());

    scriptProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
    scriptProject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);

    ComposerCoreTestPlugin.waitForIndexer();
    ComposerCoreTestPlugin.waitForAutoBuild();

    IComposerProject project = ComposerPlugin.getDefault().getComposerProject(scriptProject);
   
    IFile composerJson = project.getComposerJson();
    assertNotNull(composerJson);

    assertTrue(scriptProject.getProject().hasNature(PHPNature.ID));
    assertTrue(scriptProject.getProject().hasNature(ComposerNature.NATURE_ID));

    assertEquals("Foo\\Bar", project.getNamespace(new Path("src/Foo/Bar")));
    assertEquals("Foo\\Bar\\Baz", project.getNamespace(new Path("src/Foo/Bar/Baz")));
    assertEquals("Hello\\World", project.getNamespace(new Path("src/HelloWorld")));
    assertEquals("", project.getNamespace(new Path("src/Null/")));
View Full Code Here

Examples of org.eclipse.dltk.core.IScriptProject

    }
    return firstPage.getLocationURI();
  }

  protected IProject getProject() {
    IScriptProject scriptProject = getScriptProject();
    if (scriptProject != null) {
      return scriptProject.getProject();
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.dltk.core.IScriptProject

 
  @SuppressWarnings({ "rawtypes", "unchecked" })
  protected void updateProject(IProgressMonitor monitor) throws CoreException, InterruptedException {

    IProject projectHandle = firstPage.getProjectHandle();
    IScriptProject create = DLTKCore.create(projectHandle);
    super.init(create, null, false);
    currentProjectLocation = getProjectLocationURI();

    if (monitor == null) {
      monitor = new NullProgressMonitor();
View Full Code Here

Examples of org.eclipse.dltk.core.IScriptProject

    }

    if (parentElement instanceof PackagePath) {

      PackagePath pPath = (PackagePath) parentElement;
      IScriptProject scriptProject = pPath.getProject();
      IBuildpathEntry entry = pPath.getEntry();

      try {

        IProjectFragment[] allProjectFragments;
        allProjectFragments = scriptProject.getAllProjectFragments();
        for (IProjectFragment fragment : allProjectFragments) {
          if (fragment instanceof ExternalProjectFragment) {
            ExternalProjectFragment external = (ExternalProjectFragment) fragment;
            if (external.getBuildpathEntry().equals(entry)) {
              return super.getChildren(external);
View Full Code Here

Examples of org.eclipse.dltk.core.IScriptProject

   
    vendorPath = composerProject.getProject().getFullPath().append(composerProject.getVendorDir());
    composerPath = vendorPath.append("composer");

    IProject project = composerProject.getProject();
    IScriptProject scriptProject = composerProject.getScriptProject();
    BuildPathParser parser = new BuildPathParser(composerProject);
    List<String> paths = parser.getPaths();
   
    // project prefs
    IEclipsePreferences prefs = ComposerPlugin.getDefault().getProjectPreferences(project);
    IPath[] inclusions;

    try {
      String encoded = prefs.get(ComposerPreferenceConstants.BUILDPATH_INCLUDES_EXCLUDES, "");
      exclusions = scriptProject.decodeBuildpathEntry(encoded).getExclusionPatterns();
      inclusions = scriptProject.decodeBuildpathEntry(encoded).getInclusionPatterns();
    } catch (Exception e) {
      exclusions = new IPath[]{};
      inclusions = new IPath[]{};
    }
   
    // add includes
    for (IPath inclusion : inclusions) {
      paths.add(inclusion.toString());
    }
   
    // clean up exclusion patterns: remove exact matches
    List<IPath> exs = new ArrayList<IPath>();
    for (IPath exclusion : exclusions) {
      String exc = exclusion.removeTrailingSeparator().toString();
     
      if (paths.contains(exc)) {
        paths.remove(exc);
      } else {
        exs.add(exclusion);
      }
    }
    exclusions = exs.toArray(new IPath[]{});
   
    // clean build path
    IBuildpathEntry[] rawBuildpath = scriptProject.getRawBuildpath();
    for (IBuildpathEntry entry : rawBuildpath) {
      if (entry.getEntryKind() == IBuildpathEntry.BPE_SOURCE) {
        BuildPathUtils.removeEntryFromBuildPath(scriptProject, entry);
      }
    }
View Full Code Here

Examples of org.eclipse.dltk.core.IScriptProject

      RutaModuleDeclaration tmmd = (RutaModuleDeclaration) moduleDeclaration;
      DescriptorManager sm = tmmd.descriptorInfo;
      IPath pathToModule = sourceModule.getResource().getLocation();
      String elementName = RutaProjectUtils.getModuleName(pathToModule);

      IScriptProject proj = sourceModule.getScriptProject();
      // TODO: dont use desc path!
      IPath descPath = RutaProjectUtils.getDescriptorRootPath(proj.getProject());
      IPath scriptPath = RutaProjectUtils.getScriptRootPath(proj.getProject());
      IPath descPackagePath = RutaProjectUtils.getDescriptorPackagePath(sourceModule
              .getResource().getLocation(), proj.getProject());

      String typeSystem = descPackagePath.append(elementName + "TypeSystem.xml").toPortableString();
      String engine = descPackagePath.append(elementName + "Engine.xml").toPortableString();
      String basicTS = descPath.append("BasicTypeSystem.xml").toPortableString();
      String basicE = descPath.append("BasicEngine.xml").toPortableString();

      // TODO: may not work with other script folders
      IPath relativeTo = pathToModule.makeAbsolute().makeRelativeTo(scriptPath);
      List<String> scriptPathList = new ArrayList<String>();
      List<String> descriptorPathList = new ArrayList<String>();

      // add all folders
      try {
        List<IFolder> scriptFolders = RutaProjectUtils.getAllScriptFolders(proj);
        scriptPathList.addAll(RutaProjectUtils.getFolderLocations(scriptFolders));
      } catch (CoreException e) {
        RutaIdePlugin.error(e);
      }

      try {
        List<IFolder> descriptorFolders = RutaProjectUtils.getAllDescriptorFolders(proj
                .getProject());
        descriptorPathList.addAll(RutaProjectUtils.getFolderLocations(descriptorFolders));
      } catch (Exception e) {
        RutaIdePlugin.error(e);
      }
View Full Code Here

Examples of org.eclipse.dltk.core.IScriptProject

  public static List<IFolder> getReferencedScriptFolders(IScriptProject proj, Collection<IProject> visited) throws CoreException {
    List<IFolder> result = new ArrayList<IFolder>();
    IProject[] referencedProjects = proj.getProject().getReferencedProjects();
    for (IProject eachProject : referencedProjects) {
      if(!visited.contains(eachProject)) {
        IScriptProject scriptProject = DLTKCore.create(eachProject);
        result.addAll(RutaProjectUtils.getScriptFolders(scriptProject));
        visited.add(eachProject);
        result.addAll(getReferencedScriptFolders(scriptProject, visited));
      }
    }
View Full Code Here

Examples of org.eclipse.dltk.core.IScriptProject

  public IMarkerResolution[] getResolutions(IMarker marker) {
    if (RutaCorrectionProcessor.isFixable(marker)) {
      String pkgName = CorrectionEngine.getProblemArguments(marker)[0];
      if (pkgName != null) {
        IProject project = marker.getResource().getProject();
        IScriptProject scriptProject = DLTKCore.create(project);
        return new IMarkerResolution[] { new RutaRequirePackageMarkerResolution(pkgName,
                scriptProject) };
      }
    }
    return new IMarkerResolution[0];
View Full Code Here

Examples of org.eclipse.dltk.core.IScriptProject

      }
    }

    private void referenceEngineCall(String name) {
      // name = "";
      IScriptProject scriptProject = sourceModule.getScriptProject();
      IFile engine = getEngine(name, scriptProject);
      if (engine == null) {
        return;
      }
      results.add(engine);
View Full Code Here

Examples of org.eclipse.dltk.core.IScriptProject

  private String mode;

  @Override
  public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
    StringBuilder cmdline = new StringBuilder();
    IScriptProject proj = AbstractScriptLaunchConfigurationDelegate.getScriptProject(configuration);

    String mainScriptAttribute = configuration.getAttribute("mainScript", "");

    String encoding = proj.getProject().getDefaultCharset();
    String view = configuration.getAttribute(RutaLaunchConstants.VIEW, CAS.NAME_DEFAULT_SOFA);
    if (StringUtils.isBlank(view)) {
      view = CAS.NAME_DEFAULT_SOFA;
    }
    boolean recursive = configuration.getAttribute(RutaLaunchConstants.RECURSIVE, false);

    IResource member = proj.getProject().findMember(mainScriptAttribute);
    IPath projectPath = proj.getResource().getLocation();
    IPath inputDirPath = projectPath.append(RutaProjectUtils.getDefaultInputLocation());
    IPath outputDirPath = projectPath.append(RutaProjectUtils.getDefaultOutputLocation());
    String engine = RutaProjectUtils.getEngineDescriptorPath(member.getLocation(),
            proj.getProject()).toPortableString();
    String input = configuration.getAttribute(RutaLaunchConstants.INPUT_FOLDER,
            inputDirPath.toPortableString());
    if (StringUtils.isBlank(input)) {
      input = inputDirPath.toPortableString();
    }
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.