Builds the project.
@return Result The task result.
358351
function build(): Result {
    $version = $this->taskSemVer('.semver')->setFormat('%M.%m.%p')->__toString();
    return $this->taskReplaceInFile('bin/which')->regex("/const packageVersion = '\d+(\.\d+){2}'/")->to("const packageVersion = '$version'")->run();
  }
742589
public function build()
    {
        $this->dataObject = [];
        foreach ($this->buildItems as $name => $value) {
            if ($value instanceof BuilderInterface) {
                if (!$this->buildItems[$name]->build()) {
                    return false;
                }
                $this->dataObject[$name] = $this->buildItems[$name]->getResult();
            } elseif (is_callable($value)) {
                $this->dataObject[$name] = $value();
            } else {
                $this->dataObject[$name] = $this->buildItems[$name];
            }
        }

        return true;
    }
956272
public function build()
    {
        $tokenParsers = [];
        $executionStrategies = [];
        $functions = [];

        foreach ($this->extensions as $extension) {
            $tokenParsers = array_merge($tokenParsers, $extension->getTokenParsers());
            $executionStrategies = array_merge($executionStrategies, $extension->getExecutionStrategies());
            $functions = array_merge($functions, $extension->getFunctions());
        }

        $registry = new Registry($tokenParsers, [], [], '<{', '}>');

        $this->syntax = new Syntax(new Lexer(new TemplateLexer($registry)), new Parser(new TemplateParser($registry)));

        $this->executionStrategies = new ExecutionStrategyCollection($executionStrategies);

        $this->environment = new Environment($functions);

        $this->isLocked = true;
    }
151475
public function build()
    {
        Debug::enterScope('build');
        $traverser = $this->createNodeCreatorTraverser($this->config);
        $result = $traverser->traverse();

        $node = new ContainerNode();
        $gatherer = $this->createNodeGathererTraverser($result, $node);
        $gatherer->traverse();
        Debug::exitScope('build');

        return $node;
    }
794868
public function build()
    {
        foreach ($this->action->getActionComponents() as $actionComponent) {
            if (!$actionComponent->isText()) {
                $this->buildComponent($actionComponent);
            }
        }
    }
40753
@Override
  public P build() {
    try {
      return buildAsync().join();
    } catch (Exception e) {
      if (e instanceof CompletionException && e.getCause() instanceof RuntimeException) {
        throw (RuntimeException) e.getCause();
      } else {
        throw e;
      }
    }
  }
17922
public function install(): OperationResult
    {
        $result = new OperationResult();

        $sourcePath = "{$this->packageInstallDir}/.installer/%s/files";
        foreach ($this->projectType->getProjectDirs() as $projectDir) {
            if (is_dir(sprintf($sourcePath, $projectDir))) {
                /** @var \RecursiveDirectoryIterator $iterator */
                $iterator = new \RecursiveIteratorIterator(
                    new \RecursiveDirectoryIterator(
                        sprintf($sourcePath, $projectDir),
                        \RecursiveDirectoryIterator::SKIP_DOTS
                    ),
                    \RecursiveIteratorIterator::SELF_FIRST
                );

                /** @var \SplFileInfo $file */
                foreach ($iterator as $file) {
                    $target = "{$this->projectRootDir}/{$iterator->getSubPathname()}";
                    if ($file->isDir()) {
                        if (!is_dir($target)) {
                            if (!mkdir($target)) {
                                $result->addErrorMessage("<error>Could not create target directory '${target}'</error>");
                            }
                        }
                    } elseif (!file_exists($target)) {
                        assert(is_string($file->getRealPath()));
                        if (!copy($file->getRealPath(), $target)) {
                            $result->addErrorMessage("<error>Could not copy file to '${target}'</error>");
                        }
                    }
                }
            }
        }

        if (!$result->isFailure()) {
            $result->addStatusMessage("Successfully copied files from package {$this->packageName}");
        }

        return $result;
    }
