Exemple #1
0
 public function process(BuildInterface $build)
 {
     if ($this->_if !== null) {
         /*
          * If we have a condition, we need to check
          */
         $property = $build->getProperty($this->_if);
         if ($property !== true) {
             $build->info('Property: ' . $this->_name . ' does not apply, ' . $this->_if . ' == false');
             $build->setStatus(BuildInterface::PASSED);
             return;
         }
     }
     if (isset($this->_file)) {
         if (file_exists($this->_file)) {
             $build->info('Reading property file: ' . $this->_file);
             $this->_plugin->parsePropertyFile($build, $this->_file);
         } elseif (strstr($this->_file, '${')) {
             // not substituted yet, will not use it
         } else {
             $build->error('Cannot read property file: ' . $this->_file);
         }
     } else {
         $build->debug('Setting property "${' . $this->_name . '}" to "' . $this->_value . '"');
         $build->getProperties()->set($this->_name, $this->_value);
         $build->setStatus(BuildInterface::PASSED);
     }
 }