build script
authorFrantišek Kučera <franta-hg@frantovo.cz>
Wed, 10 Jul 2013 23:49:36 +0200
changeset 23f29d2ac58ed6
parent 22 e003e66c9752
child 24 8d8a54855514
build script
.hgignore
build.sh
java/dictionary-generator/concept.h.xsl
java/dictionary-generator/src/cz/frantovo/telco/dictionary/Generator.java
     1.1 --- a/.hgignore	Wed Jul 10 23:49:20 2013 +0200
     1.2 +++ b/.hgignore	Wed Jul 10 23:49:36 2013 +0200
     1.3 @@ -1,3 +1,6 @@
     1.4 +syntax: glob
     1.5 +
     1.6 +*~
     1.7  temp/*
     1.8  delivery/*
     1.9  data/schemas.xml
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/build.sh	Wed Jul 10 23:49:36 2013 +0200
     2.3 @@ -0,0 +1,50 @@
     2.4 +#!/bin/bash
     2.5 +
     2.6 +# Free Telco Dictionary
     2.7 +# Copyright © 2013 František Kučera (frantovo.cz)
     2.8 +# 
     2.9 +# This program is free software: you can redistribute it and/or modify
    2.10 +# it under the terms of the GNU General Public License as published by
    2.11 +# the Free Software Foundation, either version 3 of the License, or
    2.12 +# (at your option) any later version.
    2.13 +#
    2.14 +# This program is distributed in the hope that it will be useful,
    2.15 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.17 +# GNU General Public License for more details.
    2.18 +#
    2.19 +# You should have received a copy of the GNU General Public License
    2.20 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2.21 +
    2.22 +
    2.23 +# Script for generating deliverables:
    2.24 +# packed dictionary data in StarDict format
    2.25 +
    2.26 +
    2.27 +JAR="dist/dictionary-generator.jar"
    2.28 +GENERATOR_DIR="java/dictionary-generator"
    2.29 +WORK_DIR="free-telco-dictionary"
    2.30 +
    2.31 +function package() {
    2.32 +    DELIVERY_DIR="../../delivery"
    2.33 +    rm -rf $DELIVERY_DIR/$WORK_DIR
    2.34 +    java -jar $JAR $1
    2.35 +    pushd $DELIVERY_DIR
    2.36 +    (echo -n "Mercurial: "; hg identify || echo "n/a"; echo -n "Generated: "; date --rfc-3339=seconds) > $WORK_DIR/version.txt
    2.37 +    tar czf $2.tar.gz $WORK_DIR
    2.38 +    popd
    2.39 +}
    2.40 +
    2.41 +pushd `dirname $0`/$GENERATOR_DIR
    2.42 +
    2.43 +# build the generator if needed
    2.44 +if [ ! -f $JAR ]; then
    2.45 +    ant;
    2.46 +fi
    2.47 +
    2.48 +# generate packages in multiple formats
    2.49 +package m free-telco-dictionary.text  # plain text
    2.50 +package h free-telco-dictionary.xhtml # rich text
    2.51 +
    2.52 +popd
    2.53 +
     3.1 --- a/java/dictionary-generator/concept.h.xsl	Wed Jul 10 23:49:20 2013 +0200
     3.2 +++ b/java/dictionary-generator/concept.h.xsl	Wed Jul 10 23:49:36 2013 +0200
     3.3 @@ -43,7 +43,7 @@
     3.4  				font-size: 80%;
     3.5  			}
     3.6  			</style>
     3.7 -			<table style="color: red;">
     3.8 +			<table>
     3.9  				<tbody>
    3.10  					<xsl:for-each select="d:term">
    3.11  						<tr>
     4.1 --- a/java/dictionary-generator/src/cz/frantovo/telco/dictionary/Generator.java	Wed Jul 10 23:49:20 2013 +0200
     4.2 +++ b/java/dictionary-generator/src/cz/frantovo/telco/dictionary/Generator.java	Wed Jul 10 23:49:36 2013 +0200
     4.3 @@ -205,7 +205,7 @@
     4.4  
     4.5  	public static void main(String[] args) {
     4.6  		File outputFolder = new File("../../delivery/free-telco-dictionary");
     4.7 -		outputFolder.mkdir();
     4.8 +		outputFolder.mkdirs();
     4.9  
    4.10  		try {
    4.11  			Generator g = new Generator(parseMode(args));