Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 41 lines (27 sloc) 1.39 KB
#! /usr/bin/env sh
set -e
if [ $# -ne 1 ]; then
echo "[\033[31merror\033[0m] Usage: package VERSION"
exit -1
export PLAY_VERSION=$1
if test "$1" != "test"; then
`dirname $0`/cleanEverything
`dirname $0`/build clean
`dirname $0`/build -Dplay.version=${PLAY_VERSION} build-repository api-docs
echo "[info] Cleaning previous package"
rm -rf /tmp/play-*
echo "[info] Copying to /tmp/play-${PLAY_VERSION}..."
cp -rf `dirname $0`/.. /tmp/play-${PLAY_VERSION}
cd /tmp
# Small patch (this is the only way for now)
echo "[info] fixing version"
sed -i '' -e '7s/version: .*/version: '$PLAY_VERSION'/' play-${PLAY_VERSION}/framework/sbt/
sed -i '' -e 's/PLAY_VERSION=.*/PLAY_VERSION="'$PLAY_VERSION'"/' play-${PLAY_VERSION}/framework/build
sed -i '' -e 's/PLAY_VERSION=.*/PLAY_VERSION="'$PLAY_VERSION'"/' play-${PLAY_VERSION}/framework/build.bat
echo "[info] zipping..."
zip -9 -r play-${PLAY_VERSION}.zip play-${PLAY_VERSION} -x '*.git/*' '*.lock' '*.history' '*.gitmodules' 'play-'${PLAY_VERSION}'/.gitignore' '*.DS_Store' 'play-'${PLAY_VERSION}'/dist/*' '*/target/*' 'play-'${PLAY_VERSION}'/framework/sbt/boot/*' 'play-'${PLAY_VERSION}'/repository/cache/*' 'play-'${PLAY_VERSION}'/samples/workinprogress/*' '*/logs/*' '*/tmp/*' '*/project/project/*' '*.log'
rm -rf /tmp/play-${PLAY_VERSION}
echo "[info] Package is available at /tmp/play-${PLAY_VERSION}.zip"
Something went wrong with that request. Please try again.