diff options
Diffstat (limited to 'plugins/maven/maven-server-api/src/org/jetbrains/idea/maven')
4 files changed, 90 insertions, 9 deletions
diff --git a/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/model/MavenExplicitProfiles.java b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/model/MavenExplicitProfiles.java new file mode 100644 index 000000000000..ed9886a7e352 --- /dev/null +++ b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/model/MavenExplicitProfiles.java @@ -0,0 +1,77 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.idea.maven.model; + +import gnu.trove.THashSet; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Collections; + +/** + * Created with IntelliJ IDEA. + * User: vladimir.dubovik + * Date: 4/9/2014 + * Time: 2:30 AM + */ +public class MavenExplicitProfiles implements Serializable { + public static final MavenExplicitProfiles NONE = new MavenExplicitProfiles(Collections.<String>emptySet()); + + private Collection<String> myEnabledProfiles; + private Collection<String> myDisabledProfiles; + + public MavenExplicitProfiles(Collection<String> enabledProfiles, Collection<String> disabledProfiles) { + myEnabledProfiles = enabledProfiles; + myDisabledProfiles = disabledProfiles; + } + + public MavenExplicitProfiles(Collection<String> enabledProfiles) { + this(enabledProfiles, Collections.<String>emptySet()); + } + + public Collection<String> getEnabledProfiles() { + return myEnabledProfiles; + } + + public Collection<String> getDisabledProfiles() { + return myDisabledProfiles; + } + + @Override + public MavenExplicitProfiles clone() { + return new MavenExplicitProfiles(new THashSet<String>(myEnabledProfiles), new THashSet<String>(myDisabledProfiles)); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MavenExplicitProfiles that = (MavenExplicitProfiles)o; + + if (!myEnabledProfiles.equals(that.myEnabledProfiles)) return false; + if (!myDisabledProfiles.equals(that.myDisabledProfiles)) return false; + + return true; + } + + @Override + public int hashCode() { + int result = myEnabledProfiles.hashCode(); + result = 31 * result + myDisabledProfiles.hashCode(); + return result; + } +} diff --git a/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServer.java b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServer.java index 7c945e8e0c39..827fc2816f5a 100644 --- a/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServer.java +++ b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServer.java @@ -15,6 +15,7 @@ */ package org.jetbrains.idea.maven.server; +import org.jetbrains.idea.maven.model.MavenExplicitProfiles; import org.jetbrains.idea.maven.model.MavenModel; import java.io.File; @@ -35,6 +36,6 @@ public interface MavenServer extends Remote { ProfileApplicationResult applyProfiles(MavenModel model, File basedir, - Collection<String> explicitProfiles, + MavenExplicitProfiles explicitProfiles, Collection<String> alwaysOnProfiles) throws RemoteException; } diff --git a/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServerEmbedder.java b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServerEmbedder.java index 0c4be99814c1..6b3db15e7035 100644 --- a/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServerEmbedder.java +++ b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServerEmbedder.java @@ -34,12 +34,15 @@ public interface MavenServerEmbedder extends Remote { @NotNull MavenServerExecutionResult resolveProject(@NotNull File file, - @NotNull Collection<String> activeProfiles) throws RemoteException, - MavenServerProcessCanceledException; + @NotNull Collection<String> activeProfiles, + @NotNull Collection<String> inactiveProfiles) throws RemoteException, + MavenServerProcessCanceledException; @Nullable - String evaluateEffectivePom(@NotNull File file, @NotNull List<String> activeProfiles) throws RemoteException, - MavenServerProcessCanceledException; + String evaluateEffectivePom(@NotNull File file, + @NotNull List<String> activeProfiles, + @NotNull List<String> inactiveProfiles) throws RemoteException, + MavenServerProcessCanceledException; @NotNull MavenArtifact resolve(@NotNull MavenArtifactInfo info, diff --git a/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/ProfileApplicationResult.java b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/ProfileApplicationResult.java index f86f74ce124f..d8283d4f8c0c 100644 --- a/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/ProfileApplicationResult.java +++ b/plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/ProfileApplicationResult.java @@ -15,16 +15,16 @@ */ package org.jetbrains.idea.maven.server; +import org.jetbrains.idea.maven.model.MavenExplicitProfiles; import org.jetbrains.idea.maven.model.MavenModel; import java.io.Serializable; -import java.util.Collection; public class ProfileApplicationResult implements Serializable { private final MavenModel myModel; - private final Collection<String> myActivatedProfiles; + private final MavenExplicitProfiles myActivatedProfiles; - public ProfileApplicationResult(MavenModel model, Collection<String> activatedProfiles) { + public ProfileApplicationResult(MavenModel model, MavenExplicitProfiles activatedProfiles) { myModel = model; myActivatedProfiles = activatedProfiles; } @@ -33,7 +33,7 @@ public class ProfileApplicationResult implements Serializable { return myModel; } - public Collection<String> getActivatedProfiles() { + public MavenExplicitProfiles getActivatedProfiles() { return myActivatedProfiles; } } |