use of com.intellij.externalDependencies.DependencyOnPlugin in project intellij-community by JetBrains.
the class ExternalDependenciesManagerImpl method loadState.
@Override
public void loadState(ExternalDependenciesState state) {
ArrayList<ProjectExternalDependency> oldDependencies = new ArrayList<>(myDependencies);
myDependencies.clear();
for (DependencyOnPluginState dependency : state.myDependencies) {
myDependencies.add(new DependencyOnPlugin(dependency.myId, dependency.myMinVersion, dependency.myMaxVersion, dependency.myChannel));
}
if (!oldDependencies.equals(myDependencies) && !myDependencies.isEmpty()) {
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new DumbAwareRunnable() {
@Override
public void run() {
CheckRequiredPluginsActivity.runCheck(myProject);
}
});
}
}
use of com.intellij.externalDependencies.DependencyOnPlugin in project intellij by bazelbuild.
the class PluginDependencyHelper method removeDependencyOnOldPlugin.
/**
* Removes a project depedency on a given plugin, if one exists. Doesn't trigger any update
* checking. This is to handle migration of the IntelliJ-with-Bazel plugin to a different plugin
* ID. This is introduced in v1.9, remove in v2.2+
*/
@Deprecated
public static void removeDependencyOnOldPlugin(Project project, String pluginId) {
ExternalDependenciesManager manager = ExternalDependenciesManager.getInstance(project);
List<ProjectExternalDependency> deps = Lists.newArrayList(manager.getAllDependencies());
Iterator<ProjectExternalDependency> iter = deps.iterator();
while (iter.hasNext()) {
ProjectExternalDependency dep = iter.next();
if (!(dep instanceof DependencyOnPlugin)) {
continue;
}
DependencyOnPlugin pluginDep = (DependencyOnPlugin) dep;
if (pluginDep.getPluginId().equals(pluginId)) {
iter.remove();
}
}
manager.setAllDependencies(deps);
}
Aggregations