summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-11-26 09:45:24 +0100
committerFabio Bas <ctrlaltca@gmail.com>2013-11-26 09:45:24 +0100
commitf9720e7ae73b2eadd909f60c52908a5e60ea0b42 (patch)
tree0fb095d6ddc3eecbf4397b1d37c85dea557bae7b
parentbf092af2e7dfa5fb915e0fed376b9f5339ef2e9a (diff)
Get version hash from git while creating dist package
-rw-r--r--buildscripts/phing/tasks/PradoVersionTask.php15
1 files changed, 3 insertions, 12 deletions
diff --git a/buildscripts/phing/tasks/PradoVersionTask.php b/buildscripts/phing/tasks/PradoVersionTask.php
index 4310cf60..15c73efd 100644
--- a/buildscripts/phing/tasks/PradoVersionTask.php
+++ b/buildscripts/phing/tasks/PradoVersionTask.php
@@ -38,17 +38,8 @@ class PradoVersionTask extends PropertyTask
*/
private function getPradoRevision()
{
- $svnPath=dirname(__FILE__).'/../../../.svn';
- if(is_file($svnPath.'/all-wcprops'))
- $propFile=$svnPath.'/all-wcprops';
- else if(is_file($svnPath.'/dir-wcprops'))
- $propFile=$svnPath.'/dir-wcprops';
- else
- return 'unknown';
- $contents=file_get_contents($propFile);
- if(preg_match('/\\/svn\\/\\!svn\\/ver\\/(\d+)\\//ms',$contents,$matches)>0)
- return $matches[1];
- else
- return 'unknown';
+ $rev=shell_exec("git log -1 --pretty=format:'%h'");
+ if($rev===null) $rev='unknown';
+ return $rev;
}
}