/** * Execute this task. * * @throws BuildException on error */ public function main() { if ($this->property == null) { throw new BuildException("property attribute required", $this->getLocation()); } if ($this->file == null) { throw new BuildException("file attribute required", $this->getLocation()); } else { $value = $this->file->getAbsoluteFile()->getParent(); $this->getProject()->setNewProperty($this->property, $value); } }