diff --git a/bin/console-client/openiec61850-console-client b/bin/console-client/openiec61850-console-client deleted file mode 100755 index b7830db..0000000 --- a/bin/console-client/openiec61850-console-client +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -JARS_LOCATION="../../build/libs-all" -MAIN_CLASS="com.beanit.openiec61850.app.ConsoleClient" -SYSPROPS="" -PARAMS="" - -SCRIPT_HOME=`dirname $0` - -CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") - -for i in $@; do - if [[ $i == -D* ]]; then - SYSPROPS="$SYSPROPS $i"; - else - PARAMS="$PARAMS $i"; - fi -done - -java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS diff --git a/bin/console-server/logback.xml b/bin/logback.xml similarity index 100% rename from bin/console-server/logback.xml rename to bin/logback.xml diff --git a/bin/openiec61850-console-client b/bin/openiec61850-console-client new file mode 100755 index 0000000..8181d7e --- /dev/null +++ b/bin/openiec61850-console-client @@ -0,0 +1,36 @@ +#!/bin/bash + +JARS_LOCATION="build/libs-all" +MAIN_CLASS="com.beanit.openiec61850.app.ConsoleClient" +SYSPROPS="" +PARAMS="" + +# Attempt to set APP_HOME (from Gradle start script) +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/.." >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$(JARS=("$APP_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") + +for i in $@; do + if [[ $i == -D* ]]; then + SYSPROPS="$SYSPROPS $i"; + else + PARAMS="$PARAMS $i"; + fi +done + +java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS diff --git a/bin/console-client/openiec61850-console-client.bat b/bin/openiec61850-console-client.bat similarity index 75% rename from bin/console-client/openiec61850-console-client.bat rename to bin/openiec61850-console-client.bat index d9d91cd..cb54f7e 100644 --- a/bin/console-client/openiec61850-console-client.bat +++ b/bin/openiec61850-console-client.bat @@ -1,6 +1,6 @@ ::BATCH file for windows set BATDIR=%~dp0 -set LIBDIR=%BATDIR%..\..\build\libs-all +set LIBDIR=%BATDIR%..\build\libs-all java -Djava.ext.dirs=%LIBDIR% com.beanit.openiec61850.app.ConsoleClient %* diff --git a/bin/console-server/openiec61850-console-server b/bin/openiec61850-console-server similarity index 72% rename from bin/console-server/openiec61850-console-server rename to bin/openiec61850-console-server index 8191dde..3fa4b99 100755 --- a/bin/console-server/openiec61850-console-server +++ b/bin/openiec61850-console-server @@ -1,11 +1,10 @@ #!/bin/bash -JARS_LOCATION="../../build/libs-all" +JARS_LOCATION="build/libs-all" MAIN_CLASS="com.beanit.openiec61850.app.ConsoleServer" SYSPROPS="-Dlogback.configurationFile=logback.xml" -# from gradle start script: -# Attempt to set SCRIPT_HOME +# Attempt to set APP_HOME (from Gradle start script) # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. @@ -19,12 +18,11 @@ while [ -h "$PRG" ] ; do fi done SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -SCRIPT_HOME="`pwd -P`" +cd "`dirname \"$PRG\"`/.." >/dev/null +APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null - -CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") +CLASSPATH=$(JARS=("$APP_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") for i in $@; do if [[ $i == -D* ]]; then diff --git a/bin/console-server/openiec61850-console-server.bat b/bin/openiec61850-console-server.bat similarity index 79% rename from bin/console-server/openiec61850-console-server.bat rename to bin/openiec61850-console-server.bat index 2cbdccc..3cedb3f 100644 --- a/bin/console-server/openiec61850-console-server.bat +++ b/bin/openiec61850-console-server.bat @@ -1,6 +1,6 @@ ::BATCH file to windows set BATDIR=%~dp0 -set LIBDIR=%BATDIR%..\..\build\libs-all +set LIBDIR=%BATDIR%..\build\libs-all java -Dlogback.configurationFile=logback.xml -Djava.ext.dirs=%LIBDIR% com.beanit.openiec61850.app.ConsoleServer %* diff --git a/bin/gui-client/openiec61850-gui-client b/bin/openiec61850-gui-client similarity index 71% rename from bin/gui-client/openiec61850-gui-client rename to bin/openiec61850-gui-client index 5a5c35a..b4ccec7 100755 --- a/bin/gui-client/openiec61850-gui-client +++ b/bin/openiec61850-gui-client @@ -1,12 +1,11 @@ #!/bin/bash -JARS_LOCATION="../../build/libs-all" +JARS_LOCATION="build/libs-all" MAIN_CLASS="com.beanit.openiec61850.clientgui.ClientGui" SYSPROPS="" PARAMS="" -# from gradle start script: -# Attempt to set SCRIPT_HOME +# Attempt to set APP_HOME (from Gradle start script) # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. @@ -20,12 +19,11 @@ while [ -h "$PRG" ] ; do fi done SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -SCRIPT_HOME="`pwd -P`" +cd "`dirname \"$PRG\"`/.." >/dev/null +APP_HOME="`pwd -P`" cd "$SAVED" >/dev/null - -CLASSPATH=$(JARS=("$SCRIPT_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") +CLASSPATH=$(JARS=("$APP_HOME"/"$JARS_LOCATION"/*.jar); IFS=:; echo "${JARS[*]}") for i in $@; do if [[ $i == -D* ]]; then @@ -36,4 +34,3 @@ for i in $@; do done java $SYSPROPS -cp $CLASSPATH $MAIN_CLASS $PARAMS - diff --git a/bin/gui-client/openiec61850-gui-client.bat b/bin/openiec61850-gui-client.bat similarity index 75% rename from bin/gui-client/openiec61850-gui-client.bat rename to bin/openiec61850-gui-client.bat index acb394e..bdb433d 100644 --- a/bin/gui-client/openiec61850-gui-client.bat +++ b/bin/openiec61850-gui-client.bat @@ -1,6 +1,6 @@ ::BATCH file to windows set BATDIR=%~dp0 -set LIBDIR=%BATDIR%..\..\build\libs-all +set LIBDIR=%BATDIR%..\build\libs-all java -Djava.ext.dirs=%LIBDIR% com.beanit.openiec61850.clientgui.ClientGui %* diff --git a/bin/console-server/sample-model.icd b/bin/sample-model.icd similarity index 100% rename from bin/console-server/sample-model.icd rename to bin/sample-model.icd