diff options
author | Shawn Pearce <sop@google.com> | 2016-01-03 09:30:16 -0800 |
---|---|---|
committer | Shawn Pearce <sop@google.com> | 2016-01-03 09:30:16 -0800 |
commit | 776c3003aa0f6d66f222c2d74d86a59cf9f8fe98 (patch) | |
tree | cb1a72fbeb52a2c1f2673b88ccbb1d8d43684cce /tools | |
parent | da3174a812d07b03dd0738f572e187412911e925 (diff) | |
download | jgit-776c3003aa0f6d66f222c2d74d86a59cf9f8fe98.tar.gz jgit-776c3003aa0f6d66f222c2d74d86a59cf9f8fe98.zip |
buck: set Bundle-Version for :jgit_bin
Run git describe during the build to determine the lineage of this
working directory and stamp this information into the binary.
Change-Id: I0ad24125c31e4280ccf900bac4065924087b05aa
Diffstat (limited to 'tools')
-rw-r--r-- | tools/git.defs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/git.defs b/tools/git.defs new file mode 100644 index 0000000000..557dff2319 --- /dev/null +++ b/tools/git.defs @@ -0,0 +1,9 @@ +def git_version(): + import subprocess + cmd = ['git', 'describe', '--always', '--match', 'v[0-9].*', '--dirty'] + p = subprocess.Popen(cmd, stdout = subprocess.PIPE) + v = p.communicate()[0].strip() + r = p.returncode + if r != 0: + raise subprocess.CalledProcessError(r, ' '.join(cmd)) + return v |