Search in sources :

Example 36 with ProjectDescription

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

the class SimpleProjectDescriptionImpl method getVendorId.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public String getVendorId() {
    String _xifexpression = null;
    String _declaredVendorId = this.getDeclaredVendorId();
    boolean _tripleNotEquals = (_declaredVendorId != null);
    if (_tripleNotEquals) {
        _xifexpression = this.getDeclaredVendorId();
    } else {
        EObject _eContainer = this.eContainer();
        EObject _eContainer_1 = null;
        if (_eContainer != null) {
            _eContainer_1 = _eContainer.eContainer();
        }
        EObject _eContainer_2 = null;
        if (_eContainer_1 != null) {
            _eContainer_2 = _eContainer_1.eContainer();
        }
        String _declaredVendorId_1 = null;
        if (((ProjectDescription) _eContainer_2) != null) {
            _declaredVendorId_1 = ((ProjectDescription) _eContainer_2).getDeclaredVendorId();
        }
        _xifexpression = _declaredVendorId_1;
    }
    return _xifexpression;
}
Also used : EObject(org.eclipse.emf.ecore.EObject) SimpleProjectDescription(org.eclipse.n4js.n4mf.SimpleProjectDescription) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription)

Example 37 with ProjectDescription

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

the class ManifestMerger method mergeContent.

/**
 * Merges the content of two {@link ProjectDescription project description} instances that are representing the
 * actual N4JS manifests.
 *
 * @param from
 *            the source resource. These attributes and references will be merged to the other one given with the
 *            {@code to} argument.
 * @param to
 *            the target resource. The project description that has to be updated with the content of the
 *            {@code from} argument.
 * @return the merged project description that has been detached from its resource.
 */
public ProjectDescription mergeContent(final Resource from, final Resource to) {
    try {
        final EObject fromContent = from.getContents().get(0);
        final EObject toContent = to.getContents().get(0);
        if (fromContent instanceof ProjectDescription && toContent instanceof ProjectDescription) {
            return (ProjectDescription) merge(fromContent, toContent);
        }
        return null;
    } finally {
        from.getContents().clear();
        to.getContents().clear();
    }
}
Also used : EObject(org.eclipse.emf.ecore.EObject) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription)

Aggregations

ProjectDescription (org.eclipse.n4js.n4mf.ProjectDescription)37 URI (org.eclipse.emf.common.util.URI)19 SimpleProjectDescription (org.eclipse.n4js.n4mf.SimpleProjectDescription)11 Test (org.junit.Test)9 ImmutableList (com.google.common.collect.ImmutableList)7 File (java.io.File)6 EObject (org.eclipse.emf.ecore.EObject)6 ProjectDependency (org.eclipse.n4js.n4mf.ProjectDependency)6 Resource (org.eclipse.emf.ecore.resource.Resource)5 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)5 SourceFragment (org.eclipse.n4js.n4mf.SourceFragment)5 N4JSExternalProject (org.eclipse.n4js.external.N4JSExternalProject)4 IN4JSProject (org.eclipse.n4js.projectModel.IN4JSProject)4 IOException (java.io.IOException)3 IFile (org.eclipse.core.resources.IFile)3 ExtendedRuntimeEnvironment (org.eclipse.n4js.n4mf.ExtendedRuntimeEnvironment)3 ProjectReference (org.eclipse.n4js.n4mf.ProjectReference)3 XtextResourceSet (org.eclipse.xtext.resource.XtextResourceSet)3 Optional (com.google.common.base.Optional)2 IResource (org.eclipse.core.resources.IResource)2