1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/build.sh Wed Jul 10 23:49:36 2013 +0200
1.3 @@ -0,0 +1,50 @@
1.4 +#!/bin/bash
1.5 +
1.6 +# Free Telco Dictionary
1.7 +# Copyright © 2013 František Kučera (frantovo.cz)
1.8 +#
1.9 +# This program is free software: you can redistribute it and/or modify
1.10 +# it under the terms of the GNU General Public License as published by
1.11 +# the Free Software Foundation, either version 3 of the License, or
1.12 +# (at your option) any later version.
1.13 +#
1.14 +# This program is distributed in the hope that it will be useful,
1.15 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1.16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.17 +# GNU General Public License for more details.
1.18 +#
1.19 +# You should have received a copy of the GNU General Public License
1.20 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
1.21 +
1.22 +
1.23 +# Script for generating deliverables:
1.24 +# packed dictionary data in StarDict format
1.25 +
1.26 +
1.27 +JAR="dist/dictionary-generator.jar"
1.28 +GENERATOR_DIR="java/dictionary-generator"
1.29 +WORK_DIR="free-telco-dictionary"
1.30 +
1.31 +function package() {
1.32 + DELIVERY_DIR="../../delivery"
1.33 + rm -rf $DELIVERY_DIR/$WORK_DIR
1.34 + java -jar $JAR $1
1.35 + pushd $DELIVERY_DIR
1.36 + (echo -n "Mercurial: "; hg identify || echo "n/a"; echo -n "Generated: "; date --rfc-3339=seconds) > $WORK_DIR/version.txt
1.37 + tar czf $2.tar.gz $WORK_DIR
1.38 + popd
1.39 +}
1.40 +
1.41 +pushd `dirname $0`/$GENERATOR_DIR
1.42 +
1.43 +# build the generator if needed
1.44 +if [ ! -f $JAR ]; then
1.45 + ant;
1.46 +fi
1.47 +
1.48 +# generate packages in multiple formats
1.49 +package m free-telco-dictionary.text # plain text
1.50 +package h free-telco-dictionary.xhtml # rich text
1.51 +
1.52 +popd
1.53 +