view scripts/build-luan.sh @ 746:293c397e8dee

improve zip
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 14 Jul 2016 19:36:02 -0600
parents 4ce68aad92b7
children 3e30cf310e56
line wrap: on
line source

set -e

cd `dirname $0`/..
LUAN_HOME=`pwd`
LUAN_BUILD=$LUAN_HOME/build
SLF4J=$LUAN_HOME/logging/ext/slf4j-api-1.6.4.jar

VERSION=`scripts/version.sh`

rm -rf $LUAN_BUILD
mkdir $LUAN_BUILD
mkdir $LUAN_BUILD/luan
mkdir $LUAN_BUILD/luan/jars

cd $LUAN_HOME
echo "return 'Luan $VERSION'" >core/src/luan/version.luan
find . -name *.class -delete

cd $LUAN_HOME
SRC=core/src
CLASSPATH=$LUAN_HOME/$SRC
javac -classpath $CLASSPATH `find $SRC -name *.java`
cd $SRC
jar cvf $LUAN_BUILD/luan/jars/luan-$VERSION.jar `find . -name *.class -o -name *.luan`

cd $LUAN_HOME
SRC=http/src
CLASSPATH=$LUAN_HOME/core/src:$LUAN_HOME/$SRC:$SLF4J
for i in $LUAN_HOME/http/ext/* ; do CLASSPATH=$CLASSPATH:$i ; done
javac -classpath $CLASSPATH `find $SRC -name *.java`
cd $SRC
jar uvf $LUAN_BUILD/luan/jars/luan-$VERSION.jar `find . -name *.class -o -name *.luan`
cp $LUAN_HOME/http/ext/* $LUAN_BUILD/luan/jars

cd $LUAN_HOME
SRC=logging/src
CLASSPATH=$LUAN_HOME/core/src:$LUAN_HOME/$SRC
for i in $LUAN_HOME/logging/ext/* ; do CLASSPATH=$CLASSPATH:$i ; done
javac -classpath $CLASSPATH `find $SRC -name *.java`
cd $SRC
jar uvf $LUAN_BUILD/luan/jars/luan-$VERSION.jar `find . -name *.class -o -name *.luan`
cp $LUAN_HOME/logging/ext/* $LUAN_BUILD/luan/jars

cd $LUAN_HOME
SRC=mail/src
CLASSPATH=$LUAN_HOME/core/src:$LUAN_HOME/$SRC
for i in $LUAN_HOME/mail/ext/* ; do CLASSPATH=$CLASSPATH:$i ; done
javac -classpath $CLASSPATH `find $SRC -name *.java`
cd $SRC
jar uvf $LUAN_BUILD/luan/jars/luan-$VERSION.jar `find . -name *.class -o -name *.luan`
cp $LUAN_HOME/mail/ext/* $LUAN_BUILD/luan/jars

cd $LUAN_HOME
SRC=lucene/src
CLASSPATH=$LUAN_HOME/core/src:$LUAN_HOME/$SRC:$SLF4J
for i in $LUAN_HOME/lucene/ext/* ; do CLASSPATH=$CLASSPATH:$i ; done
javac -classpath $CLASSPATH `find $SRC -name *.java`
cd $SRC
jar uvf $LUAN_BUILD/luan/jars/luan-$VERSION.jar `find . -name *.class -o -name *.luan`
cp $LUAN_HOME/lucene/ext/* $LUAN_BUILD/luan/jars

cp $LUAN_HOME/scripts/install.sh $LUAN_BUILD/luan
chmod +x $LUAN_BUILD/luan/install.sh
cp $LUAN_HOME/scripts/uninstall.sh $LUAN_BUILD/luan

cd $LUAN_BUILD
tar -cf luan-$VERSION.tar luan

luan/install.sh

echo done