scripts/alt2xml.sh
author František Kučera <franta-hg@frantovo.cz>
Sat, 06 Sep 2014 17:19:21 +0200
changeset 76 56b731d14aec
parent 54 3d5cc308e268
child 103 5e22fa13e016
permissions -rwxr-xr-x
in-ini: skeleton
     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 INPUT_PLUGINS=(
    12 	"$DIR/java/alt2xml-in-properties/dist/alt2xml-in-properties.jar"
    13 	"$DIR/java/alt2xml-in-ini/dist/alt2xml-in-ini.jar"
    14 	
    15 	"$DIR/java/alt2xml-in-json/dist/alt2xml-in-json.jar"
    16 	"$DIR/../temp/lib/json_simple-1.1.jar"
    17 );
    18 
    19 OUTPUT_PLUGINS=(
    20 	"$DIR/java/alt2xml-out-xml/dist/alt2xml-out-xml.jar"
    21 	"$DIR/java/alt2xml-out-xpath/dist/alt2xml-out-xpath.jar"
    22 	"$DIR/java/alt2xml-out-xslt/dist/alt2xml-out-xslt.jar"
    23 );
    24 
    25 for e in "${STANDARD_JARS[@]}" "${INPUT_PLUGINS[@]}" "${OUTPUT_PLUGINS[@]}"; do
    26 	CLASS_PATH="$CLASS_PATH:$e";
    27 done
    28 
    29 MAIN_CLASS="cz.frantovo.alt2xml.cli.CLIStarter";
    30 
    31 SAX_PARSER_FACTORY_ALT="cz.frantovo.alt2xml.ParserFactory";                             # our alternative ParserFactory as default
    32 SAX_PARSER_FACTORY_XML="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";  # former default factory as fallback 
    33 
    34 java \
    35 	-cp "$CLASS_PATH" \
    36 	-D"javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_ALT" \
    37 	-D"cz.frantovo.alt2xml.fallback.javax.xml.parsers.SAXParserFactory=$SAX_PARSER_FACTORY_XML" \
    38 	$MAIN_CLASS \
    39 	"$@"
    40