1318979
public function build()
    {
        $issue = $this->root;
        $this->issues[$issue->getKey()] = $issue;

        $unreceivedIssues = array_diff_key($this->issues, $this->populatedIssueKeys);
        while (count($unreceivedIssues) > 0 && $this->depth < $this->maxDepth) {
            $unpopulatedIssueKeys = [];
            foreach ($unreceivedIssues as $issue) {
                /** @var Issue $issue */
                $this->populatedIssueKeys[$issue->getKey()] = 1;

                foreach ($issue->getLinks() as $issueLink) {
                    $unpopulatedIssueKey = IssueLinkHelper::getLinkedIssueKey($issueLink);
                    if ($unpopulatedIssueKey) {
                        $unpopulatedIssueKeys[$unpopulatedIssueKey] = $unpopulatedIssueKey;
                    }
                }
            }

            $notProcessedIssueKeys = [];
            foreach ($unpopulatedIssueKeys as $issueKey) {
                if (!array_key_exists($issueKey, $this->issues)) {
                    $notProcessedIssueKeys[] = $issueKey;
                }
            }

            if ($notProcessedIssueKeys) {
                $issues = $this->getIssuesFromRepositoryByKeys($notProcessedIssueKeys);
                foreach ($issues as $issue) {
                    if (!array_key_exists($issue->getKey(), $this->issues)) {
                        $this->issues[$issue->getKey()] = $issue;
                    }
                }
            }

            $unreceivedIssues = array_diff_key($this->issues, $this->populatedIssueKeys);
            $this->depth++;
        }
    }
419084
public function main()
    {
        $clone = $this->getFactoryInstance('pull');
        $clone->setInsecure($this->getInsecure());
        $clone->setQuiet($this->getQuiet());

        $cwd = getcwd();

        if ($this->repository === '') {
            $project = $this->getProject();
            $dir = $project->getProperty('application.startdir');
        } else {
            $dir = $this->repository;
        }
        $this->checkRepositoryIsDirAndExists($dir);
        chdir($dir);

        try {
            $this->log("Executing: " . $clone->asString(), Project::MSG_INFO);
            $output = $clone->execute();
            if ($output !== '') {
                $this->log($output);
            }
        } catch (Exception $ex) {
            $msg = $ex->getMessage();
            $p = strpos($msg, 'hg returned:');
            if ($p !== false) {
                $msg = substr($msg, $p + 13);
            }
            chdir($cwd);
            throw new BuildException($msg);
        }
        chdir($cwd);
    }
1049564
public function build() {
    $options_data = $this->buildOptionsData();

    $out_text = 
      $this->buildUsageLine($this->arguments_spec->getUsage(), $options_data);

    $options_text = '';
    if ($options_data['lines']) {
      foreach($options_data['lines'] as $option_line_data) {
        $options_text .= $this->buildOptionLine($option_line_data, $options_data)."\n";
      }

      $out_text .= 
        "\n".
        ConsoleFormat::applyformatToText('bold','cyan','Options:')."\n".
        $options_text;
    }

    return $out_text;
  }
1193357
public function build()
    {

        $query = $this->getQuery();
        $manager = new BuildManager($this->getBase()->getConnection());
        $manager->setPage($this->page);
        $manager->setQuery($query);
        $manager->setParams($this->string['parameters']);

        return $manager;
    }
1128150
public function build()
    {
        $cache          = new QuickCache();
        $cached         = $cache->get('fieldsinfo');
        $this->template = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Templates' . DIRECTORY_SEPARATOR . 'request';
        $this->name     = $cached['name'];
        $this->fields   = $cached['fields'];
        $this->soft     = $cached['soft_delete'];
        $this->names();
        $template = [
            $this->loadTemplate(),
            $this->loadTemplate()
        ];
        $template = $this->buildParts($template);
        $this->publish($template);
    }
288110
public function init()
    {
        if (empty($this->getOwningTarget()->getName())) {
            $project       = $this->getProject();
            $buildFileRoot = $project->getProperty('phing.file');
            $buildList     = $this->getBuildList($buildFileRoot);
            $targets       = array();

            foreach ($buildList as $buildFile => $info) {
                if (is_file($buildFile)) {
                    $target = new Target();
                    $target->setName('help-'.$info['name']);

                    $task = clone $this;
                    $task->setBuildFile($buildFile);
                    $task->setOwningTarget($target);

                    $target->addTask($task);
                    $this->project->addTarget('help-'.$info['name'], $target);

                    $targets[$buildFileRoot][] = array(
                        'name'        => $target->getName(),
                        'visibility'  => 'hidden',
                        'description' => $buildList[$buildFile]['description'],
                     );
                }

                if ($buildFile === $buildFileRoot) {
                    $project->setDefaultTarget($target->getName());
                }
            }//end foreach

            $this->project->helpTargets = $targets;
        }//end if

    }
