Build the package

@return  bool

@since   1.0
961018
public function run()
	{
		$this->say('Building plugin: ' . $this->plgName . " (" . $this->plgType . ")");

		// Prepare directories
		$this->prepareDirectories();

		$files = $this->copyTarget($this->source, $this->target);

		// Build media (relative path)
		$media = $this->buildMedia("media/plg_" . $this->plgType . "_" . $this->plgName, 'plg_' . $this->plgType . "_" . $this->plgName);
		$media->run();

		$this->addFiles('media', $media->getResultFiles());

		// Build language files
		$language = $this->buildLanguage("plg_" . $this->plgType . "_" . $this->plgName);
		$language->run();

		// Update XML and script.php
		$this->createInstaller($files);

		return true;
	}
942989
public function installPackage()
    {
        try {
            return $this->render('@bolt/extend/_action-modal.twig', $this->getRenderContext());
        } catch (\Exception $e) {
            return $this->getJsonException($e);
        }
    }
975525
public function Build ()
    {

        // Create Boundaries

        $boundary		= '=====' . md5 (uniqid (time ()));

        // Reset headers

        $this->_headers	= array ();

        // Add MIME Headers

        $this->addHeader ('MIME-version: 1.0');
        $this->addHeader ('Content-Type: Multipart/alternative;' . $this->_nl . chr (9) . 'boundary="' . $boundary . '"');

        // Start Message

        $this->_message	= NULL;

        // If there is a template file

        if ($this->_tpl)
        {

            // Load it and add to html

            $this->addHTML (@file_get_contents ($this->_tpl));

        }

        // If HTML data

        if ($this->_htmlSet || $this->_plain)
        {

            // Construct the HTML and add it to the message

            $this->_message	.= $this->constructHTML ($boundary);

        }

        // If Body

        if ($this->_bodySet)
        {

            // Construct the body

            if (!$this->constructBody ())
            {

                // Add error and return FALSE

                new \Sonic\Message ('error', 'Cannot add message body!');
                return FALSE;

            }

        }

        // If Attachments

        if ($this->_attachmentsSet)
        {

            // Add them to the message

            foreach ($this->_attachments as $attachment)
            {
                $this->_message	.= $this->constructAttachment ($attachment, $boundary);
            }

        }

        // Finish Message

        $this->_message	.= '--' . $boundary . '--' . $this->_nl;

        // Return TRUE

        return 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;
    }
536833
public static function build() {
		// We need a working directory early.
		static::make_working_dir();
		$skel_dir = \BOB_ROOT_DIR . 'skel/';

		// Install composer.
		io::composer_install(static::$_working_dir, "{$skel_dir}composer.json", true);

		// Use local blob-common instead of pulling from Git?
		if (log::confirm('Use local copy of blob-common?')) {
			log::print('Replacing remote with local lib…');
			$working = static::$_working_dir . 'vendor/blobfolio/blob-common/lib/blobfolio/';
			v_file::rmdir($working);
			v_file::copy(\dirname(\BOB_ROOT_DIR) . '/lib/blobfolio/', $working);
		}

		log::print('Parsing classmap…');

		// We don't want all the Composer stuff, so we'll be copying
		// bits over as needed.
		$vendor_old = static::$_working_dir . 'vendor/';
		$vendor_new = static::$_working_dir . 'lib/';
		v_file::mkdir($vendor_new, 0755);

		// Parse the map.
		$raw = \file_get_contents("{$vendor_old}composer/autoload_static.php");
		if (
			(false === ($start = \strpos($raw, '$classMap ='))) ||
			(false === ($end = \strpos($raw, ');', $start)))
		) {
			log::error('Could not parse classmap.');
		}

		$map = \substr($raw, $start, ($end - $start + 2));
		$map = \str_replace("__DIR__ . '/..' . ", '', $map);
		// phpcs:disable
		eval($map);
		//phpcs:enable

		// Run through each entry, moving the source and generating a
		// new map entry.
		$out = array();
		foreach ($classMap as $k=>$v) {
			// Move the files out of the original location.
			$subdir = \explode('/', \ltrim($v, '/'));
			$subdir = \array_shift($subdir);
			if (\file_exists("{$vendor_old}{$subdir}")) {
				\rename("{$vendor_old}{$subdir}", "{$vendor_new}{$subdir}");
			}

			$classMap[$k] = '/lib/' . \ltrim($v, '/');
			$out[] = "'" . \addslashes($k) . "'=>'phar://' . \$blobcommon_phar . '/" . \addslashes(\ltrim($classMap[$k], '/')) . "'";
		}

		log::print('Cleaning up…');

		// Don't need the old vendor directory any more.
		v_file::rmdir($vendor_old);

		// We also don't need any shitlist files.
		$files = v_file::scandir(static::$_working_dir);
		$shitlist = io::SHITLIST;
		$shitlist[] = '#/LICENSE$#';
		foreach ($files as $v) {
			if (io::is_shitlist($v, $shitlist)) {
				if (\is_dir($v)) {
					v_file::rmdir($v);
				}
				else {
					\unlink($v);
				}
			}
		}

		log::print('Compressing PHP…');

		$files = v_file::scandir($vendor_new);
		foreach ($files as $v) {
			if (
				('.php' === \substr($v, -4)) ||
				// Remember blob-phone stores its classes with a .txt
				// extension to avoid bloating an optimized classmap
				// file.
				\preg_match('#/data[A-Z]{2}.txt$#', $v)
			) {
				\file_put_contents($v, \php_strip_whitespace($v));
			}
		}

		log::print('Compiling stubs…');

		// The main one first.
		static::$stub_common = \file_get_contents("{$skel_dir}common_index.template");
		static::$stub_common = \str_replace(
			'CLASSMAP',
			"\n\t" . \implode(",\n\t", $out) . "\n",
			static::$stub_common
		);

		// Our test file.
		static::$stub_test = \file_get_contents("{$skel_dir}test_index.template");
	}
