Skip to content

Commit 2e68419

Browse files
author
Clement Champetier
committed
SConscript: remove "default" version, always use GitPython module
Raise Exception if can't get last version of AvTranscoder from GitPython.
1 parent 62f5670 commit 2e68419

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

src/SConscript

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
import glob, re
22
import os
33
import sys
4+
import git
45

56
Import( "env" )
67
Import( "envJava" )
78
Import( "envPy" )
89
Import( "installPrefix" )
910
Import( "resampleLibraryName" )
1011

11-
# Set a default version
12-
avTranscoderVersion = "0.0.1"
13-
14-
try:
15-
import git
16-
# Get last tag of git repository
17-
repo = git.Repo( "." )
18-
tags = repo.tags
19-
if tags:
20-
lastTag = tags[-1]
21-
avTranscoderVersion = lastTag.name[1:]
22-
else:
23-
raise
24-
except Exception:
25-
print "Warning: Can't access the last tag of git repository ; default version will be '0.0.1'."
12+
# Get version from last tag of git repository
13+
repo = git.Repo( "." )
14+
tags = repo.tags
15+
if tags:
16+
lastTag = tags[-1]
17+
avTranscoderVersion = lastTag.name[1:]
18+
else:
19+
raise Exception( "Can't get last version of AvTranscoder." )
2620

2721
env.Append(
2822
SHLIBVERSION = avTranscoderVersion

0 commit comments

Comments
 (0)