763300
public function build()
    {
        $packages = [];

        if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
            $packages = json_decode($this->files->get($path), true);
        }

        $ignoreAll = in_array('*', $ignore = $this->packagesToIgnore());

        $this->write($keys = collect($packages)->mapWithKeys(function ($package) {
            return [$this->format($package['name']) => $package['extra']['nano7'] ? $package['extra']['nano7'] : []];
        })->each(function ($configuration) use (&$ignore) {
            $ignore = array_merge($ignore, $configuration['dont-discover'] ? $configuration['dont-discover'] : []);
        })->reject(function ($configuration, $package) use ($ignore, $ignoreAll) {
            return $ignoreAll || in_array($package, $ignore);
        })->filter()->all());

        return $keys;
    }
242494
public function build() {

        // If we have decided not to backup blocks, prevent anything to be built
        if (!$this->get_setting_value('blocks')) {
            $this->built = true;
            return;
        }

        // If "child" of activity task and it has been excluded, nothing to do
        $parent = basename(dirname(dirname($this->taskbasepath)));
        if ($parent != 'course') {
            $includedsetting = $parent . '_included';
            if (!$this->get_setting_value($includedsetting)) {
                $this->built = true;
                return;
            }
        }

        // Process the block.xml common file (instance + positions)
        $this->add_step(new restore_block_instance_structure_step('block_commons', 'block.xml'));

        // Here we add all the common steps for any block and, in the point of interest
        // we call to define_my_steps() in order to get the particular ones inserted in place.
        $this->define_my_steps();

        // Restore block role assignments and overrides (internally will observe the role_assignments setting)
        $this->add_step(new restore_ras_and_caps_structure_step('block_ras_and_caps', 'roles.xml'));

        // Restore block comments (conditionally)
        if ($this->get_setting_value('comments')) {
            $this->add_step(new restore_comments_structure_step('block_comments', 'comments.xml'));
        }

        // Search reindexing (if enabled).
        if (\core_search\manager::is_indexing_enabled()) {
            $wholecourse = $this->get_target() == backup::TARGET_NEW_COURSE;
            $wholecourse = $wholecourse || $this->setting_exists('overwrite_conf') && $this->get_setting_value('overwrite_conf');
            if (!$wholecourse) {
                $this->add_step(new restore_block_search_index('block_search_index'));
            }
        }

        // At the end, mark it as built
        $this->built = true;
    }
736454
public function build() {

        // Set the backup::VAR_CONTEXTID setting to course context as far as next steps require that
        $coursectxid = context_course::instance($this->get_courseid())->id;
        $this->add_setting(new backup_activity_generic_setting(backup::VAR_CONTEXTID, base_setting::IS_INTEGER, $coursectxid));

        // Add some extra settings that related processors are going to need
        $this->add_setting(new backup_activity_generic_setting(backup::VAR_SECTIONID, base_setting::IS_INTEGER, $this->sectionid));
        $this->add_setting(new backup_activity_generic_setting(backup::VAR_COURSEID, base_setting::IS_INTEGER, $this->get_courseid()));

        // Create the section directory
        $this->add_step(new create_taskbasepath_directory('create_section_directory'));

        // Create the section.xml common file (course_sections)
        $this->add_step(new backup_section_structure_step('section_commons', 'section.xml'));

        // Generate the inforef file (must be after ALL steps gathering annotations of ANY type)
        $this->add_step(new backup_inforef_structure_step('section_inforef', 'inforef.xml'));

        // Migrate the already exported inforef entries to final ones
        $this->add_step(new move_inforef_annotations_to_final('migrate_inforef'));

        // At the end, mark it as built
        $this->built = true;
    }
456462
public function build()
    {
        $this->dataObject = array();
        foreach ($this->buildItems['collection'] as $builder) {
            if (!$builder->build()) {
                return false;
            } else {
                $this->dataObject[] = $builder->getResult();
            }
        }

        return true;
    }