propertyName = $propertyName; } /** * Returns the name of the property to use */ function getPropertyName() { return $this->propertyName; } /** * Sets the path to the working copy */ function setWorkingCopy($wc) { $this->workingCopy = $wc; } /** * The main entry point * * @throws BuildException */ function main() { $this->setup('info'); exec('git log -n 1 --no-decorate --pretty=format:"%h" '.escapeshellarg(realpath($this->workingCopy)), $out); $version = $out[0]; $this->project->setProperty($this->getPropertyName(), $version); } }