mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
OpenShift integration - deploy EAR artifacts
This commit is contained in:
+4
@@ -19,6 +19,7 @@ import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.artifacts.ArtifactPointer;
|
||||
import com.intellij.packaging.artifacts.ArtifactType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -38,4 +39,7 @@ public abstract class JavaDeploymentSourceUtil {
|
||||
@NotNull
|
||||
public abstract List<DeploymentSource> createArtifactDeploymentSources(@NotNull Project project,
|
||||
@NotNull Collection<? extends Artifact> artifacts);
|
||||
|
||||
@NotNull
|
||||
public abstract List<DeploymentSource> createArtifactDeploymentSources(Project project, ArtifactType... artifactTypes);
|
||||
}
|
||||
|
||||
+18
-6
@@ -16,17 +16,14 @@
|
||||
package com.intellij.remoteServer.impl.configuration.deployment;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.artifacts.ArtifactPointer;
|
||||
import com.intellij.packaging.artifacts.ArtifactPointerManager;
|
||||
import com.intellij.packaging.artifacts.*;
|
||||
import com.intellij.remoteServer.configuration.deployment.ArtifactDeploymentSource;
|
||||
import com.intellij.remoteServer.configuration.deployment.DeploymentSource;
|
||||
import com.intellij.remoteServer.configuration.deployment.JavaDeploymentSourceUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
@@ -49,4 +46,19 @@ public class JavaDeploymentSourceUtilImpl extends JavaDeploymentSourceUtil {
|
||||
}
|
||||
return sources;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<DeploymentSource> createArtifactDeploymentSources(Project project, ArtifactType... artifactTypes) {
|
||||
if (project.isDefault()) return Collections.emptyList();
|
||||
Artifact[] artifacts = ArtifactManager.getInstance(project).getArtifacts();
|
||||
List<Artifact> supportedArtifacts = new ArrayList<Artifact>();
|
||||
Set<ArtifactType> typeSet = ContainerUtil.set(artifactTypes);
|
||||
for (Artifact artifact : artifacts) {
|
||||
if (typeSet.contains(artifact.getArtifactType())) {
|
||||
supportedArtifacts.add(artifact);
|
||||
}
|
||||
}
|
||||
return createArtifactDeploymentSources(project, supportedArtifacts);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user