413343
public function build()
    {
        $cm = $this->builder->getClassMetadata();

        $cm->mapEmbedded($this->mapping);

        return $this->builder;
    }
625956
public function installed()
    {
        try {
            return $this->json($this->manager()->getAllPackages());
        } catch (\Exception $e) {
            return $this->getJsonException($e);
        }
    }
19253
public function init()
    {
        $paths = Phing::explodeIncludePath();
        foreach ($paths as $path) {
            if (file_exists($path . DIRECTORY_SEPARATOR . 'Net' . DIRECTORY_SEPARATOR . 'FTP.php')) {
                return true;
            }
        }
        throw new BuildException('The FTP Deploy task requires the Net_FTP PEAR package.');
    }
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;
    }
1179272
private function createPackage() {
		try {
			$meta = array_merge(Metadata::all(), [
				"name" => $this->args->name,
				"release" => $this->args->release,
				"license" => $this->source->getLicense(),
				"type" => $this->args->zend ? "zend_extension" : "extension",
			]);
			$file = (new Task\PharBuild($this->source, __DIR__."/../pharext_installer.php", $meta))->run($this->verbosity());
		} catch (\Exception $e) {
			$this->error("%s\n", $e->getMessage());
			exit(self::EBUILD);
		}

		try {
			if ($this->args->sign) {
				$this->info("Using private key to sign phar ...\n");
				$pass = (new Task\Askpass)->run($this->verbosity());
				$sign = new Task\PharSign($file, $this->args->sign, $pass);
				$pkey = $sign->run($this->verbosity());
			}

		} catch (\Exception $e) {
			$this->error("%s\n", $e->getMessage());
			exit(self::ESIGN);
		}

		if ($this->args->gzip) {
			try {
				$gzip = (new Task\PharCompress($file, Phar::GZ))->run();
				$move = new Task\PharRename($gzip, $this->args->dest, $this->args->name ."-". $this->args->release);
				$name = $move->run($this->verbosity());

				$this->info("Created gzipped phar %s\n", $name);

				if ($this->args->sign) {
					$sign = new Task\PharSign($name, $this->args->sign, $pass);
					$sign->run($this->verbosity())->exportPublicKey($name.".pubkey");
				}

			} catch (\Exception $e) {
				$this->warn("%s\n", $e->getMessage());
			}
		}
		
		if ($this->args->bzip) {
			try {
				$bzip = (new Task\PharCompress($file, Phar::BZ2))->run();
				$move = new Task\PharRename($bzip, $this->args->dest, $this->args->name ."-". $this->args->release);
				$name = $move->run($this->verbosity());

				$this->info("Created bzipped phar %s\n", $name);

				if ($this->args->sign) {
					$sign = new Task\PharSign($name, $this->args->sign, $pass);
					$sign->run($this->verbosity())->exportPublicKey($name.".pubkey");
				}

			} catch (\Exception $e) {
				$this->warn("%s\n", $e->getMessage());
			}
		}

		try {
			$move = new Task\PharRename($file, $this->args->dest, $this->args->name ."-". $this->args->release);
			$name = $move->run($this->verbosity());

			$this->info("Created executable phar %s\n", $name);

			if (isset($pkey)) {
				$pkey->exportPublicKey($name.".pubkey");
			}

		} catch (\Exception $e) {
			$this->error("%s\n", $e->getMessage());
			exit(self::EBUILD);
		}
	}
