Creates the signed license at the defined output path

@throws BuildException
@return void
178
protected function generateLicense()
    {
        $command = $this->prepareSignCommand() . ' 2>&1';

        $this->log('Creating license at ' . $this->outputFile);

        $this->log('Running: ' . $command, Project::MSG_VERBOSE);
        $tmp = exec($command, $output, $return_var);

        // Check for exit value 1. Zendenc_sign command for some reason
        // returns 0 in case of failure and 1 in case of success...
        if ($return_var !== 1) {
            throw new BuildException("Creating license failed. \n\nZendenc_sign msg:\n" . implode(
                "\n",
                $output
            ) . "\n\n");
        }
    }
1249923
public function main()
    {
        $repo = $this->getRepository();
        if (empty($repo)) {
            throw new BuildException('"repository" is a required parameter');
        }

        $remote = $this->getRemote();
        if (empty($remote)) {
            throw new BuildException('"remote" is a required parameter');
        }

        chdir($repo);
        $this->client = $this->getGitClient(false, $repo);

        // initalized yet?
        if (!is_dir('.subsplit')) {
            $this->subsplitInit();
        } else {
            // update
            $this->subsplitUpdate();
        }

        // find all splits based on heads requested
        $this->findSplits();

        // check that GitHub has the repos
        $this->verifyRepos();

        // execute the subsplits
        $this->publish();
    }
84409
public function build()
    {
        $externalVendorDirectoryOverride = false;

        //
        // External Composer Filename
        //

        if ($this->hasInternalRepository) {
            $externalComposerFilename = $this->composerFilename ?: Factory::getComposerFile();
        } else {
            $externalComposerFilename = Factory::getComposerFile();
        }

        $pristineExternalComposerFilename = $externalComposerFilename;

        if (0 !== strpos($externalComposerFilename, '/') && 1 !== strpos($externalComposerFilename, ':')) {
            $externalComposerFilename = $this->externalRootDirectory.'/'.$externalComposerFilename;
        }


        //
        // External Composer Config
        //

        $externalComposerConfig = Factory::createConfig();

        $configJsonFile = new JsonFile($externalComposerFilename);

        if ($configJsonFile->exists()) {
            try {
                $configJsonFile->validateSchema(JsonFile::LAX_SCHEMA);
                $localConfig = $configJsonFile->read();
                if (isset($localConfig['config']['vendor-dir'])) {
                    $externalVendorDirectoryOverride = true;
                }
                $externalComposerConfig->merge($localConfig);
            } catch (ParsingException $e) {
                $this->error = $e;
            }
        } else {
            if ($pristineExternalComposerFilename === 'composer.json') {
                $message = 'Composer could not find a composer.json file in '.realpath($this->externalRootDirectory);
            } else {
                $message = 'Composer could not find the config file: '.$externalComposerFilename;
            }
            $instructions = 'To initialize a project, please create a '.
                $pristineExternalComposerFilename.
                ' file as described in the http://getcomposer.org/ "Getting Started" section';

            $this->error = new \InvalidArgumentException($message.PHP_EOL.$instructions);
        }

        //
        // External Vendor Directory
        //

        if ($this->hasInternalRepository) {
            $externalVendorDirectory = ($externalVendorDirectoryOverride || ! $this->vendorDirectory)
                ? $externalComposerConfig->get('vendor-dir')
                : $this->vendorDirectory;
        } else {
            $externalVendorDirectory = $externalComposerConfig->get('vendor-dir');
        }

        if (0 !== strpos($externalVendorDirectory, '/') && 1 !== strpos($externalVendorDirectory, ':')) {
            $externalVendorDirectory = $this->externalRootDirectory.'/'.$externalVendorDirectory;
        }


        //
        // External Repository
        //

        $externalRepository = new InstalledFilesystemRepository(
            new JsonFile($externalVendorDirectory.'/composer/installed.json')
        );


        //
        // Internal Repository
        //

        $internalRepository = new CompositeRepository(array());

        if ($this->hasInternalRepository) {
            $internalInstalledRepository = new InstalledFilesystemRepository(
                new JsonFile(
                    $this->internalVendorDirectory.'/composer/installed.json'
                )
            );

            $internalRepository->addRepository($internalInstalledRepository);
        }

        $rootPackageFilename = $this->internalVendorDirectory.'/dflydev/embedded-composer/.root_package.json';
        if (file_exists($rootPackageFilename)) {
            $rootPackageRepository = new InstalledFilesystemRepository(
                new JsonFile($rootPackageFilename)
            );

            $internalRepository->addRepository($rootPackageRepository);
        }


        //
        // Repository
        //

        $repository = new CompositeRepository(array(
            $externalRepository,
            $internalRepository
        ));


        return new EmbeddedComposer(
            $this->classLoader,
            $this->externalRootDirectory,
            $externalRepository,
            $externalComposerFilename,
            $externalComposerConfig,
            $externalVendorDirectory,
            $externalVendorDirectoryOverride,
            $internalRepository,
            $this->internalVendorDirectory,
            $this->hasInternalRepository,
            $repository
        );
    }
