#!/bin/bash
export TEST_NAME=dwg2pdf
SYS_NAME=`uname`
if [ "$SYS_NAME" = "Darwin" ]; then
for dwglib in $(ls ${DWG_ENGINE_PATH})
do
    if [ -f "/usr/local/lib/${dwglib}" ]; then
        rm /usr/local/lib/${dwglib}
    fi
	ln -s ${DWG_ENGINE_PATH}/${dwglib} /usr/local/lib/${dwglib}
done
fi
javac -cp .:../../../lib/fsdk.jar *.java
java -Djava.library.path=../../../lib -classpath .:../../../lib/fsdk.jar ${TEST_NAME}

if [ "$SYS_NAME" = "Darwin" ]; then
for dwglib in $(ls ${DWG_ENGINE_PATH})
do
    if [ -f "/usr/local/lib/${dwglib}" ]; then
	    rm /usr/local/lib/${dwglib}
    fi
done
fi
