Search in sources :

Example 1 with ProjectDependency

use of org.eclipse.n4js.n4mf.ProjectDependency in project n4js by eclipse.

the class N4JSEclipseModel method doGetLibraries.

protected ImmutableList<? extends IN4JSEclipseArchive> doGetLibraries(N4JSEclipseProject project, URI location) {
    ImmutableList.Builder<IN4JSEclipseArchive> result = ImmutableList.builder();
    ProjectDescription description = getProjectDescription(location);
    if (description != null) {
        List<ProjectDependency> dependencies = description.getAllProjectDependencies();
        for (ProjectDependency dependency : dependencies) {
            URI dependencyLocation = getInternalWorkspace().getLocation(location, dependency, N4JSSourceContainerType.ARCHIVE);
            if (dependencyLocation != null) {
                IFile archive = workspace.getFile(new Path(dependencyLocation.toPlatformString(true)));
                result.add(getN4JSArchive(project, archive));
            }
        }
    }
    return result.build();
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IN4JSEclipseArchive(org.eclipse.n4js.ui.projectModel.IN4JSEclipseArchive) IFile(org.eclipse.core.resources.IFile) ImmutableList(com.google.common.collect.ImmutableList) ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) URI(org.eclipse.emf.common.util.URI)

Example 2 with ProjectDependency

use of org.eclipse.n4js.n4mf.ProjectDependency in project n4js by eclipse.

the class AbstractInternalWorkspaceTest method testGetLocation_04.

@SuppressWarnings("javadoc")
@Test
public void testGetLocation_04() {
    ProjectDescription description = getWorkspace().getProjectDescription(myProjectURI);
    ProjectDependency dependencyOnArchive = description.getAllProjectDependencies().get(0);
    URI expectedToBeNull = getWorkspace().getLocation(myProjectURI, dependencyOnArchive, N4JSSourceContainerType.ARCHIVE);
    assertNull(expectedToBeNull);
}
Also used : ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) URI(org.eclipse.emf.common.util.URI) Test(org.junit.Test)

Example 3 with ProjectDependency

use of org.eclipse.n4js.n4mf.ProjectDependency in project n4js by eclipse.

the class AbstractInternalWorkspaceTest method testGetLocation_01.

@SuppressWarnings("javadoc")
@Test
public void testGetLocation_01() {
    ProjectDescription description = getWorkspace().getProjectDescription(myProjectURI);
    ProjectDependency dependency = description.getAllProjectDependencies().get(0);
    URI resolvedLocation = getWorkspace().getLocation(myProjectURI, dependency, N4JSSourceContainerType.PROJECT);
    assertEquals(libProjectURI, resolvedLocation);
}
Also used : ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) URI(org.eclipse.emf.common.util.URI) Test(org.junit.Test)

Example 4 with ProjectDependency

use of org.eclipse.n4js.n4mf.ProjectDependency in project n4js by eclipse.

the class AbstractInternalWorkspaceTest method testGetLocation_02.

@SuppressWarnings("javadoc")
@Test
public void testGetLocation_02() {
    ProjectDescription description = getWorkspace().getProjectDescription(myProjectURI);
    ProjectDependency dependencyOnArchive = description.getAllProjectDependencies().get(1);
    URI resolvedArchiveLocation = getWorkspace().getLocation(myProjectURI, dependencyOnArchive, N4JSSourceContainerType.ARCHIVE);
    assertEquals(archiveFileURI, resolvedArchiveLocation);
}
Also used : ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) URI(org.eclipse.emf.common.util.URI) Test(org.junit.Test)

Example 5 with ProjectDependency

use of org.eclipse.n4js.n4mf.ProjectDependency in project n4js by eclipse.

the class AbstractInternalWorkspaceTest method testGetLocation_03.

@SuppressWarnings("javadoc")
@Test
public void testGetLocation_03() {
    ProjectDescription description = getWorkspace().getProjectDescription(myProjectURI);
    ProjectDependency dependencyOnArchive = description.getAllProjectDependencies().get(1);
    URI expectedToBeNull = getWorkspace().getLocation(myProjectURI, dependencyOnArchive, N4JSSourceContainerType.PROJECT);
    assertNull(expectedToBeNull);
}
Also used : ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) URI(org.eclipse.emf.common.util.URI) Test(org.junit.Test)

Aggregations

ProjectDependency (org.eclipse.n4js.n4mf.ProjectDependency)7 ProjectDescription (org.eclipse.n4js.n4mf.ProjectDescription)6 URI (org.eclipse.emf.common.util.URI)5 Test (org.junit.Test)4 ProjectDependencies (org.eclipse.n4js.n4mf.ProjectDependencies)2 ImmutableList (com.google.common.collect.ImmutableList)1 IFile (org.eclipse.core.resources.IFile)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 EPackage (org.eclipse.emf.ecore.EPackage)1 BootstrapModule (org.eclipse.n4js.n4mf.BootstrapModule)1 DeclaredVersion (org.eclipse.n4js.n4mf.DeclaredVersion)1 ExecModule (org.eclipse.n4js.n4mf.ExecModule)1 ExtendedRuntimeEnvironment (org.eclipse.n4js.n4mf.ExtendedRuntimeEnvironment)1 ImplementedProjects (org.eclipse.n4js.n4mf.ImplementedProjects)1 InitModules (org.eclipse.n4js.n4mf.InitModules)1 ModuleFilter (org.eclipse.n4js.n4mf.ModuleFilter)1 ModuleFilterSpecifier (org.eclipse.n4js.n4mf.ModuleFilterSpecifier)1 ProjectReference (org.eclipse.n4js.n4mf.ProjectReference)1 ProvidedRuntimeLibraries (org.eclipse.n4js.n4mf.ProvidedRuntimeLibraries)1