use of org.eclipse.n4js.n4mf.ProvidedRuntimeLibraryDependency in project n4js by eclipse.
the class N4JSModel method getProvidedRuntimeLibraries.
public ImmutableList<? extends IN4JSSourceContainerAware> getProvidedRuntimeLibraries(N4JSProject project) {
ImmutableList.Builder<IN4JSSourceContainerAware> providedRuntimes = ImmutableList.builder();
EList<ProvidedRuntimeLibraryDependency> runtimeLibraries = getAllProvidedRuntimeLibraries(project);
URI projectLocation = project.getLocation();
// GHOLD-249: If the project n4mf file has parse errors, we need a lot of null checks.
for (ProvidedRuntimeLibraryDependency runtimeLibrary : runtimeLibraries) {
if (null != runtimeLibrary.getProject()) {
URI location = workspace.getLocation(projectLocation, runtimeLibrary, PROJECT);
if (null == location) {
location = externalLibraryWorkspace.getLocation(projectLocation, runtimeLibrary, PROJECT);
}
if (null != location) {
providedRuntimes.add(getN4JSProject(location));
} else {
// Assuming archive (NFAR)
location = workspace.getLocation(projectLocation, runtimeLibrary, ARCHIVE);
if (null != location) {
providedRuntimes.add(getN4JSArchive(project, location));
}
}
}
}
return providedRuntimes.build();
}
use of org.eclipse.n4js.n4mf.ProvidedRuntimeLibraryDependency in project n4js by eclipse.
the class N4JSModel method getAllProvidedRuntimeLibraries.
private EList<ProvidedRuntimeLibraryDependency> getAllProvidedRuntimeLibraries(N4JSProject project) {
URI projectLocation = project.getLocation();
if (projectLocation == null)
return ECollections.emptyEList();
ProjectDescription description = getProjectDescription(projectLocation);
if (description == null)
return ECollections.emptyEList();
EList<ProvidedRuntimeLibraryDependency> runtimeLibraries = description.getAllProvidedRuntimeLibraries();
if (runtimeLibraries == null)
return ECollections.emptyEList();
return runtimeLibraries;
}
use of org.eclipse.n4js.n4mf.ProvidedRuntimeLibraryDependency in project n4js by eclipse.
the class N4MFSemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == N4mfPackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case N4mfPackage.BOOTSTRAP_MODULE:
sequence_BootstrapModule(context, (BootstrapModule) semanticObject);
return;
case N4mfPackage.DECLARED_VERSION:
sequence_DeclaredVersion(context, (DeclaredVersion) semanticObject);
return;
case N4mfPackage.EXEC_MODULE:
sequence_ExecModule(context, (ExecModule) semanticObject);
return;
case N4mfPackage.EXTENDED_RUNTIME_ENVIRONMENT:
sequence_ExtendedRuntimeEnvironment(context, (ExtendedRuntimeEnvironment) semanticObject);
return;
case N4mfPackage.IMPLEMENTED_PROJECTS:
sequence_ImplementedProjects(context, (ImplementedProjects) semanticObject);
return;
case N4mfPackage.INIT_MODULES:
sequence_InitModules(context, (InitModules) semanticObject);
return;
case N4mfPackage.MODULE_FILTER:
sequence_ModuleFilter(context, (ModuleFilter) semanticObject);
return;
case N4mfPackage.MODULE_FILTER_SPECIFIER:
sequence_ModuleFilterSpecifier(context, (ModuleFilterSpecifier) semanticObject);
return;
case N4mfPackage.PROJECT_DEPENDENCIES:
sequence_ProjectDependencies(context, (ProjectDependencies) semanticObject);
return;
case N4mfPackage.PROJECT_DEPENDENCY:
sequence_ProjectDependency(context, (ProjectDependency) semanticObject);
return;
case N4mfPackage.PROJECT_DESCRIPTION:
sequence_ProjectDescription(context, (ProjectDescription) semanticObject);
return;
case N4mfPackage.PROJECT_REFERENCE:
sequence_ProjectReference(context, (ProjectReference) semanticObject);
return;
case N4mfPackage.PROVIDED_RUNTIME_LIBRARIES:
sequence_ProvidedRuntimeLibraries(context, (ProvidedRuntimeLibraries) semanticObject);
return;
case N4mfPackage.PROVIDED_RUNTIME_LIBRARY_DEPENDENCY:
sequence_ProvidedRuntimeLibraryDependency(context, (ProvidedRuntimeLibraryDependency) semanticObject);
return;
case N4mfPackage.REQUIRED_RUNTIME_LIBRARIES:
sequence_RequiredRuntimeLibraries(context, (RequiredRuntimeLibraries) semanticObject);
return;
case N4mfPackage.REQUIRED_RUNTIME_LIBRARY_DEPENDENCY:
sequence_RequiredRuntimeLibraryDependency(context, (RequiredRuntimeLibraryDependency) semanticObject);
return;
case N4mfPackage.SIMPLE_PROJECT_DESCRIPTION:
sequence_SimpleProjectDescription(context, (SimpleProjectDescription) semanticObject);
return;
case N4mfPackage.SOURCE_FRAGMENT:
sequence_SourceFragment(context, (SourceFragment) semanticObject);
return;
case N4mfPackage.TESTED_PROJECT:
sequence_TestedProject(context, (TestedProject) semanticObject);
return;
case N4mfPackage.TESTED_PROJECTS:
sequence_TestedProjects(context, (TestedProjects) semanticObject);
return;
case N4mfPackage.VERSION_CONSTRAINT:
sequence_VersionConstraint(context, (VersionConstraint) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.eclipse.n4js.n4mf.ProvidedRuntimeLibraryDependency in project n4js by eclipse.
the class ProjectDescriptionImpl method getAllProvidedRuntimeLibraries.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ProvidedRuntimeLibraryDependency> getAllProvidedRuntimeLibraries() {
EList<ProvidedRuntimeLibraryDependency> _xifexpression = null;
ProvidedRuntimeLibraries _providedRuntimeLibraries = this.getProvidedRuntimeLibraries();
boolean _tripleEquals = (null == _providedRuntimeLibraries);
if (_tripleEquals) {
_xifexpression = XcoreCollectionLiterals.<ProvidedRuntimeLibraryDependency>emptyEList();
} else {
_xifexpression = this.getProvidedRuntimeLibraries().getProvidedRuntimeLibraries();
}
return _xifexpression;
}
Aggregations