This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb6/build-tools/BUILD.sh

51 lines
1.9 KiB
Bash
Executable file

#!/bin/sh
cd `dirname $0`/..
SRCDIR=`pwd`
if [ "x$1" = "x" ]; then
OUTDIR="$SRCDIR";
else
OUTDIR="$1";
fi
echo "Building Legacy Worlds..."
mvn clean || { echo "Maven clean-up failed"; exit 1; };
mvn package || { echo "Maven build failed"; exit 1; };
echo "Copying files..."
TEMPDIR=`mktemp -d`
mkdir $TEMPDIR/legacyworlds
mkdir $TEMPDIR/legacyworlds/server
mkdir $TEMPDIR/legacyworlds/server/data
mkdir $TEMPDIR/legacyworlds/web
mkdir $TEMPDIR/legacyworlds/sql
# Database and initial data
cp -Rapv legacyworlds-server/legacyworlds-server-data/db-structure/database.sql $TEMPDIR/legacyworlds/sql
cp -Rapv legacyworlds-server/legacyworlds-server-data/db-structure/db-config.txt $TEMPDIR/legacyworlds/sql/db-config-example.txt
cp -Rapv legacyworlds-server/legacyworlds-server-data/db-structure/parts $TEMPDIR/legacyworlds/sql
cp -Rapv legacyworlds-server/legacyworlds-server-main/data/* $TEMPDIR/legacyworlds/server/data
# Server
cp -Rapv legacyworlds-server/legacyworlds-server-main/target/*.jar $TEMPDIR/legacyworlds/server
cp -Rapv legacyworlds-server/legacyworlds-server-main/target/lib $TEMPDIR/legacyworlds/server
cp -Rapv legacyworlds-server/legacyworlds-server-main/data-source.xml $TEMPDIR/legacyworlds/server/data-source-example.xml
# Tools
cp -Rapv build-tools/server-config-example.sh $TEMPDIR/legacyworlds
cp -Rapv build-tools/start-server.sh $TEMPDIR/legacyworlds
cp -Rapv build-tools/stop-server.sh $TEMPDIR/legacyworlds
cp -Rapv build-tools/execute-clit.sh $TEMPDIR/legacyworlds
cp -Rapv build-tools/deploy.sh $TEMPDIR/legacyworlds
# Web sites
cp -Rapv legacyworlds-web/legacyworlds-web-*/target/*.war $TEMPDIR/legacyworlds/web
echo "Preparing archive..."
cd $TEMPDIR
find $TEMPDIR/legacyworlds -type d -name .svn | xargs rm -rf
tar cvjf $OUTDIR/legacyworlds.tar.bz2 legacyworlds || { echo "Archive generation failed"; exit 1; };
echo "Removing temporary directory..."
cd $SRCDIR
rm -rf $TEMPDIR
echo "All done. Legacy Worlds archive: $OUTDIR/legacyworlds.tar.bz2"