Skip to content

Commit e7999e1

Browse files
committed
tweak uberjar script so it includes AOTed core and sets the
version number correctly
1 parent e6d7f36 commit e7999e1

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

script/uberjar

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
3+
# This script must be run within the ClojureScript top-level project
4+
# directory.
5+
6+
set -ex
7+
8+
# The command `git describe --match v0.0` will return a string like
9+
#
10+
# v0.0-856-g329708b
11+
#
12+
# where 856 is the number of commits since the v0.0 tag. It will always
13+
# find the v0.0 tag and will always return the total number of commits (even
14+
# if the tag is v0.0.1).
15+
REVISION=`git --no-replace-objects describe --match v0.0`
16+
17+
# Extract the version number from the string. Do this in two steps so
18+
# it is a little easier to understand.
19+
REVISION=${REVISION:5} # drop the first 5 characters
20+
REVISION=${REVISION:0:${#REVISION}-9} # drop the last 9 characters
21+
22+
rm -f src/cljs/cljs/core.aot.js
23+
rm -f src/cljs/cljs/core.aot.js.map
24+
rm -f src/cljs/cljs/core.cljs.cache.aot.edn
25+
26+
./script/aot_core
27+
28+
AOT_FILE=`mktemp /tmp/core.aot.js.XXXXXXXXXXX`
29+
sed -e "s/0.0-0000/0.0-$REVISION/" src/cljs/cljs/core.aot.js > $AOT_FILE
30+
mv $AOT_FILE src/cljs/cljs/core.aot.js
31+
32+
AOT_CACHE_FILE=`mktemp /tmp/core.cljs.cache.aot.edn.XXXXXXXXXXX`
33+
sed -e "s/0.0-0000/0.0-$REVISION/" src/cljs/cljs/core.cljs.cache.aot.edn > $AOT_CACHE_FILE
34+
mv $AOT_CACHE_FILE src/cljs/cljs/core.cljs.cache.aot.edn
235

336
lein uberjar clojure.main
437
mv target/clojurescript-0.0-SNAPSHOT-standalone.jar target/cljs.jar

0 commit comments

Comments
 (0)