From: gyeongseok.seo Date: Thu, 12 Jul 2012 06:27:20 +0000 (+0900) Subject: [Title] Added command script (window and linux) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70e7de9846546b67f63a757ba6f91c5f68c5ba40;p=sdk%2Ftools%2Fcli.git [Title] Added command script (window and linux) [Type] Enhancement [Module] cli [Priority] Minor [Jira#] [Redmine#] 5363 [Problem] [Cause] [Solution] [TestCase] Change-Id: I92d1fb74176ee15d92e24feaa75b6725cc05ac36 --- diff --git a/org.tizen.cli/doc/install/bin_/debug b/org.tizen.cli/doc/install/bin_/debug new file mode 100644 index 0000000..ebc2645 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/debug @@ -0,0 +1,65 @@ +#!/bin/sh + +MAIN=org.tizen.cli.exec.debug.Main + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +DIR_BIN=`dirname $SCRIPT` +DIR_HOME=$DIR_BIN/.. +DIR_LIB=$DIR_HOME/lib +DIR_CONFIG=$DIR_HOME/conf + +JARS=`find $DIR_LIB -name "*.jar"` + +JAR="" +for JAR_FILE in $JARS; do + JAR=$JAR:$JAR_FILE +done + +CLASSPATH=$DIR_CONFIG:$JAR + +OPT_LOGGING="-Dlog4j.configuration=log4j.xml" +OPT_PRG_NAME="-Dcli.name=$SCRIPT" + +READ_ARG="n" + +OPT_TRACE= + +for WORD in $@; do + if [ "y" = "$READ_ARG" ] + then + OPT_LOGGING="-Dlog4j.configuration=log4j-${WORD}.xml" + if [ "$WORD" = "trace" ] + then + OPT_TRACE="-Dlog4j.debug=true" + fi + READ_ARG="n" + fi + case $WORD in + "--log" | "-l" ) + READ_ARG="y" + ;; + esac +done + +OPT="$OPT_TRACE $OPT_LOGGING $OPT_PRG_NAME" + +EXEC="java -cp $CLASSPATH $OPT $MAIN $@" + +if [ -n "$OPT_TRACE" ] +then + echo "Command :$EXEC" +fi + +$EXEC diff --git a/org.tizen.cli/doc/install/bin_/debug.bat b/org.tizen.cli/doc/install/bin_/debug.bat new file mode 100644 index 0000000..15466d0 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/debug.bat @@ -0,0 +1,45 @@ +@echo off +set SCRIPT=%0 + +:: delims is a TAB followed by a space +set KEY=TIZEN_SDK_INSTALLED_PATH +FOR /f "tokens=1,2 delims==" %%i IN (%localappdata%\.TizenSDK\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\SDK\dev_tools +set MAIN=org.tizen.cli.exec.debug.Main + +set OPT_TRACE= +set OPT_LOGGING=-Dlog4j.configuration=log4j.xml +set OPT_PRG_NAME=-Dcli.name=%SCRIPT% + +set READ_ARG=n + +FOR %%W IN ( %* ) DO ( call:parseArg %%W ) + +set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% +set EXEC=java -cp %CLI_HOME%\conf -Djava.ext.dirs=%CLI_HOME%\lib %OPT% %MAIN% %* + +IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% ) + +%EXEC% +goto:eof + +:parseArg + IF y == %READ_ARG% goto SET_LOGGING + +:SECOND_STEP + IF %~1 == --log goto SET_READY + IF %~1 == -l goto SET_READY +:END_STEP +goto:eof + +:SET_LOGGING + set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml + IF %~1 == trace set OPT_TRACE=-Dlog4j.debug=true + set READ_ARG=n + + goto SECOND_STEP + +:SET_READY + set READ_ARG=y + goto END_STEP + diff --git a/org.tizen.cli/doc/install/bin_/install b/org.tizen.cli/doc/install/bin_/install new file mode 100644 index 0000000..4939e32 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/install @@ -0,0 +1,65 @@ +#!/bin/sh + +MAIN=org.tizen.cli.exec.install.Main + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +DIR_BIN=`dirname $SCRIPT` +DIR_HOME=$DIR_BIN/.. +DIR_LIB=$DIR_HOME/lib +DIR_CONFIG=$DIR_HOME/conf + +JARS=`find $DIR_LIB -name "*.jar"` + +JAR="" +for JAR_FILE in $JARS; do + JAR=$JAR:$JAR_FILE +done + +CLASSPATH=$DIR_CONFIG:$JAR + +OPT_LOGGING="-Dlog4j.configuration=log4j.xml" +OPT_PRG_NAME="-Dcli.name=$SCRIPT" + +READ_ARG="n" + +OPT_TRACE= + +for WORD in $@; do + if [ "y" = "$READ_ARG" ] + then + OPT_LOGGING="-Dlog4j.configuration=log4j-${WORD}.xml" + if [ "$WORD" = "trace" ] + then + OPT_TRACE="-Dlog4j.debug=true" + fi + READ_ARG="n" + fi + case $WORD in + "--log" | "-l" ) + READ_ARG="y" + ;; + esac +done + +OPT="$OPT_TRACE $OPT_LOGGING $OPT_PRG_NAME" + +EXEC="java -cp $CLASSPATH $OPT $MAIN $@" + +if [ -n "$OPT_TRACE" ] +then + echo "Command :$EXEC" +fi + +$EXEC diff --git a/org.tizen.cli/doc/install/bin_/install.bat b/org.tizen.cli/doc/install/bin_/install.bat new file mode 100644 index 0000000..c600b21 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/install.bat @@ -0,0 +1,45 @@ +@echo off +set SCRIPT=%0 + +:: delims is a TAB followed by a space +set KEY=TIZEN_SDK_INSTALLED_PATH +FOR /f "tokens=1,2 delims==" %%i IN (%localappdata%\.TizenSDK\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\SDK\dev_tools +set MAIN=org.tizen.cli.exec.install.Main + +set OPT_TRACE= +set OPT_LOGGING=-Dlog4j.configuration=log4j.xml +set OPT_PRG_NAME=-Dcli.name=%SCRIPT% + +set READ_ARG=n + +FOR %%W IN ( %* ) DO ( call:parseArg %%W ) + +set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% +set EXEC=java -cp %CLI_HOME%\conf -Djava.ext.dirs=%CLI_HOME%\lib %OPT% %MAIN% %* + +IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% ) + +%EXEC% +goto:eof + +:parseArg + IF y == %READ_ARG% goto SET_LOGGING + +:SECOND_STEP + IF %~1 == --log goto SET_READY + IF %~1 == -l goto SET_READY +:END_STEP +goto:eof + +:SET_LOGGING + set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml + IF %~1 == trace set OPT_TRACE=-Dlog4j.debug=true + set READ_ARG=n + + goto SECOND_STEP + +:SET_READY + set READ_ARG=y + goto END_STEP + diff --git a/org.tizen.cli/doc/install/bin_/query b/org.tizen.cli/doc/install/bin_/query new file mode 100755 index 0000000..6f16928 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/query @@ -0,0 +1,65 @@ +#!/bin/sh + +MAIN=org.tizen.cli.exec.query.Main + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +DIR_BIN=`dirname $SCRIPT` +DIR_HOME=$DIR_BIN/.. +DIR_LIB=$DIR_HOME/lib +DIR_CONFIG=$DIR_HOME/conf + +JARS=`find $DIR_LIB -name "*.jar"` + +JAR="" +for JAR_FILE in $JARS; do + JAR=$JAR:$JAR_FILE +done + +CLASSPATH=$DIR_CONFIG:$JAR + +OPT_LOGGING="-Dlog4j.configuration=log4j.xml" +OPT_PRG_NAME="-Dcli.name=$SCRIPT" + +READ_ARG="n" + +OPT_TRACE= + +for WORD in $@; do + if [ "y" = "$READ_ARG" ] + then + OPT_LOGGING="-Dlog4j.configuration=log4j-${WORD}.xml" + if [ "$WORD" = "trace" ] + then + OPT_TRACE="-Dlog4j.debug=true" + fi + READ_ARG="n" + fi + case $WORD in + "--log" | "-l" ) + READ_ARG="y" + ;; + esac +done + +OPT="$OPT_TRACE $OPT_LOGGING $OPT_PRG_NAME" + +EXEC="java -cp $CLASSPATH $OPT $MAIN $@" + +if [ -n "$OPT_TRACE" ] +then + echo "Command :$EXEC" +fi + +$EXEC diff --git a/org.tizen.cli/doc/install/bin_/query.bat b/org.tizen.cli/doc/install/bin_/query.bat new file mode 100644 index 0000000..c2ba7b5 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/query.bat @@ -0,0 +1,45 @@ +@echo off +set SCRIPT=%0 + +:: delims is a TAB followed by a space +set KEY=TIZEN_SDK_INSTALLED_PATH +FOR /f "tokens=1,2 delims==" %%i IN (%localappdata%\.TizenSDK\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\SDK\dev_tools +set MAIN=org.tizen.cli.exec.query.Main + +set OPT_TRACE= +set OPT_LOGGING=-Dlog4j.configuration=log4j.xml +set OPT_PRG_NAME=-Dcli.name=%SCRIPT% + +set READ_ARG=n + +FOR %%W IN ( %* ) DO ( call:parseArg %%W ) + +set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% +set EXEC=java -cp %CLI_HOME%\conf -Djava.ext.dirs=%CLI_HOME%\lib %OPT% %MAIN% %* + +IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% ) + +%EXEC% +goto:eof + +:parseArg + IF y == %READ_ARG% goto SET_LOGGING + +:SECOND_STEP + IF %~1 == --log goto SET_READY + IF %~1 == -l goto SET_READY +:END_STEP +goto:eof + +:SET_LOGGING + set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml + IF %~1 == trace set OPT_TRACE=-Dlog4j.debug=true + set READ_ARG=n + + goto SECOND_STEP + +:SET_READY + set READ_ARG=y + goto END_STEP + diff --git a/org.tizen.cli/doc/install/bin_/run b/org.tizen.cli/doc/install/bin_/run new file mode 100644 index 0000000..a76202a --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/run @@ -0,0 +1,65 @@ +#!/bin/sh + +MAIN=org.tizen.cli.exec.run.Main + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +DIR_BIN=`dirname $SCRIPT` +DIR_HOME=$DIR_BIN/.. +DIR_LIB=$DIR_HOME/lib +DIR_CONFIG=$DIR_HOME/conf + +JARS=`find $DIR_LIB -name "*.jar"` + +JAR="" +for JAR_FILE in $JARS; do + JAR=$JAR:$JAR_FILE +done + +CLASSPATH=$DIR_CONFIG:$JAR + +OPT_LOGGING="-Dlog4j.configuration=log4j.xml" +OPT_PRG_NAME="-Dcli.name=$SCRIPT" + +READ_ARG="n" + +OPT_TRACE= + +for WORD in $@; do + if [ "y" = "$READ_ARG" ] + then + OPT_LOGGING="-Dlog4j.configuration=log4j-${WORD}.xml" + if [ "$WORD" = "trace" ] + then + OPT_TRACE="-Dlog4j.debug=true" + fi + READ_ARG="n" + fi + case $WORD in + "--log" | "-l" ) + READ_ARG="y" + ;; + esac +done + +OPT="$OPT_TRACE $OPT_LOGGING $OPT_PRG_NAME" + +EXEC="java -cp $CLASSPATH $OPT $MAIN $@" + +if [ -n "$OPT_TRACE" ] +then + echo "Command :$EXEC" +fi + +$EXEC diff --git a/org.tizen.cli/doc/install/bin_/run.bat b/org.tizen.cli/doc/install/bin_/run.bat new file mode 100644 index 0000000..9751380 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/run.bat @@ -0,0 +1,45 @@ +@echo off +set SCRIPT=%0 + +:: delims is a TAB followed by a space +set KEY=TIZEN_SDK_INSTALLED_PATH +FOR /f "tokens=1,2 delims==" %%i IN (%localappdata%\.TizenSDK\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\SDK\dev_tools +set MAIN=org.tizen.cli.exec.run.Main + +set OPT_TRACE= +set OPT_LOGGING=-Dlog4j.configuration=log4j.xml +set OPT_PRG_NAME=-Dcli.name=%SCRIPT% + +set READ_ARG=n + +FOR %%W IN ( %* ) DO ( call:parseArg %%W ) + +set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% +set EXEC=java -cp %CLI_HOME%\conf -Djava.ext.dirs=%CLI_HOME%\lib %OPT% %MAIN% %* + +IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% ) + +%EXEC% +goto:eof + +:parseArg + IF y == %READ_ARG% goto SET_LOGGING + +:SECOND_STEP + IF %~1 == --log goto SET_READY + IF %~1 == -l goto SET_READY +:END_STEP +goto:eof + +:SET_LOGGING + set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml + IF %~1 == trace set OPT_TRACE=-Dlog4j.debug=true + set READ_ARG=n + + goto SECOND_STEP + +:SET_READY + set READ_ARG=y + goto END_STEP + diff --git a/org.tizen.cli/doc/install/bin_/uninstall b/org.tizen.cli/doc/install/bin_/uninstall new file mode 100644 index 0000000..9644f74 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/uninstall @@ -0,0 +1,65 @@ +#!/bin/sh + +MAIN=org.tizen.cli.exec.uninstall.Main + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +DIR_BIN=`dirname $SCRIPT` +DIR_HOME=$DIR_BIN/.. +DIR_LIB=$DIR_HOME/lib +DIR_CONFIG=$DIR_HOME/conf + +JARS=`find $DIR_LIB -name "*.jar"` + +JAR="" +for JAR_FILE in $JARS; do + JAR=$JAR:$JAR_FILE +done + +CLASSPATH=$DIR_CONFIG:$JAR + +OPT_LOGGING="-Dlog4j.configuration=log4j.xml" +OPT_PRG_NAME="-Dcli.name=$SCRIPT" + +READ_ARG="n" + +OPT_TRACE= + +for WORD in $@; do + if [ "y" = "$READ_ARG" ] + then + OPT_LOGGING="-Dlog4j.configuration=log4j-${WORD}.xml" + if [ "$WORD" = "trace" ] + then + OPT_TRACE="-Dlog4j.debug=true" + fi + READ_ARG="n" + fi + case $WORD in + "--log" | "-l" ) + READ_ARG="y" + ;; + esac +done + +OPT="$OPT_TRACE $OPT_LOGGING $OPT_PRG_NAME" + +EXEC="java -cp $CLASSPATH $OPT $MAIN $@" + +if [ -n "$OPT_TRACE" ] +then + echo "Command :$EXEC" +fi + +$EXEC diff --git a/org.tizen.cli/doc/install/bin_/uninstall.bat b/org.tizen.cli/doc/install/bin_/uninstall.bat new file mode 100644 index 0000000..7410b14 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/uninstall.bat @@ -0,0 +1,45 @@ +@echo off +set SCRIPT=%0 + +:: delims is a TAB followed by a space +set KEY=TIZEN_SDK_INSTALLED_PATH +FOR /f "tokens=1,2 delims==" %%i IN (%localappdata%\.TizenSDK\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\SDK\dev_tools +set MAIN=org.tizen.cli.exec.uninstall.Main + +set OPT_TRACE= +set OPT_LOGGING=-Dlog4j.configuration=log4j.xml +set OPT_PRG_NAME=-Dcli.name=%SCRIPT% + +set READ_ARG=n + +FOR %%W IN ( %* ) DO ( call:parseArg %%W ) + +set OPT=%OPT_TRACE% %OPT_LOGGING% %OPT_PRG_NAME% +set EXEC=java -cp %CLI_HOME%\conf -Djava.ext.dirs=%CLI_HOME%\lib %OPT% %MAIN% %* + +IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% ) + +%EXEC% +goto:eof + +:parseArg + IF y == %READ_ARG% goto SET_LOGGING + +:SECOND_STEP + IF %~1 == --log goto SET_READY + IF %~1 == -l goto SET_READY +:END_STEP +goto:eof + +:SET_LOGGING + set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml + IF %~1 == trace set OPT_TRACE=-Dlog4j.debug=true + set READ_ARG=n + + goto SECOND_STEP + +:SET_READY + set READ_ARG=y + goto END_STEP +