Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 51 lines (38 sloc) 1.62 KB
#!/usr/bin/env bash
# This script must be run within the ClojureScript top-level project
# directory.
set -ex
cd `dirname $0`/..
# The command `git describe --match v0.0` will return a string like
# v0.0-856-g329708b
# where 856 is the number of commits since the v0.0 tag. It will always
# find the v0.0 tag and will always return the total number of commits (even
# if the tag is v0.0.1).
REVISION=`git --no-replace-objects describe --match v0.0`
# Extract the version number from the string. Do this in two steps so
# it is a little easier to understand.
REVISION=${REVISION:5} # drop the first 5 characters
REVISION=${REVISION:0:${#REVISION}-9} # drop the last 9 characters
COMP_FILE=`mktemp /tmp/compiler.clj.XXXXXXXXXXX`
sed -e 's/^.def ^:dynamic \*clojurescript-version\*.*$/(def ^:dynamic *clojurescript-version* {:major 0, :minor 0, :qualifier '"$REVISION"'})/' src/clj/cljs/compiler.clj > $COMP_FILE
mv $COMP_FILE src/clj/cljs/compiler.clj
CLJS_FILE=`mktemp /tmp/core.cljs.XXXXXXXXXXX`
sed -e 's/^.def \*clojurescript-version\*.*$/(def *clojurescript-version* '\""0.0-$REVISION"\"')/' src/cljs/cljs/core.cljs > $CLJS_FILE
mv $CLJS_FILE src/cljs/cljs/core.cljs
# For Hudson server
if [ "$HUDSON" = "true" ]; then
mvn --fail-at-end -Psonatype-oss-release \
clean deploy nexus-staging:release
echo "Creating tag $TAG"
git tag -f "$TAG"
git push origin "$TAG"
echo "Skipping remote deployment and Git tag because we are not on Hudson."
mvn clean install
Something went wrong with that request. Please try again.