/**
* Executes the current command.
*
* This method is not abstract because you can use this class
* as a concrete class. In this case, instead of defining the
* execute() method, you set the code to execute by passing
* a Closure to the setCode() method.
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return null|integer null or 0 if everything went fine, or an error code
*
* @throws \LogicException When this abstract method is not implemented
* @see setCode()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$loggerHelper = new LoggerHelper();
$logger = $loggerHelper->create($input->getOption('debug'));
$logger->info('Build started.');
$buildFolder = $input->getOption('output');
$buildGenerator = new BuildGenerator($input->getOption('resources'), $buildFolder);
$writerCollectionFactory = new FullCollectionFactory();
$writerCollection = $writerCollectionFactory->createCollection($logger, $buildFolder);
$buildGenerator->setLogger($logger)->setCollectionCreator(new CollectionCreator())->setWriterCollection($writerCollection);
$buildGenerator->run($input->getArgument('version'));
$logger->info('Build done.');
}