public function build(array $settings, $sourceDir, $destination = null, array $apps = [])
    {
        $this->settings = $settings;
        $this->fsHelper->setRelativeLinks(empty($settings['abslinks']));

        if (file_exists($sourceDir . '/.git')) {
            (new LocalProject())->writeGitExclude($sourceDir);
        }

        $ids = [];
        $success = true;
        foreach (LocalApplication::getApplications($sourceDir, $this->config) as $app) {
            $id = $app->getId();
            $ids[] = $id;
            if ($apps && !in_array($id, $apps)) {
                continue;
            }
            $success = $this->buildApp($app, $destination) && $success;
        }
        $notFounds = array_diff($apps, $ids);
        if ($notFounds) {
            foreach ($notFounds as $notFound) {
                $this->output->writeln("Application not found: <comment>$notFound</comment>");
            }
        }
        if (empty($settings['no-clean'])) {
            $this->output->writeln("Cleaning up...");
            $this->cleanBuilds($sourceDir);
            $this->cleanArchives($sourceDir);
        }

        return $success;
    }
public function build(array $settings, $sourceDir, $destination = null, array $apps = [])
    {
        $this->settings = $settings;
        $this->fsHelper->setRelativeLinks(empty($settings['abslinks']));

        if (file_exists($sourceDir . '/.git')) {
            (new LocalProject())->writeGitExclude($sourceDir);
        }

        $ids = [];
        $success = true;
        foreach (LocalApplication::getApplications($sourceDir, $this->config) as $app) {
            $id = $app->getId();
            $ids[] = $id;
            if ($apps && !in_array($id, $apps)) {
                continue;
            }
            $success = $this->buildApp($app, $destination) && $success;
        }
        $notFounds = array_diff($apps, $ids);
        if ($notFounds) {
            foreach ($notFounds as $notFound) {
                $this->output->writeln("Application not found: <comment>$notFound</comment>");
            }
        }
        if (empty($settings['no-clean'])) {
            $this->output->writeln("Cleaning up...");
            $this->cleanBuilds($sourceDir);
            $this->cleanArchives($sourceDir);
        }

        return $success;
    }
public function build ( array $ settings , $ sourceDir , $ destination = null , array $ apps = [ ] ) { $ this -> settings = $ settings ; $ this -> fsHelper -> setRelativeLinks ( empty ( $ settings [ 'abslinks' ] ) ) ; if ( file_exists ( $ sourceDir . '/.git' ) ) { ( new LocalProject ( ) ) -> writeGitExclude ( $ sourceDir ) ; } $ ids = [ ] ; $ success = true ; foreach ( LocalApplication :: getApplications ( $ sourceDir , $ this -> config ) as $ app ) { $ id = $ app -> getId ( ) ; $ ids [ ] = $ id ; if ( $ apps && ! in_array ( $ id , $ apps ) ) { continue ; } $ success = $ this -> buildApp ( $ app , $ destination ) && $ success ; } $ notFounds = array_diff ( $ apps , $ ids ) ; if ( $ notFounds ) { foreach ( $ notFounds as $ notFound ) { $ this -> output -> writeln ( "Application not found: <comment>$notFound</comment>" ) ; } } if ( empty ( $ settings [ 'no-clean' ] ) ) { $ this -> output -> writeln ( "Cleaning up..." ) ; $ this -> cleanBuilds ( $ sourceDir ) ; $ this -> cleanArchives ( $ sourceDir ) ; } return $ success ; }
Build a project from any source directory, targeting any destination.

@param array  $settings    An array of build settings.
Possible settings:
- clone (bool, default false) Clone the repository to the build
directory before building, where possible.
- copy (bool, default false) Copy files instead of symlinking them,
where possible.
- abslinks (bool, default false) Use absolute paths in symlinks.
- no-archive (bool, default false) Do not archive or use an archive of
the build.
- no-cache (bool, default false) Disable the package cache (if
relevant and if the package manager supports this).
- no-clean (bool, default false) Disable cleaning up old builds or
old build archives.
- no-build-hooks (bool, default false) Disable running build hooks.
- no-deps (bool, default false) Disable installing build
dependencies.
- concurrency (int) Specify a concurrency for Drush Make, if
applicable (when using the Drupal build flavor).
- working-copy (bool, default false) Specify the --working-copy
option to Drush Make, if applicable.
- lock (bool, default false) Create or update a lock
file via Drush Make, if applicable.
- run-deploy-hooks (bool, default false) Run deploy and/or
post_deploy hooks.
@param string $sourceDir   The absolute path to the source directory.
@param string $destination Where the web root(s) will be linked (absolute
path).
@param array  $apps        An array of application names to build.

@throws \Exception on failure

@return bool
Build a project from any source directory targeting any destination .