aboutsummaryrefslogtreecommitdiffhomepage
path: root/compile.sh
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-05-20 14:55:57 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-05-21 09:49:31 +0000
commit7d429acdb4fd8e9889b8a88895b598057752f261 (patch)
treeed84201683cafb6080ed4f6d30f51593f104c0cf /compile.sh
parent20961145457ff0cf7e9a1ac4b7d00a3d654eef60 (diff)
Adding git commit hash as version when using compile.sh
-- MOS_MIGRATED_REVID=94088974
Diffstat (limited to 'compile.sh')
-rwxr-xr-xcompile.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/compile.sh b/compile.sh
index b38763fa98..5714ea7760 100755
--- a/compile.sh
+++ b/compile.sh
@@ -373,6 +373,16 @@ if [ -z "${BAZEL_SKIP_JAVA_COMPILATION}" ]; then
cp src/main/java/$i output/classes/$i
done
+ # build-data.properties
+ git_version="non-git"
+ if [ -x "$(which git || true)" ] && [ -d .git ]; then
+ git_version=$(git log -1 --oneline | cut -d " " -f 1 2>/dev/null || \
+ echo "non-git")
+ fi
+ cat >output/classes/build-data.properties <<EOF
+build.time=$(date)
+build.label=bazel-compile.sh-${git_version}
+EOF
create_deploy_jar "libblaze" "com.google.devtools.build.lib.bazel.BazelMain" \
output third_party/javascript
fi