629931
public function createFromCommand()
    {
        $command = ShowCommand::getInstance($this->getRepository())->showCommit($this->ref);
        $outputLines = $this->getCaller()->execute($command, true, $this->getRepository()->getPath())->getOutputLines();
        $this->parseOutputLines($outputLines);
    }
973671
public function main()
    {
        $this->requireDependencies();

        if (!isset($this->file) and count($this->filesets) == 0) {
            throw new BuildException('Missing either a nested fileset or attribute "file" set');
        }

        if (count($this->loggers) == 0) {
            throw new BuildException('Missing nested "logger" element');
        }

        $this->validateLoggers();
        $this->validateAnalyzers();

        $filesToParse = $this->getFilesToParse();

        $runner = $this->createRunner();
        $runner->setSourceArguments($filesToParse);

        foreach ($this->loggers as $logger) {
            // Register logger
            if ($this->oldVersion) {
                $runner->addLogger(
                    $logger->getType(),
                    $logger->getOutfile()->__toString()
                );
            } else {
                $runner->addReportGenerator(
                    $logger->getType(),
                    $logger->getOutfile()->__toString()
                );
            }
        }

        foreach ($this->analyzers as $analyzer) {
            // Register additional analyzer
            $runner->addOption(
                $analyzer->getType(),
                $analyzer->getValue()
            );
        }

        // Disable annotation parsing
        if ($this->withoutAnnotations) {
            $runner->setWithoutAnnotations();
        }

        // Enable bad documentation support
        if ($this->supportBadDocumentation) {
            $runner->setSupportBadDocumentation();
        }

        // Check for suffix
        if (count($this->allowedFileExtensions) > 0) {
            $runner->setFileExtensions($this->allowedFileExtensions);
        }

        // Check for ignore directories
        if (count($this->excludeDirectories) > 0) {
            $runner->setExcludeDirectories($this->excludeDirectories);
        }

        // Check for exclude packages
        if (count($this->excludePackages) > 0) {
            $runner->setExcludePackages($this->excludePackages);
        }

        $runner->run();

        if ($runner->hasParseErrors() === true) {
            $this->log('Following errors occurred:');

            foreach ($runner->getParseErrors() as $error) {
                $this->log($error);
            }

            if ($this->haltonerror === true) {
                throw new BuildException('Errors occurred during parse process');
            }
        }
    }
433700
public function licenseAgreementAction()
    {
        $this->title("License Agreement");

        // Get license
        $license = file_get_contents(dirname(dirname(__DIR__)) . '/COPYING');
        $this->set("license", $license);

        return $this->render("license_agreement.phtml");
    }
628202
public function setToolpath($path)
    {
        if (!file_exists($path)) {
            $fs = FileSystem::getFileSystem();
            $fullpath = $fs->which($path);
            if ($fullpath === false) {
                throw new BuildException(
                    'Tool does not exist. Path: ' . $path
                );
            }
            $path = $fullpath;
        }
        if (!is_executable($path)) {
            throw new BuildException(
                'Tool not executable. Path: ' . $path
            );
        }
        $this->toolPath = $path;
    }
933403
public function main()
    {
        if (null === $this->getRepository() && false === $this->getRemoteRepo()) {
            throw new BuildException('"repository" is required parameter');
        }

        if (null === $this->getTreeish()) {
            throw new BuildException('"treeish" is required parameter');
        }

        $cmd = $this->getGitClient(false, $this->getRepository() !== null ? $this->getRepository() : './')
            ->getCommand('archive')
            ->setOption('prefix', $this->prefix)
            ->setOption('output', $this->output !== null ? $this->output->getPath() : false)
            ->setOption('format', $this->format)
            ->setOption('remote', $this->remoteRepo)
            ->addArgument($this->treeish);

        $this->log('Git command : ' . $cmd->createCommandString(), Project::MSG_DEBUG);

        $cmd->execute();

        $msg = 'git-archive: archivating ' . '"' . $this->getRepository() . '" repository (' . $this->getTreeish() . ')';
        $this->log($msg, Project::MSG_INFO);
    }
