From 9e74fd9450a0c01944b269bf37064500a4a87c27 Mon Sep 17 00:00:00 2001 From: "hyunsik.noh" Date: Mon, 21 Oct 2013 17:23:08 +0900 Subject: [PATCH] [Title]Add files to make new-cli pacakge Change-Id: I5c61beffce04994911f3271c3efb0a1c6036a527 --- build.xml | 32 ++++++++++++ org.tizen.ncli.ide/tizen-autocomplete | 32 ++++++------ package/build.linux | 91 +++++++++++++++++++++++++++++++++-- package/new-cli.install.linux | 18 +++++++ package/new-cli.remove.linux | 13 +++++ package/pkginfo.manifest | 36 ++++++++++++++ 6 files changed, 200 insertions(+), 22 deletions(-) create mode 100644 package/new-cli.install.linux create mode 100644 package/new-cli.remove.linux diff --git a/build.xml b/build.xml index 3ddd50d..93c19d5 100644 --- a/build.xml +++ b/build.xml @@ -5,6 +5,15 @@ + + + + + + + + + @@ -23,5 +32,28 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.tizen.ncli.ide/tizen-autocomplete b/org.tizen.ncli.ide/tizen-autocomplete index a8f9a0d..e117f2c 100644 --- a/org.tizen.ncli.ide/tizen-autocomplete +++ b/org.tizen.ncli.ide/tizen-autocomplete @@ -1,25 +1,21 @@ -#Should be fix binary name and path before to test this. -#1. move this file to /etc/bash_completion.d -#2. execute ". /etc/bash_completion" -#3. test after "tizen" command _tizen() { - local cur prev args - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - args="" + local cur prev args path next + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + args="" - for ((i=0; i < ${COMP_CWORD} ; i++)) - do - args="${args} ${COMP_WORDS[i]}" - done - - next=$(java -cp /home/hyunsik/workspace_pde_develop/test/bin TizenAutoComplete "${args}") - COMPREPLY=($(compgen -W "${next}" -- ${cur})) + for ((i=0; i < ${COMP_CWORD} ; i++)) + do + args="${args} ${COMP_WORDS[i]}" + done + next=$(java -jar SCRIPT "${args}") + COMPREPLY=($(compgen -W "${next}" -- ${cur})) - return 0 - + return 0 + } complete -F _tizen tizen +kill -SIGINT $$ diff --git a/package/build.linux b/package/build.linux index 0b666b0..0d3969d 100755 --- a/package/build.linux +++ b/package/build.linux @@ -5,16 +5,19 @@ BUILD=build PLATFORM=$TARGET_OS TARGET=package/web-cli.package.$PLATFORM/data/tools/ide NATIVE_TARGET=package/native-cli.package.$PLATFORM/data/tools/ide - LIB=$SRCDIR/lib NATIVE_LIB=${SRCDIR}/native-lib - +#newcli +NCLI_PROJECT_HOME="org.tizen.ncli.ide" +NCLI_TARGET=package/new-cli.package.$PLATFORM/data/tools/ide +NCLI_LIB=${SRCDIR}/new-lib # clean clean() { echo "$SRCDIR" rm -rf dist lib package/web-cli.package.linux rm -rf ${NATIVE_LIB} package/native-cli.package.${TARGET_OS} + rm -rf ${NCLI_LIB} package/new-cli.package.${TARGET_OS} } # build @@ -58,6 +61,46 @@ native_build() { esac done } + +newcli_build() { + mkdir -p ${NCLI_LIB} + mkdir -p ${NCLI_TARGET}/bin + + SRC_LIST=" + org.eclipse.cdt.core_* + " + + for SRC in ${SRC_LIST} + do + TARGET=`find $ROOTDIR -name "${SRC}" | head -1` + cp ${TARGET} ${NCLI_LIB} + done + + INCLUDING_LIB_SRC_LIST=" + org.tizen.common_* + org.tizen.common.sign_* + org.tizen.nativecommon_* + org.tizen.nativecpp.misc_* + " + for SRC in ${INCLUDING_LIB_SRC_LIST} + do + TARGET=`find $ROOTDIR -name "${SRC}" | head -1` + case "${TARGET}" in + *.jar) + cp ${TARGET} ${NCLI_LIB} + jar -xvf ${TARGET} lib + ;; + *) + cp -rf ${TARGET} ${NCLI_LIB} + find -name '*.jar' -exec cp {} ${NCLI_LIB} \; + ;; + esac + done + + cp $NCLI_PROJECT_HOME/lib/*.jar $LIB + mkdir -p $BUILD + cp -r $NCLI_PROJECT_HOME/src/* $BUILD +} build() { echo $LIB @@ -107,10 +150,10 @@ build() mkdir -p $BUILD cp -r $PROJECT_HOME/src/* $BUILD - # native-cli build native_build - + # newcli build + newcli_build ant } @@ -155,6 +198,43 @@ xmlsec-*.jar } +#ncli install +newcli_install() { + mkdir -p $NCLI_TARGET/lib + cp -r $NCLI_LIB/* $NCLI_TARGET/lib || true + cp ${SRCDIR}/dist/tizen-new-cli.jar $NCLI_TARGET/lib || true + + + 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 -r $NCLI_PROJECT_HOME/tizen-autocomplete $NCLI_TARGET/bin || true + + ;; + windows-32|windows-64) + cp -r $NCLI_PROJECT_HOME/tizen.bat $NCLI_TARGET/bin || true + ;; + *) + echo "${TARGET_OS} is not support yet." + exit 1 + ;; + esac + +dependency_jars=" +HashSign.jar +commons-cli-*.jar +log4j-*.jar +slf4j-api-*.jar +slf4j-log4j*.jar +xmlsec-*.jar +" + for i in ${dependency_jars} + do + cp -rf ${LIB}/${i} ${NCLI_TARGET}/lib + done +} + install() @@ -184,6 +264,8 @@ install() cp dist/*.jar $TARGET/lib || true # native-cli install native_install + # ncli install + newcli_install } [ "$1" = "clean" ] && clean @@ -191,3 +273,4 @@ install() [ "$1" = "install" ] && install echo "success" + diff --git a/package/new-cli.install.linux b/package/new-cli.install.linux new file mode 100644 index 0000000..812ec6f --- /dev/null +++ b/package/new-cli.install.linux @@ -0,0 +1,18 @@ +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} + +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} + + +exit 0 + diff --git a/package/new-cli.remove.linux b/package/new-cli.remove.linux new file mode 100644 index 0000000..e55a243 --- /dev/null +++ b/package/new-cli.remove.linux @@ -0,0 +1,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 + +rm ${CLI_PATH}/tizen.sh +gksudo rm ${AUTOCOMPLETE_PATH}/${AUTOCOMPLETE_SCRIPT} +complete -r _tizen tizen + + exit 0; + diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index d22c5de..063734f 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -69,3 +69,39 @@ OS: macos-64 Build-host-os: ubuntu-64 Build-dependency: nativecommon-eplugin [macos-64], base-ide-product [macos-64], common-eplugin [macos-64], nativecpp-ext-eplugin [macos-64] Install-dependency: sdb [macos-64] +Description: Tizen IDE Command Line Interface + +Package: new-cli +OS: ubuntu-32 +Build-host-os: ubuntu-32 +Build-dependency: nativecommon-eplugin [ubuntu-32], base-ide-product [ubuntu-32], common-eplugin [ubuntu-32], nativecpp-ext-eplugin [ubuntu-32] +Install-dependency: sdb [ubuntu-32] +Description: New Tizen IDE Command Line Interface + +Package: new-cli +OS: ubuntu-64 +Build-host-os: ubuntu-64 +Build-dependency: nativecommon-eplugin [ubuntu-64], base-ide-product [ubuntu-64], common-eplugin [ubuntu-64], nativecpp-ext-eplugin [ubuntu-64] +Install-dependency: sdb [ubuntu-64] +Description: New Tizen IDE Command Line Interface + +Package: new-cli +OS: windows-32 +Build-host-os: ubuntu-32 +Build-dependency: nativecommon-eplugin [windows-32], base-ide-product [windows-32], common-eplugin [windows-32], nativecpp-ext-eplugin [windows-32] +Install-dependency: sdb [windows-32] +Description: New Tizen IDE Command Line Interface + +Package: new-cli +OS: windows-64 +Build-host-os: ubuntu-64 +Build-dependency: nativecommon-eplugin [windows-64], base-ide-product [windows-64], common-eplugin [windows-64], nativecpp-ext-eplugin [windows-64] +Install-dependency: sdb [windows-64] +Description: New Tizen IDE Command Line Interface + +Package: new-cli +OS: macos-64 +Build-host-os: ubuntu-64 +Build-dependency: nativecommon-eplugin [macos-64], base-ide-product [macos-64], common-eplugin [macos-64], nativecpp-ext-eplugin [macos-64] +Install-dependency: sdb [macos-64] +Description: New Tizen IDE Command Line Interface -- 2.7.4