Add external project dependency

@param {array|string} $dep
181903
public function addDependency($dep)
    {
        if (is_array($dep)) {
            $this->dependencies = array_merge($this->dependencies, $dep);
        } else {
            $this->dependencies[] = $dep;
        }
    }
1152550
final protected static function checkDependencies(string $dependencyClassName, string $dependencyPackageName)
    {
        if (!class_exists($dependencyClassName)) {
            throw new MissingDependencyException(
                sprintf(
                    'Class "%s" does not exist, please install package "%s"',
                    $dependencyClassName,
                    $dependencyPackageName
                )
            );
        }
    }
201941
protected function enqueue_dependencies( $handles, $context = null ) {
		if ( null !== $context ) {
			$this->add_context( $context );
		}

		if ( ! $this->dependencies || count( $handles ) < 1 ) {
			return;
		}

		foreach ( $handles as $handle ) {
			$found = $this->dependencies->enqueue_handle(
				$handle,
				$this->context,
				true
			);
			if ( ! $found ) {
				$message = sprintf(
					__( 'Could not enqueue dependency "%1$s" for shortcode "%2$s".',
						'bn-shortcodes' ),
					$handle,
					$this->get_tag()
				);
				trigger_error( $message, E_USER_WARNING );
			}
		}

	}
1370645
public void addAttachment(CmsDocumentDependency dep) {

        // don't add attachment if this is a language version of an already existing attachment
        boolean exist = false;
        for (CmsDocumentDependency att : m_attachments) {
            if (att.getAttachmentNumber() == dep.getAttachmentNumber()) {

                if (m_locale.equals(dep.getLocale())) {
                    // if dependency has same locale as main document it is added as attachment
                    // and gets the old attachment as a language-version with all previous language-versions
                    for (CmsDocumentDependency langAtt : att.getVariants()) {
                        dep.addVariant(langAtt);
                    }
                    dep.addVariant(att);
                    m_attachments.remove(att);
                } else {
                    exist = true;
                    att.addVariant(dep);
                }
                break;
            }
        }

        if (!exist) {
            dep.setType(DependencyType.attachment);
            m_attachments.add(dep);
        } else {
            dep.setType(DependencyType.variant);
        }
        addDependency(dep);
    }
1269375
function queueDependency(dep) {
            //Make sure to load any plugin and associate the dependency
            //with that plugin.
            var prefix = dep.prefix,
                fullName = dep.fullName;

            //Do not bother if the depName is already in transit
            if (specified[fullName] || fullName in defined) {
                return;
            }

            if (prefix && !plugins[prefix]) {
                //Queue up loading of the dependency, track it
                //via context.plugins. Mark it as a plugin so
                //that the build system will know to treat it
                //special.
                plugins[prefix] = undefined;

                //Remember this dep that needs to have normaliztion done
                //after the plugin loads.
                (normalizedWaiting[prefix] || (normalizedWaiting[prefix] = []))
                    .push(dep);

                //Register an action to do once the plugin loads, to update
                //all managerCallbacks to use a properly normalized module
                //name.
                (managerCallbacks[prefix] ||
                (managerCallbacks[prefix] = [])).push({
                    onDep: function (name, value) {
                        if (name === prefix) {
                            updateNormalizedNames(prefix);
                        }
                    }
                });

                queueDependency(makeModuleMap(prefix));
            }

            context.paused.push(dep);
        }
233915
public void addRule(IntDependency dependency, double count) {
    if ( ! directional) {
      dependency = new IntDependency(dependency.head, dependency.arg, false, dependency.distance);
    }
    if (verbose) System.err.println("Adding dep " + dependency);
    //    coreDependencies.incrementCount(dependency, count);
    /*new IntDependency(dependency.head.word,
                                        dependency.head.tag,
                                        dependency.arg.word,
                                        dependency.arg.tag,
                                        dependency.leftHeaded,
                                        dependency.distance), count);
    */
    expandDependency(dependency, count);
    // System.err.println("stopCounter: " + stopCounter);
    // System.err.println("argCounter: " + argCounter);
  }
