From: hyunsik.noh Date: Mon, 4 Nov 2013 10:03:39 +0000 (+0900) Subject: CLI: add class path for using nativecommon-eplugin X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e19c5569727a435d94d5a81245212327f3ae854b;p=sdk%2Ftools%2Fcli.git CLI: add class path for using nativecommon-eplugin The scripts for auto completion and tizen main class need libswpaner.so. So class-pathes and library path included on java command in scripts. And log config path also added to make slf4j be silent when you see cli result. Signed-off-by: hyunsik.noh Change-Id: I1c931384c1012c08a7db5dbeecce549dca0e0d76 --- diff --git a/org.tizen.ncli.ide/tizen-autocomplete b/org.tizen.ncli.ide/tizen-autocomplete index e117f2c..40c2eee 100644 --- a/org.tizen.ncli.ide/tizen-autocomplete +++ b/org.tizen.ncli.ide/tizen-autocomplete @@ -1,5 +1,6 @@ _tizen() { + CLASSPATH="" local cur prev args path next COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" @@ -8,14 +9,23 @@ _tizen() for ((i=0; i < ${COMP_CWORD} ; i++)) do - args="${args} ${COMP_WORDS[i]}" + ARGS="${ARGS} ${COMP_WORDS[i]}" done - next=$(java -jar SCRIPT "${args}") + + LIBS=`find CLI_LIB_PATH -maxdepth 1` + LIB="" + for LIB in $LIBS; do + CLASSPATH=$CLASSPATH:$LIB + done + + CLASSPATH=LOG_CONFIG_PATH:$CLASSPATH + + MAIN=org.tizen.ncli.ide.autocomplete.TizenAutoComplete + + next=$(java -Djava.library.path=SPAWN_LIB_PATH -cp $CLASSPATH $MAIN "$ARGS") COMPREPLY=($(compgen -W "${next}" -- ${cur})) return 0 - } -complete -F _tizen tizen -kill -SIGINT $$ +complete -F _tizen tizen \ No newline at end of file diff --git a/org.tizen.ncli.ide/tizen.sh b/org.tizen.ncli.ide/tizen.sh index a7bd843..419ffe9 100755 --- a/org.tizen.ncli.ide/tizen.sh +++ b/org.tizen.ncli.ide/tizen.sh @@ -3,12 +3,16 @@ CURRENT_WORKSPACE_PATH=`pwd` HOME_PATH=`test -h $0 && dirname $(readlink $0) || dirname $0` cd $HOME_PATH/../lib +CONFIG_PATH=$HOME_PATH/../conf + LIBS=`find . -maxdepth 1` LIB="" for LIB in $LIBS; do - CLASSPATH=$CLASSPATH:$LIB + CLASS_PATH=$CLASS_PATH:$LIB done +CLASS_PATH=$CONFIG_PATH:$CLASS_PATH + escapeSpace() { echo $(printf "'%s'" "$ARG" ) } @@ -20,6 +24,7 @@ done ARGS="$ARGS --current-workspace-path $CURRENT_WORKSPACE_PATH" MAIN=org.tizen.ncli.ide.shell.Main -EXEC="java -cp $CLASSPATH $MAIN $ARGS" + +EXEC="java -Djava.library.path=./os/linux/x86_64 -cp $CLASS_PATH $MAIN $ARGS" eval "$EXEC" diff --git a/package/build.linux b/package/build.linux index 82b06f3..5569bf8 100755 --- a/package/build.linux +++ b/package/build.linux @@ -71,6 +71,7 @@ newcli_build() { org.eclipse.equinox.common_* org.eclipse.osgi_* org.eclipse.ui.console_* + org.eclipse.cdt.core.linux.x86_* " for SRC in ${SRC_LIST} @@ -100,7 +101,7 @@ newcli_build() { ;; esac done - + cp $NCLI_PROJECT_HOME/lib/*.jar $LIB mkdir -p $BUILD cp -r $NCLI_PROJECT_HOME/src/* $BUILD @@ -212,7 +213,7 @@ newcli_install() { case ${TARGET_OS} in ubuntu-32|ubuntu-64|macos-64) cp -r $NCLI_PROJECT_HOME/tizen.sh $NCLI_TARGET/bin || true - cp ${SRCDIR}/dist/tizen-autocomplete.jar $NCLI_TARGET/bin || true + cp ${SRCDIR}/dist/tizen-autocomplete.jar $NCLI_TARGET/lib || true cp -r $NCLI_PROJECT_HOME/tizen-autocomplete $NCLI_TARGET/bin || true ;; diff --git a/package/new-cli.install.linux b/package/new-cli.install.linux index 9e8afd4..941dd16 100644 --- a/package/new-cli.install.linux +++ b/package/new-cli.install.linux @@ -1,23 +1,27 @@ TIZEN_SDK_INSTALL_PATH=${INSTALLED_PATH} TOOLS_PATH=${TIZEN_SDK_INSTALL_PATH}/tools CLI_PATH=${TOOLS_PATH}/ide/bin -AUTOCOMPLETE_SCRIPT=tizen -AUTOCOMPLETE_SRC=tizen-autocomplete -AUTOCOMPLETE_PATH=/etc/bash_completion.d -AUTOCOMPLETE_JAR=${CLI_PATH}/${AUTOCOMPLETE_SRC}.jar -AUTOCOMPLETE_SRC_SCRIPT=${CLI_PATH}/${AUTOCOMPLETE_SRC} -AUTOCOMPLETE_SH=${CLI_PATH}/tizen.sh +TIZEN_COMPLETION_PATH=/etc/bash_completion.d +TIZEN_COMPLETION_SCRIPT=${CLI_PATH}/tizen-autocomplete +TIZEN_COMPLETION_LINK_PATH=/usr/bin/tizen +TIZEN_NEWCLI_SH=${CLI_PATH}/tizen.sh -sed -i "s:SCRIPT:\"${AUTOCOMPLETE_PATH}/${AUTOCOMPLETE_SCRIPT}\":g" ${AUTOCOMPLETE_SRC_SCRIPT} -cat ${AUTOCOMPLETE_SRC_SCRIPT} ${AUTOCOMPLETE_JAR} > ${AUTOCOMPLETE_SCRIPT} -rm ${AUTOCOMPLETE_JAR} -rm ${AUTOCOMPLETE_SRC_SCRIPT} -gksudo "mv ${AUTOCOMPLETE_SCRIPT} ${AUTOCOMPLETE_PATH}" -gksudo "ln -s ${AUTOCOMPLETE_SH} /usr/bin/${AUTOCOMPLETE_SCRIPT}" +CLI_LIB_PATH=${TOOLS_PATH}/ide/lib +LOG_CONFIG_PATH=${TOOLS_PATH}/ide/conf +SPAWN_LIB_PATH=${CLI_LIB_PATH}/os/linux/x86_64 +sed -i "s:LOG_CONFIG_PATH:\"${LOG_CONFIG_PATH}\":g" ${TIZEN_COMPLETION_SCRIPT} +sed -i "s:CLI_LIB_PATH:\"${CLI_LIB_PATH}\":g" ${TIZEN_COMPLETION_SCRIPT} +sed -i "s:SPAWN_LIB_PATH:\"${SPAWN_LIB_PATH}\":g" ${TIZEN_COMPLETION_SCRIPT} +gksudo "mv ${AUTOCOMPLETE_SRC_SCRIPT} ${TIZEN_COMPLETION_PATH}" +gksudo "ln -s ${TIZEN_NEWCLI_SH} ${TIZEN_COMPLETION_LINK_PATH}" +cd ${CLI_LIB_PATH} +jar xf org.eclipse.cdt.core.linux.x86*.jar os + +. /etc/bash_complete exit 0 diff --git a/package/new-cli.remove.linux b/package/new-cli.remove.linux index e55a243..dfd5585 100644 --- a/package/new-cli.remove.linux +++ b/package/new-cli.remove.linux @@ -2,12 +2,13 @@ TIZEN_SDK_INSTALL_PATH=${INSTALLED_PATH} TOOLS_PATH=${TIZEN_SDK_INSTALL_PATH}/tools CLI_PATH=${TOOLS_PATH}/ide/bin -AUTOCOMPLETE_SCRIPT=tizen -AUTOCOMPLETE_PATH=/etc/bash_completion.d +TIZEN_COMPLETION_SCRIPT=tizen-autocomplete +TIZEN_COMPLETION_PATH=/etc/bash_completion.d +TIZEN_COMPLETION_LINK_PATH=/usr/bin/tizen -rm ${CLI_PATH}/tizen.sh -gksudo rm ${AUTOCOMPLETE_PATH}/${AUTOCOMPLETE_SCRIPT} +gksudo "rm ${AUTOCOMPLETE_PATH}/${AUTOCOMPLETE_SCRIPT}" +gksudo "rm ${TIZEN_COMPLETION_LINK_PATH}" complete -r _tizen tizen - exit 0; +exit 0;