:: 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=
goto SECOND_STEP
:SET_READY
- set READ_ARG=y
+ set READ_ARG=y
goto END_STEP
:: 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=
goto SECOND_STEP
:SET_READY
- set READ_ARG=y
+ set READ_ARG=y
goto END_STEP
:: 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=
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
:: 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=
goto SECOND_STEP
:SET_READY
- set READ_ARG=y
+ set READ_ARG=y
goto END_STEP
:: 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=
goto SECOND_STEP
:SET_READY
- set READ_ARG=y
+ set READ_ARG=y
goto END_STEP
:: 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=
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
:: 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=
goto SECOND_STEP
:SET_READY
- set READ_ARG=y
+ set READ_ARG=y
goto END_STEP
--- /dev/null
+@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