Skip to content

Commit 68e64cb

Browse files
author
dnolen
committed
add revision script, fix build & uberjar scripts
1 parent ca0173c commit 68e64cb

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

script/build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ REVISION=`git --no-replace-objects describe --match v$MAJOR.$MINOR`
2626
# it is a little easier to understand.
2727
REVISION=${REVISION:5} # drop the first 5 characters
2828
REVISION=${REVISION:0:${#REVISION}-9} # drop the last 9 characters
29+
REVISION=${REVISION/\-/}
2930

3031
TAG=r$MAJOR.$MINOR.$REVISION
3132

script/revision

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
# The command `git describe --match v0.0` will return a string like
6+
#
7+
# v0.0-856-g329708b
8+
#
9+
# where 856 is the number of commits since the v0.0 tag. It will always
10+
# find the v0.0 tag and will always return the total number of commits (even
11+
# if the tag is v0.0.1).
12+
MAJOR="1"
13+
MINOR="7"
14+
REVISION=`git --no-replace-objects describe --match v$MAJOR.$MINOR`
15+
16+
# Extract the version number from the string. Do this in two steps so
17+
# it is a little easier to understand.
18+
REVISION=${REVISION:5} # drop the first 5 characters
19+
REVISION=${REVISION:0:${#REVISION}-9} # drop the last 9 characters
20+
REVISION=${REVISION/\-/}

script/uberjar

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ REVISION=`git --no-replace-objects describe --match v$MAJOR.$MINOR`
2020
# it is a little easier to understand.
2121
REVISION=${REVISION:5} # drop the first 5 characters
2222
REVISION=${REVISION:0:${#REVISION}-9} # drop the last 9 characters
23+
REVISION=${REVISION/\-/}
2324

2425
COMP_FILE=`mktemp /tmp/compiler.clj.XXXXXXXXXXX`
2526
sed -e 's/^.def ^:dynamic \*clojurescript-version\*.*$/(def ^:dynamic *clojurescript-version* {:major '"$MAJOR"', :minor '"$MINOR"', :qualifier '"$REVISION"'})/' src/main/clojure/cljs/util.cljc > $COMP_FILE

0 commit comments

Comments
 (0)