No-commit versioning. v0.1.4
authorCarl Hetherington <cth@carlh.net>
Thu, 27 Sep 2018 19:49:32 +0000 (20:49 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 27 Sep 2018 19:49:32 +0000 (20:49 +0100)
wscript

diff --git a/wscript b/wscript
index 417d823bd748db7f3449bb137d2b471ad1a83a2b..2e0209a930655e24b0567e3ad72f23b72d9605fc 100644 (file)
--- a/wscript
+++ b/wscript
@@ -1,11 +1,19 @@
 import subprocess
+import shlex
 import os
 import sys
 import distutils.spawn
 from waflib import Logs
 
 APPNAME = 'libasdcp-cth'
-VERSION = '0.1.3devel'
+
+this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
+last_version = subprocess.Popen(shlex.split('git describe --tags --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
+
+if this_version == '':
+    VERSION = '%sdevel' % last_version[1:].strip()
+else:
+    VERSION = this_version[1:].strip()
 
 def options(opt):
     opt.load('compiler_cxx')