use of org.eclipse.n4js.ui.projectModel.IN4JSEclipseArchive in project n4js by eclipse.
the class NfarStorageMapper method collectNfarURIs.
public void collectNfarURIs(IFile nfarArchive, Set<URI> target) {
URI archiveURI = URI.createPlatformResourceURI(nfarArchive.getFullPath().toString(), true);
Set<URI> entries = knownEntries.get(archiveURI);
if (entries != null) {
target.addAll(entries);
} else if (nfarArchive.exists()) {
Optional<? extends IN4JSEclipseProject> projectOpt = eclipseCore.create(nfarArchive.getProject());
if (projectOpt.isPresent()) {
IN4JSEclipseProject n4jsProject = projectOpt.get();
if (n4jsProject.exists()) {
updateCache(n4jsProject);
}
entries = knownEntries.get(archiveURI);
if (entries != null) {
target.addAll(entries);
} else {
// project exists but archive is not on the project path - we have to scan it nevertheless
Optional<? extends IN4JSEclipseArchive> archive = eclipseCore.findArchive(archiveURI);
if (archive.isPresent()) {
traverseArchive(archive.get(), target);
}
}
}
}
}
use of org.eclipse.n4js.ui.projectModel.IN4JSEclipseArchive 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();
}
Aggregations