Integration of Tizen RI layer and Routing Manager build in Jenkins
authorvimala.v <vimala.v@samsung.com>
Tue, 22 Sep 2015 11:36:33 +0000 (17:06 +0530)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Mon, 28 Sep 2015 20:36:07 +0000 (20:36 +0000)
1) Added Tizen scons for csdk libs and sample for IP transport
   in auto build.
2) Updated Tizen, Linux and android scons to build ROUTING=GW
   option in auto build.
3) Updated Tizen CSDK build script to return error on failure.
4) Added README for build procedure and execution of CSDK samples.

Change-Id: I6c9eb8fad8cb441658d8bdd5852ce5b50575f5ea
Signed-off-by: vimala.v <vimala.v@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2921
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
auto_build.sh
resource/csdk/stack/samples/tizen/README.txt [new file with mode: 0644]
resource/csdk/stack/samples/tizen/build/gbsbuild.sh

index ea14b5f..117c0a8 100755 (executable)
@@ -12,6 +12,7 @@ function build_all()
                build_linux_secured $1 $2
                build_linux_unsecured_with_ra $1 $2
                build_linux_secured_with_ra $1 $2
+               build_linux_unsecured_with_rm $1 $2
        fi
 
        build_android $1 $2
@@ -39,6 +40,12 @@ function build_linux_unsecured()
        scons RELEASE=$1 $2
 }
 
+function build_linux_unsecured_with_rm()
+{
+       echo "*********** Build for linux with RoutingManager************"
+       scons ROUTING=GW RELEASE=$1 $2
+}
+
 function build_linux_secured()
 {
        echo "*********** Build for linux with Security *************"
@@ -65,7 +72,9 @@ function build_android()
        # and windows android-ndk-r10(64bit target version) support these features.
 
        build_android_x86 $1 $2
+       build_android_x86_with_rm $1 $2
        build_android_armeabi $1 $2
+       build_android_armeabi_with_rm $1 $2
 }
 
 function build_android_x86()
@@ -76,6 +85,14 @@ function build_android_x86()
        scons TARGET_OS=android TARGET_ARCH=x86 RELEASE=$1 TARGET_TRANSPORT=BLE $2
 }
 
+function build_android_x86_with_rm()
+{
+       echo "*********** Build for android x86 with Routing Manager *************"
+       scons TARGET_OS=android TARGET_ARCH=x86 ROUTING=GW RELEASE=$1 TARGET_TRANSPORT=IP $2
+       scons TARGET_OS=android TARGET_ARCH=x86 ROUTING=GW RELEASE=$1 TARGET_TRANSPORT=BT $2
+       scons TARGET_OS=android TARGET_ARCH=x86 ROUTING=GW RELEASE=$1 TARGET_TRANSPORT=BLE $2
+}
+
 function build_android_armeabi()
 {
        echo "*********** Build for android armeabi *************"
@@ -84,6 +101,14 @@ function build_android_armeabi()
        scons TARGET_OS=android TARGET_ARCH=armeabi RELEASE=$1 TARGET_TRANSPORT=BLE $2
 }
 
+function build_android_armeabi_with_rm()
+{
+       echo "*********** Build for android armeabi with Routing Manager*************"
+       scons TARGET_OS=android TARGET_ARCH=armeabi ROUTING=GW RELEASE=$1 TARGET_TRANSPORT=IP $2
+       scons TARGET_OS=android TARGET_ARCH=armeabi ROUTING=GW RELEASE=$1 TARGET_TRANSPORT=BT $2
+       scons TARGET_OS=android TARGET_ARCH=armeabi ROUTING=GW RELEASE=$1 TARGET_TRANSPORT=BLE $2
+}
+
 function build_arduino()
 {
        echo "*********** Build for arduino avr *************"
@@ -107,6 +132,12 @@ function build_tizen()
 
        echo "*********** Build for Tizen CA lib and sample with Security *************"
        scons -f resource/csdk/connectivity/build/tizen/SConscript TARGET_OS=tizen TARGET_TRANSPORT=IP LOGGING=true SECURED=1 RELEASE=$1 $2
+
+       echo "*********** Build for Tizen octbstack lib and sample *************"
+       scons -f resource/csdk/stack/samples/tizen/build/SConscript TARGET_OS=tizen TARGET_TRANSPORT=IP LOGGING=true RELEASE=$1 $2
+
+       echo "*********** Build for Tizen octbstack lib and sample with Routing Manager*************"
+       scons -f resource/csdk/stack/samples/tizen/build/SConscript TARGET_OS=tizen TARGET_TRANSPORT=IP LOGGING=true ROUTING=GW RELEASE=$1 $2
 }
 
 function build_darwin() # Mac OSx and iOS
@@ -176,6 +207,8 @@ then
        then
                build_linux_unsecured true
                build_linux_unsecured false
+               build_linux_unsecured_with_rm true
+               build_linux_unsecured_with_rm false
        elif [ $1 = 'linux_secured' ]
        then
                build_linux_secured true
@@ -196,10 +229,14 @@ then
        then
         build_android_x86 true
         build_android_x86 false
+               build_android_x86_with_rm true
+               build_android_x86_with_rm false
        elif [ $1 = 'android_armeabi' ]
        then
         build_android_armeabi true
         build_android_armeabi false
+               build_android_armeabi_with_rm true
+               build_android_armeabi_with_rm false
        elif [ $1 = 'arduino' ]
        then
                build_arduino true
