/**
  * Executes this target.
  *
  * @author     Noah Fontes <*****@*****.**>
  * @since      1.0.0
  */
 public function main()
 {
     $thisProject = $this->getProject();
     $project = $this->target->getProject();
     Phing::setCurrentProject($project);
     chdir($project->getBasedir()->getAbsolutePath());
     /* Assign properties for consistency. */
     $thisProject->copyUserProperties($project);
     $thisProject->copyInheritedProperties($project);
     foreach ($thisProject->getProperties() as $name => $property) {
         if (!AgaviProxyProject::isPropertyProtected($name) && $project->getProperty($name) === null) {
             $project->setNewProperty($name, $property);
         }
     }
     /* Execute the proxied target. */
     $project->executeTarget($this->target->getName());
     Phing::setCurrentProject($thisProject);
     chdir($thisProject->getBasedir()->getAbsolutePath());
     $project->copyUserProperties($thisProject);
     $project->copyInheritedProperties($thisProject);
     foreach ($project->getProperties() as $name => $property) {
         if (!AgaviProxyProject::isPropertyProtected($name) && $thisProject->getProperty($name) === null) {
             $thisProject->setNewProperty($name, $property);
         }
     }
 }
 /**
  * Copies the configuration from the proxied project into this project.
  *
  * @author     Noah Fontes <*****@*****.**>
  * @since      1.0.4
  */
 protected function copy()
 {
     foreach ($this->proxied->getBuildListeners() as $listener) {
         parent::addBuildListener($listener);
     }
     $this->setInputHandler($this->proxied->getInputHandler());
     foreach ($this->proxied->getTaskDefinitions() as $name => $class) {
         parent::addTaskDefinition($name, $class);
     }
     foreach ($this->proxied->getDataTypeDefinitions() as $name => $class) {
         parent::addDataTypeDefinition($name, $class);
     }
     /* Assign properties for consistency. */
     $this->proxied->copyUserProperties($this);
     $this->proxied->copyInheritedProperties($this);
     foreach ($this->proxied->getProperties() as $name => $property) {
         if (!AgaviProxyProject::isPropertyProtected($name) && $this->getProperty($name) === null) {
             parent::setNewProperty($name, $property);
         }
     }
     /* Add proxy targets to the new project. */
     foreach ($this->proxied->getTargets() as $name => $target) {
         $proxy = new AgaviProxyTarget();
         $proxy->setName($name);
         $proxy->setDescription($target->getDescription());
         $proxy->setTarget($target);
         parent::addTarget($name, $proxy);
     }
     parent::setUserProperty('phing.version', $this->proxied->getProperty('phing.version'));
     $this->setSystemProperties();
 }