Checks whether a plugin is dependent on another plugin with the specified
name

@param plugin
the plugin to compare
@param pluginName
the name to compare against
@return true if <code>plugin</code> depends on <code>pluginName</code>
194650
protected boolean isDependentOn(GrailsPlugin plugin, String pluginName) {

        // check if toCompare depends on the current plugin
        String[] dependencyNames = plugin.getDependencyNames();
        for (int i = 0; i < dependencyNames.length; i++) {

            final String dependencyName = dependencyNames[i];
            if (pluginName.equals(dependencyName)) {

                return true;

                // we've establish that p does depend on plugin, so we can
                // break from this loop
            }
        }
        return false;
    }
116571
function(pluginName) {
		
		var self = this;
		
		// if the plugin has been activated on this instance
		if (self[pluginName]) {
			
			var plugin = $.tooltipster._plugin(pluginName);
			
			// if there is a constructor for instances
			if (plugin.instance) {
				
				// unbridge
				$.each(plugin.instance, function(methodName, fn) {
					
					// if the method exists (privates methods do not) and comes indeed from
					// this plugin (may be missing or come from a conflicting plugin).
					if (	self[methodName]
						&&	self[methodName].bridged === self[pluginName]
					) {
						delete self[methodName];
					}
				});
			}
			
			// destroy the plugin
			if (self[pluginName].__destroy) {
				self[pluginName].__destroy();
			}
			
			// remove the reference to the plugin instance
			delete self[pluginName];
		}
		
		return self;
	}
1238019
public static function check_dependency( $plugin_file_array ) {
		$plugins = (array) get_option( 'active_plugins' );
		foreach ( (array) $plugin_file_array as $file ) {
			$found = false;
			foreach ( $plugins as $plugin ) {
				if ( false !== strpos( $plugin, $file ) ) {
					$found = true;
					break;
				}
			}
			// This plugin is not found.
			// So, check failed.
			if ( ! $found ) {
				return false;
			}
		}
		return true;
	}
450361
def has_conversion(self, plugin):
        """"""
        plugin = kurt.plugin.Kurt.get_plugin(plugin)
        return plugin.name in self._plugins
31289
private void buildExplicitlyNamedList() {

        // each plugin must either be in included set or must be a dependent of
        // included set

        for (GrailsPlugin plugin : originalPlugins) {
        // find explicitly included plugins
            String name = plugin.getName();
            if (suppliedNames.contains(name)) {
                explicitlyNamedPlugins.add(plugin);
                addedNames.add(name);
            }
        }
    }
1276240
private boolean isDescendant(DependencyInfo parentDependency, DependencyInfo childDependency){
        for (DependencyInfo dependencyInfo : childDependency.getChildren()){
            if (dependencyInfo.equals(parentDependency))
                return true;
            return isDescendant(dependencyInfo, childDependency);
        }
        return false;
    }
1333592
function(name, pluginobject) {
    var pluginNameWithoutPrefix = util.removePluginPrefix(util.removeNameSpace(name));
    if (pluginobject.rules) {
      rules.import(pluginobject.rules, pluginNameWithoutPrefix);
    }
    loadedPlugins[pluginNameWithoutPrefix] = pluginobject;
  }
1186782
void assertDependencies(final Plugin plugin)
    {
        Collection<Class<?>> expectedDependencies = new ArrayList<>();

        Collection<Class<?>> requiredPlugins = plugin.requiredPlugins();
        if (requiredPlugins != null)
        {
            expectedDependencies.addAll(requiredPlugins);
        }

        Collection<Class<?>> dependentPlugins = plugin.dependentPlugins();
        if (dependentPlugins != null)
        {
            expectedDependencies.addAll(dependentPlugins);
        }

        for (Class<?> dependencyClass : expectedDependencies)
        {
            List<?> facets = facetRegistry.getFacets(dependencyClass);

            if (facets.isEmpty())
            {
                throw new KernelException("Plugin %s misses the following dependency: %s", plugin.name(), dependencyClass.getCanonicalName());
            }
        }
    }
654138
def has_plugin_conf(self, phase, name):
        
        try:
            self.get_plugin_conf(phase, name)
            return True
        except (KeyError, IndexError):
            return False
801624
def get_name(self, plugin):
        
        for name, val in self._name2plugin.items():
            if plugin == val:
                return name
143369
private boolean loadPlugin(final String plugin) {
        if (checkPlugin(plugin)) {
            final Features pluginFeatures = pluginTable.get(plugin);
            final Map<String, List<String>> featureSet = pluginFeatures.getAllFeatures();
            for (final Map.Entry<String, List<String>> currentFeature : featureSet.entrySet()) {
                final String key = currentFeature.getKey();
                final List<Value> values = currentFeature.getValue().stream()
                        .map(val -> new Value(plugin, val))
                        .collect(Collectors.toList());
                if (!extensionPoints.contains(key)) {
                    final String msg = "Plug-in " + plugin + " uses an undefined extension point "
                            + key;
                    throw new RuntimeException(msg);
                }
                if (featureTable.containsKey(key)) {
                    final List<Value> value = featureTable.get(key);
                    value.addAll(values);
                    featureTable.put(key, value);
                } else {
                    //Make shallow clone to avoid making modifications directly to list inside the current feature.
                    List<Value> currentFeatureValue = values;
                    featureTable.put(key, currentFeatureValue != null ? new ArrayList<>(currentFeatureValue) : null);
                }
            }

            for (final Value templateName : pluginFeatures.getAllTemplates()) {
                final String template = new File(pluginFeatures.getPluginDir().toURI().resolve(templateName.value)).getAbsolutePath();
                final String templatePath = FileUtils.getRelativeUnixPath(ditaDir + File.separator + "dummy",
                        template);
                templateSet.put(templatePath, templateName);
            }
            loadedPlugin.add(plugin);
            return true;
        } else {
            return false;
        }
    }