1310614
public function main()
    {
        if ($this->dir === null) {
            throw new BuildException("dir attribute is required", $this->getLocation());
        }
        if ($this->dir->isFile()) {
            throw new BuildException(
                "Unable to create directory as a file already exists with that name: " . $this->dir->getAbsolutePath()
            );
        }
        if (!$this->dir->exists()) {
            $result = $this->dir->mkdirs($this->mode);
            if (!$result) {
                if ($this->dir->exists()) {
                    $this->log("A different process or task has already created " . $this->dir->getAbsolutePath());

                    return;
                }
                $msg = "Directory " . $this->dir->getAbsolutePath() . " creation was not successful for an unknown reason";
                throw new BuildException($msg, $this->getLocation());
            }
            $this->log("Created dir: " . $this->dir->getAbsolutePath());
        }
    }
120502
def build_license_file(directory, spec):
    
    name, text = '', ''

    try:
        name = spec['LICENSE']
        text = spec['X_MSI_LICENSE_TEXT']
    except KeyError:
        pass # ignore this as X_MSI_LICENSE_TEXT is optional

    if name!='' or text!='':
        file = open( os.path.join(directory.get_path(), 'License.rtf'), 'w' )
        file.write('{\\rtf')
        if text!='':
             file.write(text.replace('\n', '\\par '))
        else:
             file.write(name+'\\par\\par')
        file.write('}')
        file.close()
7926
protected function build()
    {
        $operation = $this->buildOperation('DeleteProfile');

        $merchantID = $this->document->createElement(
            'merchantID',
            $this->merchantId
        );
        $operation->appendChild($merchantID);

        $customerId = $this->document->createElement(
            'customerID',
            $this->customerId
        );
        $operation->appendChild($customerId);

        if ($this->profileId) {
            $profileId = $this->document->createElement(
                'profileID',
                $this->profileId
            );
            $operation->appendChild($profileId);
        }
    }
1096326
private function registerSeederMakeCommand()
    {
        $this->app->bindShared('command.make.package.seeder', function ($app)
        {
            return new SeederMakeCommand($app['files'], $app['packages']);
        });

        $this->commands('command.make.package.seeder');
    }
787450
protected function create()
    {
        // if user_id and license_key are set then use the web service
        if (array_get($this->config, 'user_id', false)) {
            return $this->createWebClient();
        }

        // if database file is set then use database service
        if (array_get($this->config, 'database', false)) {
            return $this->createDatabase();
        }

        throw new InvalidCredentialsException();
    }
877659
public function main()
    {
        $clone = $this->getFactoryInstance('archive');
        if ($this->revision !== '') {
            $clone->setRev($this->revision);
        }

        if ($this->destination === null) {
            throw new BuildException("Destination must be set.");
        }
        $clone->setDestination($this->destination);

        try {
            $this->log("Executing: " . $clone->asString(), Project::MSG_INFO);
            $output = $clone->execute();
            if ($output !== '') {
                $this->log(PHP_EOL . $output);
            }
        } catch (Exception $ex) {
            $msg = $ex->getMessage();
            $p = strpos($msg, 'hg returned:');
            if ($p !== false) {
                $msg = substr($msg, $p + 13);
            }
            throw new BuildException($msg);
        }
    }
1292774
public function createTargetfile()
    {
        if ($this->targetFilePos !== null) {
            throw new BuildException(
                $this->getTaskType() . " doesn\'t support multiple "
                . "targetfile elements.",
                $this->getLocation()
            );
        }

        $this->targetFilePos = $this->commandline->createMarker();
        $this->srcIsFirst = ($this->srcFilePos !== null);

        return $this->targetFilePos;
    }
733485
def license(dir = Dir.pwd,
                license = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata][:license],
                authors = '',
                options = {
                  :filename     => 'LICENSE'
                })
      return if ((license.empty?) or (license == 'none') or (license =~ /^CC/))
      return unless FalkorLib::Config::Bootstrap::DEFAULTS[:licenses].keys.include?( license )
      info "Generate the #{license} licence file"
      path = normalized_path(dir)
      use_git = FalkorLib::Git.init?(path)
      rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path
      Dir.chdir( rootdir ) do
        run %( licgen #{license.downcase} #{authors} )
        run %( mv LICENSE #{options[:filename]} ) if( options[:filename] and options[:filename] != 'LICENSE')
      end
    end
839704
public function create()
    {
        $this->assertPathIsSet();
        $this->assertNotExists();
        $this->doCreate();
        $this->setPermissions();

        return $this;
    }