Sets the target dependencies from xml

@param  string $depends Comma separated list of targetnames that depend on
this target
@throws BuildException
359804
public function setDepends($depends)
    {
        // explode should be faster than strtok
        $deps = explode(',', $depends);
        for ($i = 0, $size = count($deps); $i < $size; $i++) {
            $trimmed = trim($deps[$i]);
            if ($trimmed === "") {
                throw new BuildException(
                    "Syntax Error: Depend attribute for target " . $this->getName() . " is malformed."
                );
            }
            $this->addDependency($trimmed);
        }
    }
136466
public function addNode(DependencyNode $node)
    {
        if (!$this->dependencies->contains($node)) {
            $this->dependencies->attach($node, new ArrayObject());
            $this->nodes[] = $node;

            foreach ($node->getDependencies() as $depency) {
                $this->addDependency($node, $depency);
            }
        }
    }
784276
public function add(Dependency $dependency) : DependencySet
    {
        $clone = clone $this;
        if ($this->contains($dependency)
            || $dependency->count() === 0) {
            return $clone;
        }

        $clone->collection[] = $dependency;
        return $clone;
    }
1263189
public function addDependency(Source $source)
    {
        if ($this->parent !== null) {
            $this->parent->addDependency($source);
        }
        $tplId = $source->tplId;
        if ($source->type == 'string' || $source->type == 'base64') {
            $this->property['dependency'][$tplId] = $source->type;
            return;
        }
        $this->property['dependency'][$tplId] = [
            0 => $source->type,
            1 => $source->tplname,
            2 => $source->timestamp,
        ];
    }
1011074
public function setDependencyResolver(DependencyResolver $dependencyResolver)
    {
        if ($this->dependencyResolver != null) {
            throw new \LogicException('There is an instance of DependencyManager class in class ContentManager.');
        }

        $this->dependencyResolver = $dependencyResolver;
    }
304482
private function getDependencyCode(Dependency $dependency) : Code
    {
        $prop = $this->privateProperty;
        $node = $this->getFactoryNode($dependency);
        ($this->aopCode)($dependency, $node);
        $isSingleton = $prop($dependency, 'isSingleton');
        $node[] = $this->getIsSingletonCode($isSingleton);
        $node[] = new Node\Stmt\Return_(new Node\Expr\Variable('instance'));
        $node = $this->factory->namespace('Ray\Di\Compiler')->addStmts($node)->getNode();
        $qualifer = $this->qualifier;
        $this->qualifier = null;

        return new Code($node, $isSingleton, $qualifer);
    }
701455
public void setDependsOn(java.util.Collection<JobDependency> dependsOn) {
        if (dependsOn == null) {
            this.dependsOn = null;
            return;
        }

        this.dependsOn = new java.util.ArrayList<JobDependency>(dependsOn);
    }
1326343
protected function buildNodeDependencies(array $nodes)
    {
        $this->nodesByPath = [];
        $this->nodesByNodeData = [];
        $this->dependenciesOutgoing = [];
        $this->dependenciesIncoming = [];
        $this->nodesWithoutIncoming = [];

        /** @var Node $node */
        foreach ($nodes as $node) {
            $this->nodesByPath[$node->getPath()][] = $node;
            $this->nodesByNodeData[spl_object_hash($node->getNodeData())] = $node;
            $this->nodesWithoutIncoming[spl_object_hash($node)] = $node;
        }

        /** @var Node $node */
        foreach ($nodes as $node) {
            $nodeHash = spl_object_hash($node);

            // Add dependencies for (direct) parents, this will also cover moved and created nodes
            if (isset($this->nodesByPath[$node->getParentPath()])) {
                /** @var Node $parentNode */
                foreach ($this->nodesByPath[$node->getParentPath()] as $parentNode) {
                    $dependencyHash = spl_object_hash($parentNode);
                    $this->dependenciesIncoming[$nodeHash][$dependencyHash] = $parentNode;
                    $this->dependenciesOutgoing[$dependencyHash][$nodeHash] = $node;
                    unset($this->nodesWithoutIncoming[$nodeHash]);
                }
            }

            // Add a dependency for a moved-to reference
            $movedToNodeData = $node->getNodeData()->getMovedTo();
            if ($movedToNodeData !== null) {
                $movedToHash = spl_object_hash($movedToNodeData);
                if (!isset($this->nodesByNodeData[$movedToHash])) {
                    throw new WorkspaceException('Cannot publish a list of nodes with missing dependency (' . $node->getPath() . ' needs ' . $movedToNodeData->getPath() . ' to be published)', 1416483470);
                }
                $dependencyHash = spl_object_hash($this->nodesByNodeData[$movedToHash]);
                $this->dependenciesIncoming[$nodeHash][$dependencyHash] = $this->nodesByNodeData[$movedToHash];
                $this->dependenciesOutgoing[$dependencyHash][$nodeHash] = $node;
                unset($this->nodesWithoutIncoming[$nodeHash]);
            }
        }
    }