diff --git a/resource/csdk/stack/samples/tizen/README.txt b/resource/csdk/stack/samples/tizen/README.txt
new file mode 100644 (file)
index 0000000..4786ab3
--- /dev/null
@@ -0,0 +1,43 @@
+Build Procedure
+===============
+
+1) If you are building first time, then delete GBS-ROOT-RI folder from home directory.
+   Note: Default build server URL for Tizen is set in gbs configuration file @ iotivity/tools/tizen/.gbs.conf.
+         If needed, same can be modified as per appropriate target.
+2) Go to "iotivity/" folder.
+3) Execute following command(s) to start build based on transport selection required :
+    -> Building for all transports :
+    $ scons -f resource/csdk/stack/samples/tizen/build/SConscript TARGET_OS=tizen TARGET_TRANSPORT=ALL
+
+    -> Building for a specific transport :
+    $ scons -f resource/csdk/connectivity/build/tizen/SConscript TARGET_OS=tizen TARGET_TRANSPORT=IP
+
+    -> Building for multiple transports :
+    $ scons -f resource/csdk/connectivity/build/tizen/SConscript TARGET_OS=tizen TARGET_TRANSPORT=IP,BT,BLE
+
+4) By default, above command will build csdk samples also.
+
+Note :- Upon successful execution of above command(s) RI library and sample applications will be
+        generated at path "~/GBS-ROOT-RI/local/repos/<target>/armv7l/RPMS".
+
+Procedure to Execute Sample App:
+================================
+    1) Copy the generated rpms(com-oic-ri-0.1-1.armv7l.rpm, com-oic-ri-sample-0.1-1.armv7l.rpm) to Tizen Device
+       (say /opt/usr/media/xxx/)
+    2) sdb shell
+    3) su
+    4) cd /opt/usr/media/xxx/
+    5) change-booting-mode.sh --update
+
+    6) Install the rpms using the following commands:
+               a) rpm -Uvh com-oic-ri-0.1-1.armv7l.rpm --force --nodeps
+               b) rpm -Uvh com-oic-ri-sample-0.1-1.armv7l.rpm --force --nodeps
+       7) For IP transport, apply net-config smack rules using below command:
+               a) chsmack -a "net-config" /usr/apps/com.oic.ri.sample/bin/*
+               b) chsmack -e "net-config" /usr/apps/com.oic.ri.sample/bin/*
+    7) RPM will be installed in "/usr/apps/"
+       Execute the sample app by below commands
+        i) cd /usr/apps/com.oic.ri.sample/bin
+                       a) ./ocserver -o0 [For Server sample]
+                       b) ./occlient -t2 [For client sample]
+                       c) ./ocrouting [For Gateway sample]
\ No newline at end of file
index 4214057..6931d8f 100644 (file)
@@ -36,10 +36,12 @@ sourcedir=`pwd`
 
 echo `pwd`
 
+rm -rf ./tmp
 mkdir ./tmp
 mkdir ./tmp/extlibs/
 mkdir ./tmp/packaging
-cp -R ./extlibs/tinycbor $sourcedir/tmp/extlibs
+cp -LR ./extlibs/tinycbor $sourcedir/tmp/extlibs
+rm -rf $sourcedir/tmp/extlibs/tinycbor/tinycbor/.git
 cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
 cp -R ./extlibs/tinydtls $sourcedir/tmp/extlibs
 cp -R ./extlibs/timer $sourcedir/tmp/extlibs
@@ -48,6 +50,12 @@ cp -R ./resource/csdk/stack/samples/tizen/build/packaging/*.spec $sourcedir/tmp/
 cp -R ./resource $sourcedir/tmp/
 cp -R ./build_common/external_libs.scons $sourcedir/tmp/
 
+# copy dependency RPMs and conf files for tizen build
+cp ./tools/tizen/*.rpm $sourcedir/tmp
+cp ./tools/tizen/*.rpm $sourcedir/tmp/resource/csdk/stack/samples/tizen/SimpleClientServer
+cp ./tools/tizen/.gbs.conf ./tmp
+cp ./tools/tizen/.gbs.conf ./tmp/resource/csdk/stack/samples/tizen/SimpleClientServer
+
 cd $sourcedir
 cd ./resource/csdk/stack/samples/tizen/build/
 
@@ -78,15 +86,15 @@ if [ ! -d .git ]; then
 fi
 
 echo "Calling core gbs build command"
-gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI --include-all --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6' --repository ./"
+gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6'"
 echo $gbscommand
 if eval $gbscommand; then
    echo "Core build is successful"
 else
-   echo "Core build failed. Try 'sudo find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
+   echo "Core build failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
    cd $sourcedir
    rm -rf $sourcedir/tmp
-   exit
+   exit 1
 fi
 
 if echo $BUILD_SAMPLE|grep -qi '^ON$'; then
@@ -101,18 +109,19 @@ if echo $BUILD_SAMPLE|grep -qi '^ON$'; then
       git commit -m "Initial commit"
    fi
    echo "Calling sample gbs build command"
-   gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI --include-all --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6' --repository ./"
+   gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6'"
    echo $gbscommand
    if eval $gbscommand; then
       echo "Sample build is successful"
    else
-      echo "Sample build is failed. Try 'sudo find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
+      echo "Sample build is failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
+      exit 1
    fi
 else
        echo "Sample build is not enabled"
 fi
 
-
 cd $sourcedir
 rm -rf $sourcedir/tmp
 
+exit 0