Beispiel #1
0
 /**
  * Performs a project checkout against the specified repository.
  *
  * @return void
  */
 public function execute()
 {
     $out = phpucConsoleOutput::get();
     $out->writeLine('Performing checkout task.');
     $out->startList();
     // Get current working dir
     $cwd = getcwd();
     $out->writeListItem('Checking out project.');
     $projectPath = sprintf('%s/projects/%s', $this->args->getArgument('cc-install-dir'), $this->args->getOption('project-name'));
     // Switch working dir to the CruiseControl project directory
     chdir($projectPath);
     $checkout = phpucAbstractCheckout::createCheckout($this->args);
     $checkout->checkout();
     chdir($cwd);
     $out->writeListItem('Preparing config.xml file.');
     $fileName = sprintf('%s/config.xml', $this->args->getArgument('cc-install-dir'));
     $config = new phpucConfigFile($fileName);
     $project = $config->getProject($this->args->getOption('project-name'));
     $strapper = $project->createBootStrapper();
     $strapper->localWorkingCopy = "{$projectPath}/source";
     $strapper->strapperType = $this->args->getOption('version-control');
     $trigger = $project->createBuildTrigger();
     $trigger->localWorkingCopy = "{$projectPath}/source";
     $trigger->triggerType = $this->args->getOption('version-control');
     $config->store();
     $out->writeListItem('Preparing build.xml checkout target.');
     $buildFile = new phpucBuildFile("{$projectPath}/build.xml");
     $buildTarget = $buildFile->createBuildTarget('checkout');
     $execTask = phpucAbstractAntTask::create($buildFile, 'exec');
     $execTask->executable = phpucFileUtil::findExecutable($this->args->getOption('version-control'));
     $execTask->argLine = $checkout->getUpdateCommand();
     $execTask->failonerror = true;
     $buildTarget->addTask($execTask);
     $buildFile->store();
     $out->writeLine();
 }
Beispiel #2
0
 /**
  * Magic property setter method.
  *
  * @param string $name  The property name.
  * @param mixed  $value The property value.
  * 
  * @return void
  * @throws OutOfRangeException If the property doesn't exist or is readonly.
  */
 public function __set($name, $value)
 {
     switch ($name) {
         case 'module':
             $this->properties[$name] = $value;
             break;
         default:
             parent::__set($name, $value);
             break;
     }
 }