638694
public function executeTarget($targetName)
    {

        // complain about executing void
        if ($targetName === null) {
            throw new BuildException("No target specified");
        }

        // invoke topological sort of the target tree and run all targets
        // until targetName occurs.
        $sortedTargets = $this->topoSort($targetName);

        $curIndex = (int) 0;
        $curTarget = null;
        $thrownException = null;
        $buildException = null;
        do {
            try {
                $curTarget = $sortedTargets[$curIndex++];
                $curTarget->performTasks();
            } catch (BuildException $exc) {
                if (!($this->keepGoingMode)) {
                    throw $exc;
                }
                $thrownException = $exc;
            }
            if ($thrownException != null) {
                if ($thrownException instanceof BuildException) {
                    $this->log(
                        "Target '" . $curTarget->getName()
                        . "' failed with message '"
                        . $thrownException->getMessage() . "'.",
                        Project::MSG_ERR
                    );
                    // only the first build exception is reported
                    if ($buildException === null) {
                        $buildException = $thrownException;
                    }
                } else {
                    $this->log(
                        "Target '" . $curTarget->getName()
                        . "' failed with message '"
                        . $thrownException->getMessage() . "'." . PHP_EOL
                        . $thrownException->getTraceAsString(),
                        Project::MSG_ERR
                    );
                    if ($buildException === null) {
                        $buildException = new BuildException($thrownException);
                    }
                }
            }
        } while ($curTarget->getName() !== $targetName);

        if ($buildException !== null) {
            throw $buildException;
        }
    }
1212201
protected function resolveDependencies(array $dependencies)
    {
        $results = [];

        foreach ($dependencies as $dependency) {
            // If this dependency has a override for this particular build we will use
            // that instead as the value. Otherwise, we will continue with this run
            // of resolutions and let reflection attempt to determine the result.
            if ($this->hasParameterOverride($dependency)) {
                $results[] = $this->getParameterOverride($dependency);

                continue;
            }

            // If the class is null, it means the dependency is a string or some other
            // primitive type which we can not resolve since it is not a class and
            // we will just bomb out with an error since we have no-where to go.
            $results[] = is_null($dependency->getClass())
                            ? $this->resolvePrimitive($dependency)
                            : $this->resolveClass($dependency);
        }

        return $results;
    }
1366944
public function set($file, $url, $title, $titles, $tocs, $ctime, array $depends)
    {
        foreach ($tocs as $toc) {
            foreach ($toc as $child) {
                $this->parents[$child] = $file;
                if (isset($this->entries[$child])) {
                    $this->entries[$child]['parent'] = $file;
                }
            }
        }

        $this->entries[$file] = array(
            'file' => $file,
            'url' => $url,
            'title' => $title,
            'titles' => $titles,
            'tocs' => $tocs,
            'ctime' => $ctime,
            'depends' => $depends
        );

        if (isset($this->parents[$file])) {
            $this->entries[$file]['parent'] = $this->parents[$file];
        }
    }
178097
public function addDependency($moduleName, $dependency)
    {
        if (!isset($this->moduleNames[$dependency])) {
            throw new RuntimeException(sprintf(
                'The module "%s" does not exist in the graph.',
                $dependency
            ));
        }

        if (!isset($this->moduleNames[$moduleName])) {
            throw new RuntimeException(sprintf(
                'The module "%s" does not exist in the graph.',
                $moduleName
            ));
        }

        if (null !== ($path = $this->getPath($dependency, $moduleName))) {
            $last = array_pop($path);

            throw new CyclicDependencyException(sprintf(
                'A cyclic dependency was discovered between the modules "%s" '.
                'and "%s". Please check the "override" keys defined in these '.
                'modules.',
                implode('", "', $path),
                $last
            ));
        }

        $this->dependencies[$moduleName][$dependency] = true;
    }
102237
public function dependsOn(self $node)
    {
        if (!in_array($node, $this->dependencies)) {
            $this->dependencies[] = $node;
        }
    }
876057
public function add($element, $dependencies = array())
    {
        // Add
        $this->elements[$element] = (object)array(
            'id' => $element,
            'dependencies' => (array)$dependencies,
            'visited' => false
        );
    }
981826
protected function _addDependency(string $file): void
    {
        $file = str_replace('\\', '/', $file);
        if (!in_array($file, $this->_dependencies)) {
            $this->_dependencies[] = $file;
        }
    }
280426
public void setDependencies(java.util.Collection<ApplicationDependencySummary> dependencies) {
        if (dependencies == null) {
            this.dependencies = null;
            return;
        }

        this.dependencies = new java.util.ArrayList<ApplicationDependencySummary>(dependencies);
    }
445110
public function setType($type)
    {
        $this->type = $type;

        switch ($this->type) {
            case 'jdepend-chart':
            case 'jdepend-xml':
            case 'overview-pyramid':
            case 'phpunit-xml':
            case 'summary-xml':
                break;

            default:
                throw new BuildException('Logger "' . $this->type . '" not implemented');
        }
    }