Switch build infrastructure to Git.

This commit is contained in:
David Anderson
2014-05-25 01:53:58 -07:00
parent e20e4677df
commit 2e89d91a86
5 changed files with 92 additions and 60 deletions
+9 -2
View File
@@ -16,11 +16,18 @@ outputs = [
os.path.join(builder.buildFolder, 'includes', 'version_auto.inc'),
]
with open(os.path.join(builder.sourcePath, '.git', 'HEAD')) as fp:
git_state = fp.read().strip().split(':')[1].strip()
git_head_path = os.path.join(builder.sourcePath, '.git', git_state)
if not os.path.exists(git_head_path):
git_head_path = os.path.join(builder.sourcePath, '.git', 'HEAD')
sources = [
os.path.join(builder.sourcePath, 'product.version'),
# This is a hack, but we need some way to only run this script when HG changes.
os.path.join(builder.sourcePath, '.hg', 'dirstate'),
# This is a hack, but we need some way to only run this script when Git changes.
git_head_path,
# The script source is a dependency, of course...
argv[1]