mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Compile git tags now include name and branch. (RIPD-493)
This commit is contained in:
@@ -336,9 +336,8 @@ def config_env(toolchain, variant, env):
|
||||
if toolchain != 'msvc':
|
||||
git = Beast.Git(env)
|
||||
if git.exists:
|
||||
env.Append(CPPDEFINES={
|
||||
'GIT_COMMIT_ID' : '\'"%s"\'' % git.commit_id
|
||||
})
|
||||
id = '%s+%s.%s' % (git.tags, git.user, git.branch)
|
||||
env.Append(CPPDEFINES={'GIT_COMMIT_ID' : '\'"%s"\'' % id })
|
||||
|
||||
if toolchain == 'clang':
|
||||
if Beast.system.osx:
|
||||
|
||||
@@ -77,14 +77,16 @@ class __System(object):
|
||||
class Git(object):
|
||||
"""Provides information about git and the repository we are called from"""
|
||||
def __init__(self, env):
|
||||
self.tags = self.branch = self.user = ''
|
||||
self.exists = env.Detect('git')
|
||||
if self.exists:
|
||||
try:
|
||||
self.commit_id = _execute('git describe --tags')
|
||||
self.tags = _execute('git describe --tags')
|
||||
self.branch = _execute('git rev-parse --abbrev-ref HEAD')
|
||||
remote = _execute('git config remote.origin.url')
|
||||
self.user = remote.split(':')[1].split('/')[0]
|
||||
except:
|
||||
self.exists = False
|
||||
else:
|
||||
self.commit_id = None
|
||||
|
||||
system = __System()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user