Search in sources :

Example 6 with ArtifactType

use of com.intellij.packaging.artifacts.ArtifactType in project intellij-community by JetBrains.

the class ArtifactsTestUtil method assertManifest.

public static void assertManifest(Artifact artifact, PackagingElementResolvingContext context, @Nullable String mainClass, @Nullable String classpath) {
    final CompositePackagingElement<?> rootElement = artifact.getRootElement();
    final ArtifactType type = artifact.getArtifactType();
    assertManifest(rootElement, context, type, mainClass, classpath);
}
Also used : ArtifactType(com.intellij.packaging.artifacts.ArtifactType)

Example 7 with ArtifactType

use of com.intellij.packaging.artifacts.ArtifactType in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineStandardSupportProvider method findOrCreateWebArtifact.

@NotNull
static Artifact findOrCreateWebArtifact(AppEngineStandardFacet appEngineStandardFacet) {
    Module module = appEngineStandardFacet.getModule();
    ArtifactType webArtifactType = AppEngineStandardWebIntegration.getInstance().getAppEngineWebArtifactType();
    final Collection<Artifact> artifacts = ArtifactUtil.getArtifactsContainingModuleOutput(module);
    for (Artifact artifact : artifacts) {
        if (webArtifactType.equals(artifact.getArtifactType())) {
            return artifact;
        }
    }
    ArtifactManager artifactManager = ArtifactManager.getInstance(module.getProject());
    PackagingElementFactory elementFactory = PackagingElementFactory.getInstance();
    ArtifactRootElement<?> root = elementFactory.createArtifactRootElement();
    elementFactory.getOrCreateDirectory(root, "WEB-INF/classes").addOrFindChild(elementFactory.createModuleOutput(module));
    return artifactManager.addArtifact(module.getName(), webArtifactType, root);
}
Also used : ArtifactManager(com.intellij.packaging.artifacts.ArtifactManager) ArtifactType(com.intellij.packaging.artifacts.ArtifactType) PackagingElementFactory(com.intellij.packaging.elements.PackagingElementFactory) Module(com.intellij.openapi.module.Module) Artifact(com.intellij.packaging.artifacts.Artifact) NotNull(org.jetbrains.annotations.NotNull)

Example 8 with ArtifactType

use of com.intellij.packaging.artifacts.ArtifactType in project google-cloud-intellij by GoogleCloudPlatform.

the class ArtifactsTestUtil method assertManifest.

public static void assertManifest(Artifact artifact, PackagingElementResolvingContext context, @Nullable String mainClass, @Nullable String classpath) {
    final CompositePackagingElement<?> rootElement = artifact.getRootElement();
    final ArtifactType type = artifact.getArtifactType();
    assertManifest(rootElement, context, type, mainClass, classpath);
}
Also used : ArtifactType(com.intellij.packaging.artifacts.ArtifactType)

Aggregations

ArtifactType (com.intellij.packaging.artifacts.ArtifactType)8 Artifact (com.intellij.packaging.artifacts.Artifact)4 Module (com.intellij.openapi.module.Module)3 PackagingElementFactory (com.intellij.packaging.elements.PackagingElementFactory)3 NotNull (org.jetbrains.annotations.NotNull)3 ArtifactManager (com.intellij.packaging.artifacts.ArtifactManager)2 PackagingElement (com.intellij.packaging.elements.PackagingElement)2 ArrayList (java.util.ArrayList)2 ComboBox (com.intellij.openapi.ui.ComboBox)1 CompositePackagingElement (com.intellij.packaging.elements.CompositePackagingElement)1 DirectoryPackagingElement (com.intellij.packaging.impl.elements.DirectoryPackagingElement)1 PackagingSourceItem (com.intellij.packaging.ui.PackagingSourceItem)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 LinkedHashSet (java.util.LinkedHashSet)1