809939
public function addWeakDependency($value)
    {
        if ($this->weak_dependency === null) {
            $this->weak_dependency = new \Protobuf\ScalarCollection();
        }

        $this->weak_dependency->add($value);
    }
1235465
public static void addDependency(Dependency depend)
  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();

    addDependency(depend, loader);
  }
516553
@SuppressWarnings("unchecked")
    protected void addPostRunDependent(Executable<? extends Indexable> executable) {
        TaskGroup.HasTaskGroup dependency = (TaskGroup.HasTaskGroup) executable;
        this.addPostRunDependent(dependency);
    }
1112717
public function addScript($handle, $script, array $dependency = [])
    {
        if (is_null($handle)) {
            $handle = $script;
        }

        $this->package->js($handle, $script, $dependency, true);

        return $this;
    }
311492
function addModuleToDependencies(cwd, name, version) {
  version = version || 'latest';
  let pkgFile = { dependencies: {} };
  const pkgPath = path.join(cwd, 'package.json');
  if (fs.existsSync(pkgPath)) {
    pkgFile = fs.readJsonSync(pkgPath);
  }
  pkgFile.dependencies[name] = version;
  fs.outputJsonSync(pkgPath, pkgFile);
}
788988
private function installGlobal(array $dependencies)
    {
        foreach ($dependencies as $package => $version) {
            if (!$this->isInstalledGlobally($package)) {
                $arg = $version === '*' ? $package : $package . '@' . $version;
                $this->runCommand('npm install --global ' . escapeshellarg($arg));
            }
        }
    }
282774
public function addToBundle($name, $deps)
    {
        if ($name == '') {
            throw new exception\InvalidArgumentException('The require.js bundle name must not be empty');
        }

        if (!is_array($deps) && !($deps instanceof \Traversable)) {
            $deps = [ $deps ];
        }

        if (!isset($this->bundles[$name])) {
            $this->bundles[$name] = [];
        }

        foreach ($deps as $item) {
            $item = (string)$item;

            if ($item != '') {
                $this->bundles[$name][] = $item;
            }
        }

        return $this;
    }
1239354
public static function addDependency($locale, $dependsOn) {
		$locale = self::normalize($locale);
		$dependsOn = self::normalize($dependsOn);
		self::$dependencies[$locale] = $dependsOn;
	}
529267
public function installDependencies($destination, array $dependencies, $global = false)
    {
        $success = true;
        foreach ($dependencies as $stack => $stackDependencies) {
            $manager = $this->getManager($stack);
            $this->output->writeln(sprintf(
                "Installing <info>%s</info> dependencies with '%s': %s",
                $stack,
                $manager->getCommandName(),
                implode(', ', array_keys($stackDependencies))
            ));
            if (!$manager->isAvailable()) {
                $this->output->writeln(sprintf(
                    "Cannot install <comment>%s</comment> dependencies: '%s' is not installed.",
                    $stack,
                    $manager->getCommandName()
                ));
                if ($manager->getInstallHelp()) {
                    $this->output->writeln($manager->getInstallHelp());
                }
                $success = false;
                continue;
            }
            $path = $destination . '/' . $stack;
            $this->ensureDirectory($path);
            $manager->install($path, $stackDependencies, $global);
        }

        return $success;
    }
485779
def add_dependency(self, address):
    """"""
    if address in self._dependencies_by_address:
      if self._dependencies_by_address[address].has_comment():
        logger.warn('BuildFileManipulator would have added {address} as a dependency of '
                    '{target_address}, but that dependency was already forced with a comment.'
                    .format(address=address.spec, target_address=self.target_address.spec))
        return
    spec = address.reference(referencing_path=self.build_file.spec_path)
    self._dependencies_by_address[address] = DependencySpec(spec)
555069
def add_dep(self, ):
        
        i = self.dep_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            dep = item.internal_data()
            dep.projects.add(self._project)
            self.deps.append(dep)
            item.set_parent(None)