Create some scripts to build the executable jars out of bin/*

This commit is contained in:
R. Tyler Croy 2014-07-06 15:41:59 -07:00
parent 997ac81e7f
commit cd71d0edec
4 changed files with 51 additions and 18 deletions

0
build/.gitkeep Normal file
View File

28
scripts/_usejruby.sh Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
function load_rvm() {
source ~/.rvm/scripts/rvm
}
function use_jruby() {
export JRUBY=${JRUBY:=jruby}
export GEMSET=${GEMSET:=rubygems}
echo ">> Using ${JRUBY} in ${GEMSET}"
rvm use ${JRUBY}@${GEMSET}
}
function install_gems() {
# Test to make sure we have bundler around
gem which bundler > /dev/null
if [ $? -ne 0 ]; then
echo ">> Installing bundler into the ${GEMSET} gemset"
gem install bundler --no-ri --no-rdoc
fi;
echo ">> Executing \`bundle install\`"
bundle install
}

19
scripts/build-jars Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
source $(dirname $0)/_usejruby.sh
echo "> Cleaning build/ of jars"
rm -f build/*.jar
load_rvm
use_jruby
install_gems
for f in bin/*; do
export JAR_NAME=$(basename $f)
echo "> Building ${JAR_NAME}.jar";
warble executable jar
mv "${JAR_NAME}.jar" build/
done;

View File

@ -1,23 +1,9 @@
#!/usr/bin/env bash
source ~/.rvm/scripts/rvm
source $(dirname $0)/_usejruby.sh
JRUBY=${JRUBY:=jruby}
GEMSET=${GEMSET:=rubygems}
echo ">> Using ${JRUBY} in ${GEMSET}"
rvm use ${JRUBY}@${GEMSET}
# Test to make sure we have bundler around
which bundle > /dev/null
if [ $? -ne 0 ]; then
echo ">> Installing bundler into the ${GEMSET} gemset"
gem install bundler --no-ri --no-rdoc
fi;
echo ">> Executing \`bundle install\`"
bundle install
load_rvm
use_jruby
install_gems
exec $@