Skip to content

Commit

Permalink
[PropelBundle] Made Build task a hub for other tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto authored and fabpot committed Jun 23, 2010
1 parent 3ec2577 commit 097b87b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/Symfony/Framework/PropelBundle/Command/BuildCommand.php
Expand Up @@ -3,6 +3,8 @@
namespace Symfony\Framework\PropelBundle\Command;

use Symfony\Framework\PropelBundle\Command\PhingCommand;
use Symfony\Framework\PropelBundle\Command\BuildModelCommand;
use Symfony\Framework\PropelBundle\Command\BuildSqlCommand;
use Symfony\Components\Console\Input\InputArgument;
use Symfony\Components\Console\Input\InputOption;
use Symfony\Components\Console\Input\InputInterface;
Expand Down Expand Up @@ -36,7 +38,8 @@ protected function configure()
{
$this
->setDefinition(array(
new InputOption('--classes', '', InputOption::PARAMETER_NONE, 'Build all classes'),
new InputOption('--classes', '', InputOption::PARAMETER_NONE, 'Build only classes'),
new InputOption('--sql', '', InputOption::PARAMETER_NONE, 'Build only code'),
))
->setName('propel:build')
;
Expand All @@ -49,7 +52,19 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->callPhing('om');
if (!$input->getOption('sql')) {
$output->writeln('<info>Building model classes</info>');
$modelCommand = new BuildModelCommand();
$modelCommand->setApplication($this->application);
$modelCommand->execute($input, $output);
}

if (!$input->getOption('classes')) {
$output->writeln('<info>Building model sql</info>');
$sqlCommand = new BuildSQLCommand();
$sqlCommand->setApplication($this->application);
$sqlCommand->execute($input, $output);
}
}

}

0 comments on commit 097b87b

Please sign in to comment.