diff -r e003e66c9752 -r f29d2ac58ed6 build.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build.sh Wed Jul 10 23:49:36 2013 +0200 @@ -0,0 +1,50 @@ +#!/bin/bash + +# Free Telco Dictionary +# Copyright © 2013 František Kučera (frantovo.cz) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# Script for generating deliverables: +# packed dictionary data in StarDict format + + +JAR="dist/dictionary-generator.jar" +GENERATOR_DIR="java/dictionary-generator" +WORK_DIR="free-telco-dictionary" + +function package() { + DELIVERY_DIR="../../delivery" + rm -rf $DELIVERY_DIR/$WORK_DIR + java -jar $JAR $1 + pushd $DELIVERY_DIR + (echo -n "Mercurial: "; hg identify || echo "n/a"; echo -n "Generated: "; date --rfc-3339=seconds) > $WORK_DIR/version.txt + tar czf $2.tar.gz $WORK_DIR + popd +} + +pushd `dirname $0`/$GENERATOR_DIR + +# build the generator if needed +if [ ! -f $JAR ]; then + ant; +fi + +# generate packages in multiple formats +package m free-telco-dictionary.text # plain text +package h free-telco-dictionary.xhtml # rich text + +popd +