scripts/alt2xml.sh
author František Kučera <franta-hg@frantovo.cz>
Sat, 14 Jun 2014 22:54:26 +0200
changeset 41 efc293b2082c
parent 40 4afb00b7b1a9
child 43 058c1c39251e
permissions -rwxr-xr-x
optimalizace .hgignore – regulární výrazy
     1 #!/bin/bash
     2 
     3 DIR="`dirname $0`/..";
     4 
     5 STANDARD_JARS=(
     6 	"$DIR/java/alt2xml-cli/dist/alt2xml-cli.jar"
     7 	"$DIR/java/alt2xml-lib-input/dist/alt2xml-lib-input.jar"
     8 	"$DIR/java/alt2xml-lib-output/dist/alt2xml-lib-output.jar"
     9 );
    10 
    11 PLUGINS=(
    12 	"$DIR/java/alt2xml-in-properties/dist/alt2xml-in-properties.jar"
    13 	
    14 	"$DIR/java/alt2xml-in-json/dist/alt2xml-in-json.jar"
    15 	"$DIR/../temp/lib/json_simple-1.1.jar"
    16 );
    17 
    18 for e in "${STANDARD_JARS[@]}" "${PLUGINS[@]}"; do
    19 	CLASS_PATH="$CLASS_PATH:$e";
    20 done
    21 
    22 MAIN_CLASS="cz.frantovo.alt2xml.cli.CLI";
    23 
    24 SAX_PARSER_FACTORY_ALT="cz.frantovo.alt2xml.ParserFactory";                             # our alternative ParserFactory as default
    25 SAX_PARSER_FACTORY_XML="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";  # former default factory as fallback 
    26 
    27 java \
    28 	-cp "$CLASS_PATH" \
    29 	-D"javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_ALT" \
    30 	-D"cz.frantovo.alt2xml.fallback.javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_XML" \
    31 	$MAIN_CLASS \
    32 	"$@"
    33