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':
|
if toolchain != 'msvc':
|
||||||
git = Beast.Git(env)
|
git = Beast.Git(env)
|
||||||
if git.exists:
|
if git.exists:
|
||||||
env.Append(CPPDEFINES={
|
id = '%s+%s.%s' % (git.tags, git.user, git.branch)
|
||||||
'GIT_COMMIT_ID' : '\'"%s"\'' % git.commit_id
|
env.Append(CPPDEFINES={'GIT_COMMIT_ID' : '\'"%s"\'' % id })
|
||||||
})
|
|
||||||
|
|
||||||
if toolchain == 'clang':
|
if toolchain == 'clang':
|
||||||
if Beast.system.osx:
|
if Beast.system.osx:
|
||||||
|
|||||||
@@ -77,14 +77,16 @@ class __System(object):
|
|||||||
class Git(object):
|
class Git(object):
|
||||||
"""Provides information about git and the repository we are called from"""
|
"""Provides information about git and the repository we are called from"""
|
||||||
def __init__(self, env):
|
def __init__(self, env):
|
||||||
|
self.tags = self.branch = self.user = ''
|
||||||
self.exists = env.Detect('git')
|
self.exists = env.Detect('git')
|
||||||
if self.exists:
|
if self.exists:
|
||||||
try:
|
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:
|
except:
|
||||||
self.exists = False
|
self.exists = False
|
||||||
else:
|
|
||||||
self.commit_id = None
|
|
||||||
|
|
||||||
system = __System()
|
system = __System()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user