From 6b9f793ac526e9178da191af292a5e82fa7f9f54 Mon Sep 17 00:00:00 2001 From: "gyeongseok.seo" Date: Tue, 24 Jul 2012 19:52:24 +0900 Subject: [PATCH] [Title] Added dos cli script and Fixed script bug [Type] Enhancement [Module] cli [Priority] Major [Jira#] [Redmine#] 5831 [Problem] [Cause] [Solution] [TestCase] Change-Id: I9680b4ebc2c06c4ff8c9ebbd1d3a516ebeaa9d31 --- org.tizen.cli/doc/install/bin_/web-debug.bat | 16 ++- org.tizen.cli/doc/install/bin_/web-install.bat | 17 ++- org.tizen.cli/doc/install/bin_/web-packaging.bat | 31 +++-- org.tizen.cli/doc/install/bin_/web-query.bat | 17 ++- org.tizen.cli/doc/install/bin_/web-run.bat | 17 ++- org.tizen.cli/doc/install/bin_/web-signing.bat | 31 +++-- org.tizen.cli/doc/install/bin_/web-uninstall.bat | 17 ++- org.tizen.cli/doc/install/bin_/webtizen.bat | 142 +++++++++++++++++++++++ 8 files changed, 246 insertions(+), 42 deletions(-) create mode 100644 org.tizen.cli/doc/install/bin_/webtizen.bat diff --git a/org.tizen.cli/doc/install/bin_/web-debug.bat b/org.tizen.cli/doc/install/bin_/web-debug.bat index 0ee474d..f2ffb92 100644 --- a/org.tizen.cli/doc/install/bin_/web-debug.bat +++ b/org.tizen.cli/doc/install/bin_/web-debug.bat @@ -4,9 +4,17 @@ set SCRIPT=%0 :: delims is a TAB followed by a space set KEY=TIZEN_SDK_INSTALLED_PATH -for /f "tokens=3* delims= " %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData"') do set sdk_conf_path=%%j -FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) -set CLI_HOME=%SDK_PATH%\SDK\dev_tools +REM find sdk path +set rkey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" +set rval="Local AppData" +FOR /f "tokens=3*" %%a IN ('reg query %rkey% /v %rval%') DO ( + set sdk_conf_path=%%b +) + +REM find cli path +FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO IF %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\tools\ide + set MAIN=org.tizen.cli.exec.debug.Main set OPT_TRACE= @@ -42,6 +50,6 @@ goto:eof goto SECOND_STEP :SET_READY - set READ_ARG=y + set READ_ARG=y goto END_STEP diff --git a/org.tizen.cli/doc/install/bin_/web-install.bat b/org.tizen.cli/doc/install/bin_/web-install.bat index 89aaead..47f6cd2 100644 --- a/org.tizen.cli/doc/install/bin_/web-install.bat +++ b/org.tizen.cli/doc/install/bin_/web-install.bat @@ -3,9 +3,18 @@ set SCRIPT=%0 :: delims is a TAB followed by a space set KEY=TIZEN_SDK_INSTALLED_PATH -for /f "tokens=3* delims= " %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData"') do set sdk_conf_path=%%j -FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) -set CLI_HOME=%SDK_PATH%\SDK\dev_tools + +REM find sdk path +set rkey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" +set rval="Local AppData" +FOR /f "tokens=3*" %%a IN ('reg query %rkey% /v %rval%') DO ( + set sdk_conf_path=%%b +) + +REM find cli path +FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO IF %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\tools\ide + set MAIN=org.tizen.cli.exec.install.Main set OPT_TRACE= @@ -41,6 +50,6 @@ goto:eof goto SECOND_STEP :SET_READY - set READ_ARG=y + set READ_ARG=y goto END_STEP diff --git a/org.tizen.cli/doc/install/bin_/web-packaging.bat b/org.tizen.cli/doc/install/bin_/web-packaging.bat index fae9062..c70ead5 100644 --- a/org.tizen.cli/doc/install/bin_/web-packaging.bat +++ b/org.tizen.cli/doc/install/bin_/web-packaging.bat @@ -3,9 +3,18 @@ set SCRIPT=%0 :: delims is a TAB followed by a space set KEY=TIZEN_SDK_INSTALLED_PATH -for /f "tokens=3* delims= " %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData"') do set sdk_conf_path=%%j -FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) -set CLI_HOME=%SDK_PATH%\SDK\dev_tools + +REM find sdk path +set rkey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" +set rval="Local AppData" +FOR /f "tokens=3*" %%a IN ('reg query %rkey% /v %rval%') DO ( + set sdk_conf_path=%%b +) + +REM find cli path +FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO IF %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\tools\ide + set MAIN=org.tizen.cli.exec.wgt.Main set OPT_TRACE= @@ -28,19 +37,19 @@ goto:eof IF y == %READ_ARG% goto SET_LOGGING :SECOND_STEP - IF %~1 == --log goto SET_READY - IF %~1 == -l goto SET_READY + 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 + set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml + IF %~1 == trace set OPT_TRACE=-Dlog4j.debug=true + set READ_ARG=n - goto SECOND_STEP + goto SECOND_STEP :SET_READY - set READ_ARG=y - goto END_STEP + set READ_ARG=y + goto END_STEP diff --git a/org.tizen.cli/doc/install/bin_/web-query.bat b/org.tizen.cli/doc/install/bin_/web-query.bat index ad85fac..4c06fdc 100644 --- a/org.tizen.cli/doc/install/bin_/web-query.bat +++ b/org.tizen.cli/doc/install/bin_/web-query.bat @@ -3,9 +3,18 @@ set SCRIPT=%0 :: delims is a TAB followed by a space set KEY=TIZEN_SDK_INSTALLED_PATH -for /f "tokens=3* delims= " %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData"') do set sdk_conf_path=%%j -FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) -set CLI_HOME=%SDK_PATH%\SDK\dev_tools + +REM find sdk path +set rkey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" +set rval="Local AppData" +FOR /f "tokens=3*" %%a IN ('reg query %rkey% /v %rval%') DO ( + set sdk_conf_path=%%b +) + +REM find cli path +FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO IF %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\tools\ide + set MAIN=org.tizen.cli.exec.query.Main set OPT_TRACE= @@ -41,6 +50,6 @@ goto:eof goto SECOND_STEP :SET_READY - set READ_ARG=y + set READ_ARG=y goto END_STEP diff --git a/org.tizen.cli/doc/install/bin_/web-run.bat b/org.tizen.cli/doc/install/bin_/web-run.bat index 1e57ebc..ac96493 100644 --- a/org.tizen.cli/doc/install/bin_/web-run.bat +++ b/org.tizen.cli/doc/install/bin_/web-run.bat @@ -3,9 +3,18 @@ set SCRIPT=%0 :: delims is a TAB followed by a space set KEY=TIZEN_SDK_INSTALLED_PATH -for /f "tokens=3* delims= " %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData"') do set sdk_conf_path=%%j -FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) -set CLI_HOME=%SDK_PATH%\SDK\dev_tools + +REM find sdk path +set rkey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" +set rval="Local AppData" +FOR /f "tokens=3*" %%a IN ('reg query %rkey% /v %rval%') DO ( + set sdk_conf_path=%%b +) + +REM find cli path +FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO IF %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\tools\ide + set MAIN=org.tizen.cli.exec.run.Main set OPT_TRACE= @@ -41,6 +50,6 @@ goto:eof goto SECOND_STEP :SET_READY - set READ_ARG=y + set READ_ARG=y goto END_STEP diff --git a/org.tizen.cli/doc/install/bin_/web-signing.bat b/org.tizen.cli/doc/install/bin_/web-signing.bat index 2838382..bdc5541 100644 --- a/org.tizen.cli/doc/install/bin_/web-signing.bat +++ b/org.tizen.cli/doc/install/bin_/web-signing.bat @@ -3,9 +3,18 @@ set SCRIPT=%0 :: delims is a TAB followed by a space set KEY=TIZEN_SDK_INSTALLED_PATH -for /f "tokens=3* delims= " %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData"') do set sdk_conf_path=%%j -FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) -set CLI_HOME=%SDK_PATH%\SDK\dev_tools + +REM find sdk path +set rkey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" +set rval="Local AppData" +FOR /f "tokens=3*" %%a IN ('reg query %rkey% /v %rval%') DO ( + set sdk_conf_path=%%b +) + +REM find cli path +FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO IF %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\tools\ide + set MAIN=org.tizen.cli.exec.sign.Main set OPT_TRACE= @@ -28,19 +37,19 @@ goto:eof IF y == %READ_ARG% goto SET_LOGGING :SECOND_STEP - IF %~1 == --log goto SET_READY - IF %~1 == -l goto SET_READY + 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 + set OPT_LOGGING=-Dlog4j.configuration=log4j-%~1.xml + IF %~1 == trace set OPT_TRACE=-Dlog4j.debug=true + set READ_ARG=n - goto SECOND_STEP + goto SECOND_STEP :SET_READY - set READ_ARG=y - goto END_STEP + set READ_ARG=y + goto END_STEP diff --git a/org.tizen.cli/doc/install/bin_/web-uninstall.bat b/org.tizen.cli/doc/install/bin_/web-uninstall.bat index 6a03715..13f659b 100644 --- a/org.tizen.cli/doc/install/bin_/web-uninstall.bat +++ b/org.tizen.cli/doc/install/bin_/web-uninstall.bat @@ -3,9 +3,18 @@ set SCRIPT=%0 :: delims is a TAB followed by a space set KEY=TIZEN_SDK_INSTALLED_PATH -for /f "tokens=3* delims= " %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData"') do set sdk_conf_path=%%j -FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO if %%i==%KEY% (set SDK_PATH=%%j) -set CLI_HOME=%SDK_PATH%\SDK\dev_tools + +REM find sdk path +set rkey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" +set rval="Local AppData" +FOR /f "tokens=3*" %%a IN ('reg query %rkey% /v %rval%') DO ( + set sdk_conf_path=%%b +) + +REM find cli path +FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO IF %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\tools\ide + set MAIN=org.tizen.cli.exec.uninstall.Main set OPT_TRACE= @@ -41,6 +50,6 @@ goto:eof goto SECOND_STEP :SET_READY - set READ_ARG=y + set READ_ARG=y goto END_STEP diff --git a/org.tizen.cli/doc/install/bin_/webtizen.bat b/org.tizen.cli/doc/install/bin_/webtizen.bat new file mode 100644 index 0000000..1dd1317 --- /dev/null +++ b/org.tizen.cli/doc/install/bin_/webtizen.bat @@ -0,0 +1,142 @@ +@echo off + +REM variable +set SCRIPT=%0 +set MAIN= +set ISEXIT=false +set CMDLINE= +set KEY=TIZEN_SDK_INSTALLED_PATH +set sdk_conf_path= + +REM find sdk path +set rkey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" +set rval="Local AppData" +FOR /f "tokens=3*" %%a IN ('reg query %rkey% /v %rval%') DO ( + set sdk_conf_path=%%b +) + +REM find cli path +FOR /f "tokens=1,2 delims==" %%i IN (%sdk_conf_path%\tizen-sdk-data\tizensdkpath) DO IF %%i==%KEY% (set SDK_PATH=%%j) +set CLI_HOME=%SDK_PATH%\tools\ide + +set OPT_TRACE= +set OPT_LOGGING=-Dlog4j.configuration=log4j.xml +set OPT_PRG_NAME=-Dcli.name=%SCRIPT% + +set READ_ARG=n + + +REM script execute +call:_check_zero_option %* +IF %ISEXIT% == true goto EXIT_STEP +call:_select_option %* +IF %ISEXIT% == true goto EXIT_STEP +call:ARG_SHIFT %* +call:_run_command %CMDLINE% + + +:END_STEP +goto:eof + +REM print usages method +:_print_usage + echo. Usage: $SCRIPT [option] command [options] + echo. Usage: $SCRIPT [option] short-command [options] + echo. + echo. $SCRIPT is a simple command line interface for Tizen widget. + echo. The most frequently used commands are run and debug. + echo. + echo. Commands: + echo. packaging : Packaging widget project + echo. signing : Signing widget project + echo. list : Display installed widgets handle and name list + echo. install : Install widget package for target + echo. uninstall : Install widget package for target + echo. run : Install wdiget package for target And Launch widget + echo. debug : Install wdiget package for target And Launch widget And activate debug mode + echo. + echo. Short Commands: + echo. -p : packaging command + echo. -s : signing command + echo. -l : list command + echo. -i : install command + echo. -u : uninstall command + echo. -r : run command + echo. -d : debug command + echo. + echo. Option + echo. -h : Display this usage information. + set ISEXIT=true +goto:END_STEP + +REM option check method +:_check_zero_option + IF !%1 == ! goto:_print_usage +goto:END_STEP + +REM option select method +:_select_option + IF %1 == -h goto:_print_usage + IF %1 == help goto:_print_usage + IF %1 == -p set MAIN=org.tizen.cli.exec.wgt.Main + IF %1 == packaging set MAIN=org.tizen.cli.exec.wgt.Main + IF %1 == -s set MAIN=org.tizen.cli.exec.sign.Main + IF %1 == signing set MAIN=org.tizen.cli.exec.sign.Main + IF %1 == -l set MAIN=org.tizen.cli.exec.query.Main + IF %1 == list set MAIN=org.tizen.cli.exec.query.Main + IF %1 == -i set MAIN=org.tizen.cli.exec.install.Main + IF %1 == install set MAIN=org.tizen.cli.exec.install.Main + IF %1 == -u set MAIN=org.tizen.cli.exec.uninstall.Main + IF %1 == uninstall set MAIN=org.tizen.cli.exec.uninstall.Main + IF %1 == -r set MAIN=org.tizen.cli.exec.run.Main + IF %1 == run set MAIN=org.tizen.cli.exec.run.Main + IF %1 == -d set MAIN=org.tizen.cli.exec.debug.Main + IF %1 == debug set MAIN=org.tizen.cli.exec.debug.Main + IF !%MAIN% == ! goto:_print_usage +goto:END_STEP + +REM command line shift method +:ARG_SHIFT + shift + IF !%1 == ! goto:END_STEP + SET "CMDLINE=%CMDLINE% %1" +goto:ARG_SHIFT + +REM command excute method +:_run_command + FOR %%W IN ( %CMDLINE% ) 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% %CMDLINE% + + IF NOT "" == "%OPT_TRACE%" ( echo Command :%EXEC% ) + + %EXEC% +goto:eof + +REM check logging yes +:parseArg + IF y == %READ_ARG% goto SET_LOGGING +goto:SECOND_STEP + +REM check log option -l or --log +:SECOND_STEP + IF %~1 == --log goto SET_READY + IF %~1 == -l goto SET_READY +goto:END_STEP + +REM set logging option +: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 + +REM set ready option +:SET_READY + set READ_ARG=y +goto:END_STEP + +REM exit script +:EXIT_STEP +goto:eof -- 2.7.4