640265
def get_plugin(self, name):
        
        for p in self._plugins:
            if p.name == name:
                return p
        return None
322090
static boolean isEclipsePluginDisabled(String pluginId, Map<URI, Plugin> allPlugins) {
        for (Plugin plugin : allPlugins.values()) {
            if(pluginId.equals(plugin.getPluginId())) {
                return false;
            }
        }
        return true;
    }
1350342
public function isLoaded($plugin)
    {
        $pluginClass = get_class($this->getBundle($plugin));

        foreach ($this->loadedBundles as $bundle => $isEnabled) {
            if ($bundle === $pluginClass && $isEnabled) {
                return true;
            }
        }

        return false;
    }
204902
@PostConstruct
	protected void checkPluginDependencies() throws GeomajasException {
		if ("true".equals(System.getProperty("skipPluginDependencyCheck"))) {
			return;
		}

		if (null == declaredPlugins) {
			return;
		}

		// start by going through all plug-ins to build a map of versions for plug-in keys
		// includes verification that each key is only used once
		Map<String, String> versions = new HashMap<String, String>();
		for (PluginInfo plugin : declaredPlugins.values()) {
			String name = plugin.getVersion().getName();
			String version = plugin.getVersion().getVersion();
			// check for multiple plugin with same name but different versions (duplicates allowed for jar+source dep)
			if (null != version) {
				String otherVersion = versions.get(name);
				if (null != otherVersion) {
					if (!version.startsWith(EXPR_START)) {
						if (!otherVersion.startsWith(EXPR_START) && !otherVersion.equals(version)) {
							throw new GeomajasException(ExceptionCode.DEPENDENCY_CHECK_INVALID_DUPLICATE,
									name, version, versions.get(name));
						}
						versions.put(name, version);
					}
				} else {
					versions.put(name, version);
				}
			}
		}

		// Check dependencies
		StringBuilder message = new StringBuilder();
		String backendVersion = versions.get("Geomajas");
		for (PluginInfo plugin : declaredPlugins.values()) {
			String name = plugin.getVersion().getName();
			message.append(checkVersion(name, "Geomajas back-end", plugin.getBackendVersion(), backendVersion));
			List<PluginVersionInfo> dependencies = plugin.getDependencies();
			if (null != dependencies) {
				for (PluginVersionInfo dependency : plugin.getDependencies()) {
					String depName = dependency.getName();
					message.append(checkVersion(name, depName, dependency.getVersion(), versions.get(depName)));
				}
			}
			dependencies = plugin.getOptionalDependencies();
			if (null != dependencies) {
				for (PluginVersionInfo dependency : dependencies) {
					String depName = dependency.getName();
					String availableVersion = versions.get(depName);
					if (null != availableVersion) {
						message.append(checkVersion(name, depName, dependency.getVersion(), versions.get(depName)));
					}
				}
			}
		}
		if (message.length() > 0) {
			throw new GeomajasException(ExceptionCode.DEPENDENCY_CHECK_FAILED, message.toString());
		}

		recorder.record(GROUP, VALUE);
	}
756074
@Nonnull
    public static List<PluginWrapper.Dependency> getImpliedDependencies(String pluginName, String jenkinsVersion) {
        List<PluginWrapper.Dependency> out = new ArrayList<>();
        for (DetachedPlugin detached : getDetachedPlugins()) {
            // don't fix the dependency for itself, or else we'll have a cycle
            if (detached.shortName.equals(pluginName)) {
                continue;
            }
            if (BREAK_CYCLES.contains(pluginName + ' ' + detached.shortName)) {
                LOGGER.log(Level.FINE, "skipping implicit dependency {0} → {1}", new Object[]{pluginName, detached.shortName});
                continue;
            }
            // some earlier versions of maven-hpi-plugin apparently puts "null" as a literal in Hudson-Version. watch out for them.
            if (jenkinsVersion == null || jenkinsVersion.equals("null") || new VersionNumber(jenkinsVersion).compareTo(detached.splitWhen) <= 0) {
                out.add(new PluginWrapper.Dependency(detached.shortName + ':' + detached.requiredVersion));
                LOGGER.log(Level.FINE, "adding implicit dependency {0} → {1} because of {2}",
                           new Object[]{pluginName, detached.shortName, jenkinsVersion});
            }
        }
        return out;
    }
692096
private void attemptPluginLoad(GrailsPlugin plugin) {
        if (areDependenciesResolved(plugin) && areNoneToLoadBefore(plugin)) {
            registerPlugin(plugin);
        }
        else {
            delayedLoadPlugins.add(plugin);
        }
    }