282749
public function build()
    {
        $this->debug->groupCollapsed(__METHOD__);
        $this->debug->groupUncollapse();
        $str = '';
        $cfg = $this->form->cfg;
        $status = $this->form->status;
        // $printOpts   = $cfg['output'];
        // $this->debug->log('cfg', $cfg);
        $this->debug->log('status', $status);
        $strAlerts = \is_callable($cfg['buildAlerts'])
            ? \call_user_func_array($cfg['buildAlerts'], array($this->form))
            : '';
        if ($status['error']) {
            $str = $strAlerts
                .$cfg['messages']['error'];
        } elseif ($status['completed']) {
            $str = $strAlerts
                .$cfg['messages']['completed'];
        } elseif ($cfg['buildOutput']) {
            // $this->debug->warn('have buildOutput');
            $this->outputSetup();
            if (\is_callable($cfg['buildOutput'])) {
                $str = \call_user_func_array($cfg['buildOutput'], array($this->form));
            }
            if (empty($str)) {
                $this->debug->info('buildOutput callback didn\'t generate anything');
                $str = $this->buildOutput($this->form);
            }
            $str = $strAlerts
                .$this->buildHiddenFields()
                .$str;
            $str = $this->form->eventManager->publish(
                'form.buildOutput',
                $this->form,
                array('output'=>$str)
            )->getValue('output');
            if ($cfg['output']['formWrap']) {
                $attribs = $cfg['attribs'];
                if (empty($attribs['action'])) {
                    $attribs['action'] = Html::getSelfUrl();
                }
                if ($status['multipart']) {
                    $attribs['enctype'] = 'multipart/form-data';
                }
                if (\strtolower($attribs['method']) == 'get') {
                    $urlParts = \parse_url(\html_entity_decode($attribs['action']));
                    $attribs['action'] = $urlParts['path'];
                }
                #$this->debug->log('form attribs', $attribs);
                $str = '<form'.Html::buildAttribString($attribs).'>'."\n"
                    .$str
                    .'</form>'."\n";
            }
            if ($cfg['output']['filepathScript'] && \file_exists($cfg['output']['filepathScript'])) {
                $str .= '<script type="text/javascript">'
                    .\file_get_contents($cfg['output']['filepathScript'])
                    .'</script>';
            }
            if ($cfg['output']['reqDepJs']) {
                $outputScript = new OutputScript($this->form);
                $str .= $outputScript->build()."\n";
            }
        }
        $this->debug->groupEnd();
        return $str;
    }
1281141
public function build()
    {
        $options = $this->suppliedOptions;

        //build the string or callable values for title and confirmation
        $this->buildStringOrCallable($options, array('confirmation', 'title'));

        //build the string or callable values for the messages
        $messages = $this->validator->arrayGet($options, 'messages', array());
        $this->buildStringOrCallable($messages, array('active', 'success', 'error'));
        $options['messages'] = $messages;

        //override the supplied options
        $this->suppliedOptions = $options;
    }
354806
public function run()
	{
		// TODO improve DRY!
		$this->say('Creating package ' . $this->getJConfig()->extension . " " . $this->getJConfig()->version);

		// Start getting single archives
		if (file_exists(JPATH_BASE . '/dist/zips'))
		{
			$this->_deleteDir(JPATH_BASE . '/dist/zips');
		}

		$this->_mkdir(JPATH_BASE . '/dist/zips');
		$this->analyze();

		if ($this->hasComponent)
		{
			$this->createComponentZip();
		}

		if ($this->hasModules)
		{
			$this->createModuleZips();
		}

		if ($this->hasPlugins)
		{
			$this->createPluginZips();
		}

		if ($this->hasTemplates)
		{
			$this->createTemplateZips();
		}

		if ($this->hasLibraries)
		{
			$this->createLibraryZips();
		}

		$this->createPackageZip();

		// Create symlink to current folder
		if ($this->isWindows())
		{
			$this->_exec('mklink /J ' . JPATH_BASE . "\dist\pkg-" . $this->getExtensionName() . "-current.zip" . ' ' . $this->getWindowsPath($this->target));
		}
		else
		{
			$this->_symlink($this->target, JPATH_BASE . "/dist/pkg-" . $this->getExtensionName() . "-current.zip");
		}

		return true;
	}
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;
  }
982619
public function build()
    {
        if (isset($this->style)) {
            return $this->style;
        }

        $this->style = BuildUtil::removeNullElements([
            'backgroundColor' => $this->backgroundColor,
            'separator' => $this->separator,
            'separatorColor' => $this->separatorColor,
        ]);

        return $this->style;
    }
918072
public function run()
	{
		$this->say('Building CB Plugin: ' . $this->plgName . " (" . $this->plgType . ")");

		// Prepare directories
		$this->prepareDirectories();

		$files = $this->copyTarget($this->source, $this->target);

		// Build language files
		$language = $this->buildLanguage("plug_" . $this->plgType . "_" . $this->plgName);
		$language->run();

		// No XML
		$this->createInstaller($files);

		return true;
	}
169098
public function build()
    {
        if (!empty($this->container)) {
            return $this->container;
        }

        $this->container = BuildUtil::removeNullElements([
            'type' => ContainerType::BUBBLE,
            'direction' => $this->direction,
            'header' => BuildUtil::build($this->headerComponentBuilder),
            'hero' => BuildUtil::build($this->heroComponentBuilder),
            'body' => BuildUtil::build($this->bodyComponentBuilder),
            'footer' => BuildUtil::build($this->footerComponentBuilder),
            'styles' => BuildUtil::build($this->stylesBuilder),
        ]);

        return $this->container;
    }