Search in sources :

Example 1 with JpsArtifactRootElement

use of org.jetbrains.jps.model.artifact.elements.JpsArtifactRootElement in project intellij-community by JetBrains.

the class JpsArtifactOutputPackagingElementImpl method getSubstitution.

@Override
public List<JpsPackagingElement> getSubstitution() {
    JpsArtifact artifact = getArtifactReference().resolve();
    if (artifact == null)
        return Collections.emptyList();
    JpsCompositePackagingElement rootElement = artifact.getRootElement();
    if (rootElement instanceof JpsArtifactRootElement) {
        return new ArrayList<>(rootElement.getChildren());
    } else {
        return Collections.<JpsPackagingElement>singletonList(rootElement);
    }
}
Also used : JpsPackagingElement(org.jetbrains.jps.model.artifact.elements.JpsPackagingElement) JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact) ArrayList(java.util.ArrayList) JpsArtifactRootElement(org.jetbrains.jps.model.artifact.elements.JpsArtifactRootElement) JpsCompositePackagingElement(org.jetbrains.jps.model.artifact.elements.JpsCompositePackagingElement)

Aggregations

ArrayList (java.util.ArrayList)1 JpsArtifact (org.jetbrains.jps.model.artifact.JpsArtifact)1 JpsArtifactRootElement (org.jetbrains.jps.model.artifact.elements.JpsArtifactRootElement)1 JpsCompositePackagingElement (org.jetbrains.jps.model.artifact.elements.JpsCompositePackagingElement)1 JpsPackagingElement (org.jetbrains.jps.model.artifact.elements.JpsPackagingElement)1