IOTJS_Release_190122_8f77e14 accepted/tizen/unified/20190128.061647 accepted/tizen/unified/20190925.033708 submit/tizen/20190122.015126 submit/tizen/20190123.085220 submit/tizen/20190925.024112
authorHaesik Jun <haesik.jun@samsung.com>
Tue, 22 Jan 2019 01:39:55 +0000 (10:39 +0900)
committerHaesik Jun <haesik.jun@samsung.com>
Tue, 22 Jan 2019 01:39:55 +0000 (10:39 +0900)
Change-Id: I63398f281ad19202779ba3488a8d981307bc73db
Signed-off-by: Haesik Jun <haesik.jun@samsung.com>
31 files changed:
.gitmodules
.travis.yml
README.md
deps/libtuv/.travis.yml
deps/libtuv/Makefile
deps/libtuv/cmake/libtuv.cmake
deps/libtuv/config/libtuv.pc.in [new file with mode: 0644]
deps/libtuv/config/tizen/.gbs.conf [new file with mode: 0644]
deps/libtuv/config/tizen/gbs.conf [new file with mode: 0644]
deps/libtuv/config/tizen/packaging/libtuv.manifest [new file with mode: 0644]
deps/libtuv/config/tizen/packaging/libtuv.spec [new file with mode: 0644]
deps/libtuv/include/uv-tizenrt.h
docs/Getting-Started.md
docs/README.md
docs/build/Build-Script.md
docs/build/Build-for-ARTIK053-TizenRT.md
docs/build/Build-for-STM32F4-NuttX.md
docs/build/Build-for-x86-Linux.md
docs/contributing/Patch-Submission-Process.md
docs/devs/Development-Process.md
docs/devs/Experimental-Features.md
docs/devs/IoT.js-Package-(outdated).md
docs/devs/Test-Guidelines.md
docs/devs/Use-JerryScript-Debugger.md
docs/devs/Writing-New-Module.md
sonar-project.properties
src/iotjs_def.h
src/modules/iotjs_module_tcp.c
src/modules/iotjs_module_websocket.c
tools/check_sonarqube.sh
tools/travis_script.py

index 665c14d896b9a03758623341c60f2203cfbe2076..4d463224d1e561ff6563c88f9fa1baf38cdcb4e5 100644 (file)
@@ -1,12 +1,12 @@
 [submodule "deps/jerry"]
        path = deps/jerry
-       url = https://github.com/jerryscript-project/jerryscript.git
+       url = https://github.com/pando-project/jerryscript.git
 [submodule "deps/http-parser"]
        path = deps/http-parser
-       url = https://github.com/Samsung/http-parser.git
+       url = https://github.com/pando-project/http-parser.git
 [submodule "deps/libtuv"]
        path = deps/libtuv
-       url = https://github.com/Samsung/libtuv.git
+       url = https://github.com/pando-project/libtuv.git
 [submodule "deps/mbedtls"]
        path = deps/mbedtls
        url = https://github.com/ARMmbed/mbedtls.git
index 3733d74bc71c0be315060729e17ec497c7a409f3..bd6a36b10dfcf1d2509fdecd52178c9a0226551f 100644 (file)
@@ -2,82 +2,79 @@ language: c
 
 os: linux
 dist: trusty
-sudo: false
 
 services:
   - docker
 
-before_install:
-  - if [[ "$RUN_DOCKER" == "yes" ]]; then docker pull iotjs/ubuntu:0.9; fi
-
-script:
-  tools/travis_script.py
+script: tools/travis_script.py
 
 matrix:
   include:
-    - env:
-      - JOBNAME="Linux/x86-64 Build & Correctness Tests"
+    - name: "Linux/x86-64 Build & Correctness Tests"
+      env:
       - OPTS="host-linux"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="Mock Linux Build & Correctness Tests"
+
+    - name: "Mock Linux Build & Correctness Tests"
+      env:
       - OPTS="mock-linux"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="Raspberry Pi 2 Build Test"
+
+    - name: "Raspberry Pi 2 Build Test"
+      env:
       - OPTS="rpi2"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="STM32f4 Discovery with Nuttx Build Test"
+
+    - name: "STM32f4 Discovery with Nuttx Build Test"
+      env:
       - OPTS="stm32f4dis"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="Artik053 with TizenRT Build Test"
+
+    - name: "Artik053 with TizenRT Build Test"
+      env:
       - OPTS="artik053"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="Tizen Build Test"
+
+    - name: "Tizen Build Test"
+      env:
       - OPTS="tizen"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="ECMAScript 2015 features Build & Correctness Tests"
+
+    - name: "ECMAScript 2015 features Build & Correctness Tests"
+      env:
       - OPTS="es2015"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="External modules Build & Correctness Tests"
+
+    - name: "External modules Build & Correctness Tests"
+      env:
       - OPTS="external-modules"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="Linux/x86-64 without snapshot Build & Correctness Tests"
+
+    - name: "Linux/x86-64 without snapshot Build & Correctness Tests"
+      env:
       - OPTS="no-snapshot"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="Misc checks (e.g. style checker)"
+
+    - name: "Misc checks (e.g. style checker)"
+      env:
       - OPTS="misc"
       addons:
         apt:
           packages: [valgrind, clang-format-3.9]
-    - env:
-      - JOBNAME="OSX/x86-64 Build & Correctness Tests"
+
+    - name: "OSX/x86-64 Build & Correctness Tests"
+      env:
       - OPTS="host-darwin"
       os: osx
-      install: tools/brew-install-deps.sh
-    - env:
-      - JOBNAME="ASAN Tests"
+      addons:
+        homebrew:
+          packages: [cmake]
+
+    - name: "ASAN Tests"
+      env:
       - OPTS="asan"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="UBSAN Tests"
+
+    - name: "UBSAN Tests"
+      env:
       - OPTS="ubsan"
-      - RUN_DOCKER=yes
-    - env:
-      - JOBNAME="Coverity Scan"
+
+    - name: "Coverity Scan"
+      env:
       - OPTS="coverity"
       # Declaration of the encrypted COVERITY_SCAN_TOKEN, created via the
       # "travis encrypt" command using the project repo's public key.
       - secure: "lUGzoKK/Yn4/OmpqLQALrIgfY9mQWE51deUawPrCO87UQ2GknfQ4BvwY3UT5QY0XnztPBP1+vRQ2qxbiAU7VWicp280sXDnh0FeuZD14FcE9l0FczraL12reoLu+gY5HWFfbkZncmcBsZkxDEYxhkM14FJU8fxyqGQW2ypJNz+gUGP+8r40Re5J3WjcddCQNe5IG8U+M9B4YeDHhN2QspLdN5pkgn56XtdGa3+qbecO2NpjJG5ltM9j1tTuo/Dg22DxrIFVfeFSFKUj4nfMrgPo5LevRsC/lfaBSCsj751eqrxRcQRh2hkpiIJ7mEBs2LL1EH9O6Mbj+eRh8BvIYqTB85VPNFc43sLWk14apcSVBrxJE5j3kP9sAsOD9Y5JynnkeuxYyISrkywwoX2uxsmCzIfGbwsv5VLToQzrqWlGYrHOAmVXNi8561dLfsWwxxFUjdqkZr1Kgc8UfnBEcBUtSiKCHS86/YUUbBJGkEkjDUS0GiqhFY4bXLQCR7EX4qDX3m6p7Mnh4NVUolpnSmyeYE/MjmqQ+7PJsPLL3EcIYmJ7dtW3mZ3yE2NyaFD0Pym9+TiuCCXRtrNVK1M3Kya64KNv+HbhjT/fTCgXLSeyDmJOKVAqugRlDo3b1KGR1LI0AfegzSA6mEC4e9JLjYiSnHPMUahzgLt8oU0hNFRY="
-      before_install:
-        - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
       addons:
         coverity_scan:
           project:
@@ -86,15 +83,14 @@ matrix:
           notification_email: duddlf.choi@samsung.com
           build_command: "tools/travis_script.py"
           branch_pattern: master
-    - env:
-      - JOBNAME="SonarQube"
+
+    - name: "SonarQube"
       addons:
         sonarcloud:
-          organization: "samsung-iotjs"
-          token:
-            secure: "u9HWNQNhAqQQdgl3yldKcQVH8plMQRwIdpzjsM4j3GBC4Wrh9u8guLJB3o003i0UsyaGg2knYFdLgOmEsgcvXAo2aIUyzf9CfK9RLRw5RtIuPMpmR7UjHdlf+QfCF+nY+BB2j0nAiWnxHve95du7sZflNxi+eNJJzquyBh1Wm8eqwoiRpCgiDzjRDEAUoz0FWMNny/x5545E970jpQ2bjHGx98tCMUO8ikINeL8sC99sumffaFONG8GVpwLjc8McfQfYpWbk0e0OPxZtGDyqKcyMxcbAGctklsigtsBZKlpj69uba3w4OSA3zJPCdQ4dKwCyBOcAAP8qeF5Jf0eLI8WLEgnKir2Pfc/rKkY0owuz7S+tUmizm3+T06wDFgwpLu0/PcA5oOcp4WpGXbAX7WujaAHB7YKAEsk324XC7Bdf+39OuZ0dbKWMiwU7rYV4NOYNPjN2BCb1XqyE0Ung41Ls6P4t/zwzYRZtiovhr6ibNBcwLVclfQZ/tbyBDuh++8dh7Ixe+x5RFiiCB0w/fiKqqXYM8/we4JU3f71y4DK6fP+nSN/vIYttvkN28HCCvBVSdyuuvPRM6Ro1yLNw9U9PHCJ1CIgcx8+I8Mep3PzBhDILXWjzlVu4sa/+aIoEq7MvWBDMhrFEP6RX+M6CiPmgj5+Lu/GZNivbu51RASI="
+          organization: "pando-project"
       script: ./tools/check_sonarqube.sh
       cache:
         directories:
           - '$HOME/.sonar/cache'
+
   fast_finish: true
index a3d0c6f56f11b67ae08ef6dff308971406b16569..5f8f3048f6377fe8c6d4c6b628f72bc84620ff92 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,22 +1,22 @@
 # IoT.js: Platform for Internet of Things with JavaScript
 [![License](https://img.shields.io/badge/licence-Apache%202.0-brightgreen.svg?style=flat)](LICENSE)
-[![Build Status](https://travis-ci.org/Samsung/iotjs.svg?branch=master)](https://travis-ci.org/Samsung/iotjs)
+[![Build Status](https://travis-ci.org/pando-project/iotjs.svg?branch=master)](https://travis-ci.org/pando-project/iotjs)
 [![Coverity Scan Build Status](https://scan.coverity.com/projects/12140/badge.svg)](https://scan.coverity.com/projects/samsung-iotjs)
-[![SonarCloud Status](https://sonarcloud.io/api/project_badges/measure?project=samsung.iot.js&metric=alert_status)](https://sonarcloud.io/dashboard?id=samsung.iot.js)
+[![SonarCloud Status](https://sonarcloud.io/api/project_badges/measure?project=pando-project_iotjs&metric=alert_status)](https://sonarcloud.io/dashboard?id=pando-project_iotjs)
 [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FSamsung%2Fiotjs.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FSamsung%2Fiotjs?ref=badge_shield)
 [![IRC Channel](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](https://kiwiirc.com/client/irc.freenode.net/#iotjs)
 
-You can find project details on our [project page](http://samsung.github.io/iotjs/) and [wiki](https://github.com/Samsung/iotjs/wiki).
+You can find project details on our [project page](http://pando-project.github.io/iotjs/) and [wiki](https://github.com/pando-project/iotjs/wiki).
 
-Memory usage and Binary footprint are measured at [here](https://samsung.github.io/iotjs-test-results) with real target daily.
+Memory usage and Binary footprint are measured at [here](https://pando-project.github.io/iotjs-test-results) with real target daily.
 
 The following table shows the latest results on the devices:
 
-|      Artik053         | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fiotjs%2Fartik053.svg?alt=media&token=1)](https://samsung.github.io/iotjs-test-results/?view=artik053)  |
+|      Artik053         | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fiotjs%2Fartik053.svg?alt=media&token=1)](https://pando-project.github.io/iotjs-test-results/?view=artik053)  |
 |        :---:          |                                             :---:                                                                                                |
-| **Artik530**    | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fiotjs%2Fartik530.svg?alt=media&token=1)](https://samsung.github.io/iotjs-test-results/?view=artik530)          |
-| **Raspberry Pi 2**    | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fiotjs%2Frpi2.svg?alt=media&token=1)](https://samsung.github.io/iotjs-test-results/?view=rpi2)          |
-| **STM32F4-Discovery** | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fiotjs%2Fstm32f4dis.svg?alt=media&token=1)](https://samsung.github.io/iotjs-test-results/?view=stm32f4dis)   |
+| **Artik530**    | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fiotjs%2Fartik530.svg?alt=media&token=1)](https://pando-project.github.io/iotjs-test-results/?view=artik530)          |
+| **Raspberry Pi 2**    | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fiotjs%2Frpi2.svg?alt=media&token=1)](https://pando-project.github.io/iotjs-test-results/?view=rpi2)          |
+| **STM32F4-Discovery** | [![Remote Testrunner](https://firebasestorage.googleapis.com/v0/b/jsremote-testrunner.appspot.com/o/status%2Fiotjs%2Fstm32f4dis.svg?alt=media&token=1)](https://pando-project.github.io/iotjs-test-results/?view=stm32f4dis)   |
 
 
 IRC channel: #iotjs on [freenode](https://freenode.net)
@@ -26,7 +26,7 @@ Mailing list: iotjs-dev@groups.io, you can subscribe [here](https://groups.io/g/
 ### Getting the sources
 
 ```bash
-git clone https://github.com/Samsung/iotjs.git
+git clone https://github.com/pando-project/iotjs.git
 cd iotjs
 ```
 
index 2b0244c9a02702f92de3393855ce9eb1498e41fb..8dc2f3804dfda3449289da0a3429fad04d336b24 100644 (file)
@@ -2,18 +2,25 @@ language: c
 
 os: linux
 dist: trusty
-sudo: required
 
-before_install:
-  - tools/check-signed-off.sh --travis
-  - tools/apt-get-install-deps.sh
-  - if [[ "$INSTALL_ARM_DEPS" == "yes" ]]; then tools/apt-get-install-arm.sh; fi
+before_install: tools/apt-get-install-deps.sh
+script: make run_test $OPT
 
-install:
+matrix:
+  include:
+    - name: "Check"
+      before_install: skip
+      script: tools/check-signed-off.sh --travis
 
-script: "make run_test $OPT"
+    - name: "x86-64 Debug"
+      env:
+        - OPT="TUV_BUILD_TYPE=debug"
 
-env:
-  - OPT="TUV_BUILD_TYPE=debug"
-  - OPT="TUV_BUILD_TYPE=release"
-  - OPT="TUV_PLATFORM=arm-linux TUV_BOARD=rpi2" INSTALL_ARM_DEPS=yes
+    - name: "x86-64 Release"
+      env:
+        - OPT="TUV_BUILD_TYPE=release"
+
+    - name: "ARM RPi2"
+      env:
+        - OPT="TUV_PLATFORM=arm-linux TUV_BOARD=rpi2"
+      install: tools/apt-get-install-arm.sh
index c3e4d1d606a1e270806cd96ef548546beaf6f3f0..7fa40a379657705d226e55d859731e1ecb193402 100644 (file)
@@ -87,3 +87,6 @@ call:
 
 clean:
        rm -rf $(OUTPUT_ROOT)
+
+install:
+       make -C $(CMAKE_FOLDER) $@
index e844672c04fe0eb43e1e9ce8c866cc5b3dadef44..8299f1f1b7b2d723d55df42d3be4aabb2671b7ed 100644 (file)
 
 cmake_minimum_required(VERSION 2.8.12)
 
+# Config
+SET(prefix "/usr")
+SET(exec_prefix "${prefix}/bin")
+SET(includedir "${prefix}/include/${PROJECT_NAME}")
+SET(libdir "${prefix}/lib")
+SET(libname "${PROJECT_NAME}")
+
 #
 # { TUV_CHANGES@20161129: It corresponds to uv.gyp's `sources` }
 #
@@ -48,6 +55,11 @@ set(LIB_TUV_INCDIRS
       ${SOURCE_ROOT}
       )
 
+# pkg-config
+CONFIGURE_FILE(config/${libname}.pc.in ${libname}.pc @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libname}.pc"
+  DESTINATION "${libdir}/pkgconfig/")
+
 # build tuv library
 set(TARGETLIBNAME tuv)
 add_library(${TARGETLIBNAME} ${LIB_TUV_SRCFILES})
@@ -57,6 +69,8 @@ set_target_properties(${TARGETLIBNAME} PROPERTIES
     ARCHIVE_OUTPUT_DIRECTORY "${LIB_OUT}"
     LIBRARY_OUTPUT_DIRECTORY "${LIB_OUT}"
     RUNTIME_OUTPUT_DIRECTORY "${BIN_OUT}")
+install(TARGETS ${TARGETLIBNAME} ARCHIVE
+  DESTINATION "${libdir}")
 
 # build tuv shared library
 if (DEFINED CREATE_SHARED_LIB AND CREATE_SHARED_LIB STREQUAL "yes")
@@ -68,6 +82,8 @@ if (DEFINED CREATE_SHARED_LIB AND CREATE_SHARED_LIB STREQUAL "yes")
       LIBRARY_OUTPUT_DIRECTORY "${LIB_OUT}"
       COMPILE_FLAGS -fPIC
       OUTPUT_NAME tuv)
+install(TARGETS ${TARGETSHAREDLIBNAME} LIBRARY
+  DESTINATION "${libdir}")
 endif()
 
 if(DEFINED COPY_TARGET_LIB)
@@ -76,3 +92,7 @@ if(DEFINED COPY_TARGET_LIB)
                                   "${COPY_TARGET_LIB}"
       COMMENT "Copying lib${TARGETLIBNAME} to ${COPY_TARGET_LIB}")
 endif()
+
+# Install headers
+file(GLOB LIBTUV_HEADERS include/*.h)
+install(FILES ${LIBTUV_HEADERS} DESTINATION ${includedir})
diff --git a/deps/libtuv/config/libtuv.pc.in b/deps/libtuv/config/libtuv.pc.in
new file mode 100644 (file)
index 0000000..cafbdb8
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libtuv
+Description: Asynchronous I/O for embedded system
+Version: 1.0.0
+Libs: -L${libdir} -ltuv
+Libs.private: -lpthread
+Cflags: -I${includedir}/libtuv
diff --git a/deps/libtuv/config/tizen/.gbs.conf b/deps/libtuv/config/tizen/.gbs.conf
new file mode 100644 (file)
index 0000000..27429e2
--- /dev/null
@@ -0,0 +1,4 @@
+[general]
+upstream_branch = ${upstreamversion}
+upstream_tag = ${upstreamversion}
+packaging_dir = config/tizen/packaging
diff --git a/deps/libtuv/config/tizen/gbs.conf b/deps/libtuv/config/tizen/gbs.conf
new file mode 100644 (file)
index 0000000..baff78a
--- /dev/null
@@ -0,0 +1,82 @@
+[general]
+#profile = profile.tizen_4.0_unified
+#profile = profile.tizen_4.0_iotpreview2
+#profile = profile.tizen_unified
+profile = profile.tizen_unified_m1
+upstream_branch = ${upstreamversion}
+upstream_tag = ${upstreamversion}
+packaging_dir = config/tizen/packaging
+
+
+[profile.tizen_unified_m1]
+obs = obs.spin
+repos = repo.tizen_base_m1, repo.tizen_unified_m1
+
+[repo.tizen_base_m1]
+url = http://download.tizen.org/releases/milestone/tizen/base/tizen-base_20180518.1/repos/standard/packages/
+user =
+passwdx =
+
+[repo.tizen_unified_m1]
+url = http://download.tizen.org/releases/milestone/tizen/unified/tizen-unified_20180528.1/repos/standard/packages/
+user =
+passwdx =
+
+
+[profile.tizen_4.0_iotpreview2]
+obs = obs.spin
+repos = repo.tizen_local, repo.tizen_4.0_base_arm_20171222.1, repo.tizen_4.0_unified_20180118.1
+
+[repo.tizen_4.0_base_arm_20171222.1]
+url = http://download.tizen.org/releases/previews/iot/preview2/tizen-4.0-base_20171222.1/repos/arm/packages/
+user =
+passwdx =
+
+[repo.tizen_4.0_unified_20180118.1]
+url = http://download.tizen.org/releases/previews/iot/preview2/tizen-4.0-unified_20180118.1/repos/standard/packages/
+user =
+passwdx =
+
+
+[profile.tizen_4.0_unified]
+obs = obs.spin
+repos = repo.public_4.0_base_arm, repo.tizen_4.0_unified
+
+[repo.public_4.0_base_arm]
+url = http://download.tizen.org/snapshots/tizen/4.0-base/latest/repos/arm/packages/
+user = 
+passwdx =
+
+[repo.tizen_4.0_unified]
+url = http://download.tizen.org/snapshots/tizen/4.0-unified/latest/repos/standard/packages/
+user =
+passwdx =
+
+
+[profile.tizen_unified]
+obs = obs.spin
+repos = repo.tizen_base, repo.tizen_unified
+
+[repo.tizen_base]
+url = http://download.tizen.org/snapshots/tizen/base/latest/repos/standard/packages/
+user =
+passwdx =
+
+[repo.tizen_unified]
+url = http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/
+user =
+passwdx =
+
+
+
+[obs.spin]
+url = http://168.219.209.58:81
+
+[obs.tizen]
+url = https://api.tizen.org
+user = obs_viewer
+passwdx = QlpoOTFBWSZTWRP5nYMAAB6fgCAAeUA9mr+QBvzF4CAAVGAZDTRoDI0YBlCKeptQBoA0aGZIAottAkltEPOK7BAFXE9mTUzocPMzQRkPoPpNwEZx3rRQhxkXmGHS6wCjHskyVCP4u5IpwoSAn8zsGA==
+
+
+[repo.tizen_local_unified_m1]
+url = ~/GBS-ROOT/local/repos/tizen_unified_m1/
diff --git a/deps/libtuv/config/tizen/packaging/libtuv.manifest b/deps/libtuv/config/tizen/packaging/libtuv.manifest
new file mode 100644 (file)
index 0000000..f5a44ec
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+        <request>
+                <domain name="_"/>
+        </request>
+</manifest>
diff --git a/deps/libtuv/config/tizen/packaging/libtuv.spec b/deps/libtuv/config/tizen/packaging/libtuv.spec
new file mode 100644 (file)
index 0000000..9360f75
--- /dev/null
@@ -0,0 +1,71 @@
+# Copyright 2018-present Samsung Electronics Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+Name: libtuv
+Version: 1.0.0
+Release: 0
+Summary: Asynchronous I/O for embedded system
+Group: Development/System
+License: Apache-2.0 and MIT
+Source:     %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+ExclusiveArch: %arm %ix86 x86_64
+
+BuildRequires: cmake
+
+%description
+Asynchronous I/O for embedded system
+
+# Initialize the variables
+%{!?build_mode: %define build_mode release}
+%{!?board: %define board None}
+%{!?platform: %define platform noarch-tizen}
+
+%package devel
+Summary: Header files for %{name}
+Group: Development/System
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Development libraries for %{name}
+
+%prep
+%setup -q -c
+cp %{SOURCE1001} .
+
+%build
+TUV_PLATFORM=%{platform} TUV_BOARD=%{board} TUV_BUILD_TYPE=%{build_mode} \
+TUV_BUILDTESTER=no TUV_CREATE_SHARED_LIB=yes make
+
+%install
+TUV_PLATFORM=%{platform} TUV_BOARD=%{board} TUV_BUILD_TYPE=%{build_mode} \
+TUV_BUILDTESTER=no TUV_CREATE_SHARED_LIB=yes \
+DESTDIR=%{buildroot} \
+make install V=1
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%manifest config/tizen/packaging/%{name}.manifest
+%defattr(-,root,root,-)
+%{_libdir}/libtuv.so
+%license LICENSE
+
+%files devel
+%manifest config/tizen/packaging/%{name}.manifest
+%defattr(-,root,root,-)
+%{_libdir}/libtuv.a
+%{_libdir}/pkgconfig/%{name}.pc
+%{_includedir}/*
index 8aaafd0d09a9597304ea533dd5f99d0febf8cdb1..6b0d6ce91a2fd82204c8478615c2d2e6201c2797 100644 (file)
@@ -43,7 +43,7 @@
 #include <errno.h>
 
 #include <netdb.h>
-#include <uio.h>
+#include <sys/uio.h>
 
 #ifndef TUV_POLL_EVENTS_SIZE
 #define TUV_POLL_EVENTS_SIZE  32
index def476c21c3b8005a8ae379df66df9ffab4d4ae8..2a5ac34316a70ca44939abad286f685205bc1c28 100644 (file)
@@ -24,7 +24,7 @@ We will support the correct behavior of APIs for above environments. However, si
 
 
 ### Build script
-There is a [script](build/Build-Script.md) to help you build IoT.js called "[build.py](https://github.com/Samsung/iotjs/blob/master/tools/build.py)" in source repository. Run `tools/build.py --help` command to check all of the build options.
+There is a [script](build/Build-Script.md) to help you build IoT.js called "[build.py](https://github.com/pando-project/iotjs/blob/master/tools/build.py)" in source repository. Run `tools/build.py --help` command to check all of the build options.
 
 #### How to Build
 
@@ -42,10 +42,10 @@ There is a [script](build/Build-Script.md) to help you build IoT.js called "[bui
 
 `--run-test [{full,quiet}]` Execute tests after build, optional argument specifies the level of output for the test runner.
 
-`--jerry-debugger` Enable JerryScript debugger, so JavaScript could can be investigated with an available debugger client (eg.: [Python Debugger Console](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-debugger/jerry-client-ws.py) or [IoT.js Code](https://github.com/Samsung/iotjscode/)). See also ["Use JerryScript Debugger"](devs/Use-JerryScript-Debugger.md).
+`--jerry-debugger` Enable JerryScript debugger, so JavaScript could can be investigated with an available debugger client (eg.: [Python Debugger Console](https://github.com/pando-project/jerryscript/blob/master/jerry-debugger/jerry-client-ws.py) or [IoT.js Code](https://github.com/pando-project/iotjscode/)). See also ["Use JerryScript Debugger"](devs/Use-JerryScript-Debugger.md).
 
 `--js-backtrace {ON,OFF}` Enable/disable backtrace information of JavaScript code (default: ON in debug and OFF in release build).
 
 [nuttx-site]: http://nuttx.org/
 [tizen-site]: https://www.tizen.org/
-[tizenrt-site]: https://wiki.tizen.org/Tizen_RT
\ No newline at end of file
+[tizenrt-site]: https://wiki.tizen.org/Tizen_RT
index a881a00d39818569313aa7b1bf19e7bda5d6c78b..15e698091bac0fd47c0423f30c7aebc2adb65450 100644 (file)
@@ -1,7 +1,7 @@
 Welcome to the IoT.js!
 
 > IoT.js is a framework for "Internet of Things" built on
-> lightweight JavaScript interpreter ['JerryScript'](https://github.com/jerryscript-project/jerryscript)
+> lightweight JavaScript interpreter ['JerryScript'](https://github.com/pando-project/jerryscript)
 > and libtuv for event driven(non-blocking I/O model) similar to node.js.
 
 ### IoT.js Wiki
index 725fb78db6773d6573ff32a116d9d39155ebcca8..99a19a547327d6994f01c28fe72ce689faebdfed 100644 (file)
@@ -4,7 +4,7 @@ build.py help you build IoT.js.
 
 It locates in "./tools" directory of source tree.
 
-It automatically creates a directory where build object and outputs will be generated, 
+It automatically creates a directory where build object and outputs will be generated,
 checks configurations, tidiness of source code, licenses, and more.
 Also it downloads, updates and builds submodules.
 And finally generate IoT.js binary.
@@ -299,7 +299,7 @@ Enable memstat of JerryScript engine.
 #### `--jerry-profile`
 * `es5.1` | `es2015-subset | absolute path to a custom profile file`
 
-Specify the profile for JerryScript (default: es5.1). In JerryScript all of the features are enabled by default, so an empty profile file turns on all of the available ECMA features. See also the related [README.md](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/profiles/README.md).
+Specify the profile for JerryScript (default: es5.1). In JerryScript all of the features are enabled by default, so an empty profile file turns on all of the available ECMA features. See also the related [README.md](https://github.com/pando-project/jerryscript/blob/master/jerry-core/profiles/README.md).
 
 E.g.:
 **/home/iotjs/my-jerry-profile.profile**
index d5fba9df6f1756f707cb6dff1c0cbb50f9a91bdc..bb3252bc430f6c3c3729c1f1061baa0f646d874a 100644 (file)
@@ -35,7 +35,7 @@ Clone IoT.js and TizenRT into iotjs-tizenrt directory
 ```bash
 mkdir iotjs-tizenrt
 cd iotjs-tizenrt
-git clone https://github.com/Samsung/iotjs.git
+git clone https://github.com/pando-project/iotjs.git
 git clone https://github.com/Samsung/TizenRT.git
 ```
 
index 7c0aea61f279dde3b0df352d2f1ffe82b2410c10..ed168458c3bff9876386a1ac1cb6484add16ca24 100644 (file)
@@ -64,7 +64,7 @@ Clone IoT.js and NuttX into iotjs-nuttx directory
 ```bash
 $ mkdir iotjs-nuttx
 $ cd iotjs-nuttx
-$ git clone https://github.com/Samsung/iotjs.git
+$ git clone https://github.com/pando-project/iotjs.git
 $ git clone https://bitbucket.org/nuttx/nuttx.git --branch nuttx-7.25
 $ git clone https://bitbucket.org/nuttx/apps.git --branch nuttx-7.25
 $ git clone https://github.com/texane/stlink.git
@@ -192,7 +192,7 @@ Followings are the options to set:
 * For `spi` module
   * Enable `System Type -> STM32 Peripheral Support -> SPI1`
   * Enable `Device Drivers -> SPI exchange`  
-  
+
 #### Build NuttX Context
 
 ```bash
index 2fe903f2901eea18dad4b2b0389082c90c75f876..8caf715703823df5f8709d73d1f48f0cf9bf0d4d 100644 (file)
@@ -7,7 +7,7 @@
 ***
 
 #### Build Host
-Ubuntu 14.04 is recommended. Other Unix like platforms can be used. If it doesn't seem to work properly on other platforms, please look into the [Issues](https://github.com/Samsung/iotjs/issues) page. Someone may have already tried. If you can't find any related one, please leave an issue for help.
+Ubuntu 14.04 is recommended. Other Unix like platforms can be used. If it doesn't seem to work properly on other platforms, please look into the [Issues](https://github.com/pando-project/iotjs/issues) page. Someone may have already tried. If you can't find any related one, please leave an issue for help.
 
 #### Directory structure
 
@@ -41,7 +41,7 @@ Clone our repository to look around and test it. If it attracts you and you want
 To get the source for this repository,
 ```
 cd harmony
-git clone https://github.com/Samsung/iotjs.git
+git clone https://github.com/pando-project/iotjs.git
 cd iotjs
 ```
 
index a6ad0c434198fe2a4ed6c3d259e2b98f4f90f843..a5216e4af987dea831e300cf19f27013b31c6a08 100644 (file)
@@ -12,7 +12,7 @@ Smaller patches are generally easier to understand and test, so please submit ch
 
 The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an Open Source patch. The  sign-off is required for a patch to be accepted.
 
-#### 3. Open [a Github pull request](https://github.com/Samsung/iotjs/pulls)
+#### 3. Open [a Github pull request](https://github.com/pando-project/iotjs/pulls)
 
 #### 4. What if my patch is rejected?
 
@@ -37,4 +37,4 @@ Changes should be reviewed in reasonable amount of time. Maintainers and Committ
 Connect your local repository to the original upstream repository by adding it as a remote.
 Pull in upstream changes often to stay up-to-date so that when you submit your pull request, merge conflicts will be less likely.
 * For more details, see [GitHub fork synching guidelines](https://help.github.com/articles/syncing-a-fork/).
-[Create a branch](https://guides.github.com/introduction/flow/) for your edits.
\ No newline at end of file
+[Create a branch](https://guides.github.com/introduction/flow/) for your edits.
index 707b2d76282e48e674ce261352add296fec6ac0e..8a93211b7d018ba47994a78c34cf1501edcda66b 100644 (file)
@@ -11,7 +11,7 @@ Individual developers maintain a local copy of the IoT.js codebase using the git
 
 ### Proposals, Get Answers and Report a Bug via Github Issues
 
-If you have a question about IoT.js code, have trouble any documentation, would like to suggest new feature, or find a bug, [review the current IoT.js issues](https://github.com/Samsung/iotjs/issues) in GitHub, and if necessary, [create a new issue](https://github.com/Samsung/iotjs/issues/new).
+If you have a question about IoT.js code, have trouble any documentation, would like to suggest new feature, or find a bug, [review the current IoT.js issues](https://github.com/pando-project/iotjs/issues) in GitHub, and if necessary, [create a new issue](https://github.com/pando-project/iotjs/issues/new).
 
 **There are several labels on the Issue. Please choose proper labels on the purpose.**
 * **bug**
@@ -56,14 +56,14 @@ The IoT.js Project development process is marked by the following highlights:
 
 ### Tips on GitHub Issues
 
-* Check existing [IoT.js issues](https://github.com/Samsung/iotjs/issues) for the answer to your issue.
+* Check existing [IoT.js issues](https://github.com/pando-project/iotjs/issues) for the answer to your issue.
 Duplicating an issue slows you and others. Search through open and closed issues to see if the problem you are running into has already been addressed.
-* If necessary, [open a new issue](https://github.com/Samsung/iotjs/issues/new).
-  - Clearly describe the issue. 
+* If necessary, [open a new issue](https://github.com/pando-project/iotjs/issues/new).
+  - Clearly describe the issue.
      + What did you expect to happen?
      + What actually happened instead?
      + How can someone else recreate the problem?
   - Include system details(such as the hardware, library, and operating system you are using and their versions).
-  - Paste error output and logs in the issue or in a Gist(https://gist.github.com/). 
+  - Paste error output and logs in the issue or in a Gist(https://gist.github.com/).
 
-For more information about GitHub issues, refer to the [GitHub issues guidelines](https://guides.github.com/features/issues/).
\ No newline at end of file
+For more information about GitHub issues, refer to the [GitHub issues guidelines](https://guides.github.com/features/issues/).
index d742cc00b62158735b9e9dc101e8cfeb200f4bbe..8d1c36872675b058e9ceec6cc7ed2d4b02f6987a 100644 (file)
@@ -8,7 +8,7 @@ Experimental build is an executable IoT.js including features that are not yet r
 
 ## How to make IoT.js experimental build
 
-You need to make IoT.js using our build script, ["build.py"](https://github.com/Samsung/iotjs/blob/master/tools/build.py), with `--experimental` or `-e` option.
+You need to make IoT.js using our build script, ["build.py"](https://github.com/pando-project/iotjs/blob/master/tools/build.py), with `--experimental` or `-e` option.
 
  ```bash
  tools/build.py --experimental
@@ -18,7 +18,7 @@ You need to make IoT.js using our build script, ["build.py"](https://github.com/
  tools/build.py -e --config=build.experimental.config
  ```
 
- For selecting modules to be included, you need to notify the script where your modules exist. You can use `--iotjs-include-module` or `--config` option for that. For further information, please refer to [Writing Builtin JavaScript Module](https://github.com/Samsung/iotjs/blob/master/docs/devs/Writing-New-Builtin-Module.md#writing-builtin-javascript-module).
+ For selecting modules to be included, you need to notify the script where your modules exist. You can use `--iotjs-include-module` or `--config` option for that. For further information, please refer to [Writing Builtin JavaScript Module](https://github.com/pando-project/iotjs/blob/master/docs/devs/Writing-New-Builtin-Module.md#writing-builtin-javascript-module).
 
 ## Writing Code
 
index 0a5d944b56ae32334a59aaa706d4e32c8377d8fe..803d545e96914a8443d42e2d5d4bc1f28595ae2b 100644 (file)
@@ -88,7 +88,7 @@ IoT.js is released under Apache 2.0 license, [this page](../License.md). We assu
 2) If it has a WiFi the download directly from the registry
   * But to make this work, we need to develop a small shell program with iotjs.
   * This can be done with built-in module downloader, we need to develop this.
-  * Issue [#75](https://github.com/Samsung/iotjs/issues/75) to track
+  * Issue [#75](https://github.com/pando-project/iotjs/issues/75) to track
 
 3) If your IoT is very small and even has no writable file system
   * Package modules should be built-in to IoT.js at compile time.
index 24b8e7892ea344d50a773447da491077a5ff3a96..555aff775089e6c83ff63c70e3591cfdcc6abb29 100644 (file)
@@ -8,10 +8,10 @@ module (like some js features) then the `iotjs` name can be used as module name.
 correctly specify the module name as the test executor relies on that information.
 
 1. Write a test case and place it into the proper directory.
-2. List up the test case in [test/testsets.json](https://github.com/Samsung/iotjs/blob/master/test/testsets.json), and set attributes (timeout, skip, ...) on the test case if it needs.
+2. List up the test case in [test/testsets.json](https://github.com/pando-project/iotjs/blob/master/test/testsets.json), and set attributes (timeout, skip, ...) on the test case if it needs.
 
 #### Test set descriptor
-* [`test/testsets.json`](https://github.com/Samsung/iotjs/blob/master/test/testsets.json)
+* [`test/testsets.json`](https://github.com/pando-project/iotjs/blob/master/test/testsets.json)
 
 ```
 {
index db7928b48ec2282e87651d5d7f1a66a3ab6f510b..e0bdeabe1f993b3aae3f8f05dbb5ea4f7e70233b 100644 (file)
@@ -1,7 +1,7 @@
 ## Jerry-debugger
 
 Detailed description about the debugger is available
-[here](https://github.com/jerryscript-project/jerryscript/blob/master/docs/07.DEBUGGER.md).
+[here](https://github.com/pando-project/jerryscript/blob/master/docs/07.DEBUGGER.md).
 
 ### Enable debugger support in IoT.js
 
@@ -31,9 +31,9 @@ you can do so with the `--debugger-port <PORT>` option:
 
 #### Available Clients
 
-* [JerryScript console debugger client](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-debugger/jerry-client-ws.py)
-* [Iot.js Code](https://github.com/Samsung/iotjscode)
-* [Jerryscript debugger Chrome webtool](https://github.com/jerryscript-project/jerryscript-debugger-ts)
+* [JerryScript console debugger client](https://github.com/pando-project/jerryscript/blob/master/jerry-debugger/jerry-client-ws.py)
+* [Iot.js Code](https://github.com/pando-project/iotjscode)
+* [Jerryscript debugger Chrome webtool](https://github.com/pando-project/jerryscript-debugger-ts)
 
 **Note**: When snapshot support is enabled, you won't be able to examine js-modules
 that are loaded from snapshots.
index 607140e768cab1129a31798a39d301339c64de62..8900eb79a163be40b68681d0f826c35c5c9d377d 100644 (file)
@@ -101,7 +101,7 @@ Execute:
 
 ## Writing Native Module
 
-You can implement some part of the builtin module in C, to enhance performance and to fully exploit the H/W functionality, etc. It has similar concept with [Node.js native addon](https://nodejs.org/api/addons.html), but we have different set of APIs. Node.js uses its own binding layer with v8 API, but we use [our own binding layer](../../src/iotjs_binding.h) which wraps [JerryScript API](https://github.com/jerryscript-project/JerryScript/blob/master/jerry-core/jerryscript.h). You can see `src/iotjs_binding.*` files to find more APIs to communicate with JS-side values from native-side of you can call JerryScript API functions directly.
+You can implement some part of the builtin module in C, to enhance performance and to fully exploit the H/W functionality, etc. It has similar concept with [Node.js native addon](https://nodejs.org/api/addons.html), but we have different set of APIs. Node.js uses its own binding layer with v8 API, but we use [our own binding layer](../../src/iotjs_binding.h) which wraps [JerryScript API](https://github.com/pando-project/jerryscript/blob/master/jerry-core/jerryscript.h). You can see `src/iotjs_binding.*` files to find more APIs to communicate with JS-side values from native-side of you can call JerryScript API functions directly.
 
 * For native modules you must define an `init` function that provides the JS object that represents your module.
 * You can define multiple native files.
index 9a74a10698ac1337d623017a78d2578b969c6a9e..fe91756d5627206eff5b851c765c2876dcfca7b8 100644 (file)
@@ -1,5 +1,4 @@
-sonar.projectKey=samsung.iot.js
+sonar.projectKey=pando-project_iotjs
 sonar.projectName=IoT.js
-sonar.projectVersion=1.0
 sonar.sources=src
 sonar.cfamily.build-wrapper-output=bw-output
index 62b9f244d3995898be065ebea42f8365233fc72f..4609fb7cd6015854904bc89a6b3eca8556832e56 100644 (file)
@@ -76,7 +76,7 @@ extern void force_terminate();
 #define TARGET_OS "unknown"
 #endif /* __linux__ */
 
-#define IOTJS_VERSION "1.0.0" "190103_9c1af99"
+#define IOTJS_VERSION "1.0.0" "190122_8f77e14"
 
 #if !defined(STRINGIFY)
 #define STRINGIFY(x) #x
index 48566b1de84a00507d2f037549d34a68f48c95be..3de78061ece690e7abafcea0c894950bc1d3ccdf 100644 (file)
@@ -184,8 +184,9 @@ static void OnConnection(uv_stream_t* handle, int status) {
         iotjs_jval_get_object_native_handle(jclient_tcp,
                                             &this_module_native_info);
 
-    int err = uv_accept(handle, (uv_stream_t*)client_handle);
-    if (err) {
+
+    if (client_handle == NULL ||
+        uv_accept(handle, (uv_stream_t*)client_handle)) {
       jerry_release_value(args[0]);
       return;
     }
index 9e8e6e61c68643d28b23a5b9632a712587380314..1be2638b087ebb4a28a8820d150e74047828a066 100644 (file)
@@ -505,10 +505,9 @@ static uint8_t iotjs_websocket_decode_frame(iotjs_wsclient_t *wsclient,
 
         buff_ptr += 2;
         payload_len -= 2;
-        uint8_t ret_code_str_size = 4;
+        size_t ret_code_str_size = 4;
         char ret_code_str[ret_code_str_size + 1];
-        sprintf(ret_code_str, "%d", ret_code);
-        ret_code_str[ret_code_str_size] = '\0';
+        snprintf(ret_code_str, ret_code_str_size + 1, "%d", ret_code);
 
         jerry_value_t ret_buff =
             iotjs_bufferwrap_create_buffer(payload_len + ret_code_str_size);
@@ -609,16 +608,20 @@ JS_FUNCTION(WsReceive) {
       payload_len = (uint16_t)(current_buffer[0] << 8 | current_buffer[1]);
       current_buffer += sizeof(uint16_t);
     } else if (!(payload_byte ^ WS_THREE_BYTES_LENGTH)) {
+      uint64_t payload_64bit_len;
       if (current_buffer + sizeof(uint64_t) > current_buffer_end) {
         break;
       }
-      if ((*(uint64_t *)current_buffer & UINT32_MAX) > UINT32_MAX) {
-        return WS_ERR_FRAME_SIZE_LIMIT;
-      }
       for (uint8_t i = 0; i < sizeof(uint64_t); i++) {
-        memcpy((uint8_t *)&payload_len + i,
+        memcpy((uint8_t *)&payload_64bit_len + i,
                current_buffer + sizeof(uint64_t) - 1 - i, sizeof(uint8_t));
       }
+
+      if (payload_64bit_len > UINT32_MAX) {
+        return WS_ERR_FRAME_SIZE_LIMIT;
+      }
+      payload_len = (uint32_t)payload_64bit_len;
+
       current_buffer += sizeof(uint64_t);
     } else {
       payload_len = payload_byte;
index 4122d11b09764741371c9ccffbd793039cf69423..340a930d1bb727741faeeb54ac8a2d37e5504ffc 100755 (executable)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-if [[ "${TRAVIS_REPO_SLUG}" == "Samsung/iotjs"
+if [[ "${TRAVIS_REPO_SLUG}" == "pando-project/iotjs"
           && ${TRAVIS_BRANCH} == "master"
           && ${TRAVIS_EVENT_TYPE} == "push" ]]
 then
   git fetch --unshallow
   build-wrapper-linux-x86-64 --out-dir bw-output ./tools/build.py
-  sonar-scanner
+  sonar-scanner -Dsonar.projectVersion="${TRAVIS_COMMIT}"
 else
   echo "Skip: The pull request from ${TRAVIS_PULL_REQUEST_SLUG} is an \
   external one. It's not supported yet in Travis-CI"
index 49423edb27cc9fa4e52b418c81fd8533a8a92f73..02874f40ffbff6afeefb0e3885c19742386222f9 100755 (executable)
@@ -61,7 +61,13 @@ BUILDOPTIONS_SANITIZER = [
     '--target-arch=i686'
 ]
 
+def start_container():
+    run_docker()
+    start_mosquitto_server()
+    start_node_server()
+
 def run_docker():
+    ex.check_run_cmd('docker', ['pull', 'iotjs/ubuntu:0.9'])
     ex.check_run_cmd('docker', ['run', '-dit', '--privileged',
                      '--name', DOCKER_NAME, '-v',
                      '%s:%s' % (TRAVIS_BUILD_PATH, DOCKER_IOTJS_PATH),
@@ -104,149 +110,186 @@ def build_iotjs(buildtype, args=[], env=[]):
                 '--clean',
                 '--buildtype=' + buildtype] + args, env)
 
+JOBS = dict()
+
+class job(object):
+    def __init__(self, name):
+        self.name = name
+    def __call__(self, fn):
+        JOBS[self.name] = fn
+
+@job('host-linux')
+def job_host_linux():
+    start_container()
+
+    for buildtype in BUILDTYPES:
+        build_iotjs(buildtype, [
+                    '--cmake-param=-DENABLE_MODULE_ASSERT=ON',
+                    '--run-test=full',
+                    '--profile=profiles/minimal.profile'])
+
+    for buildtype in BUILDTYPES:
+        build_iotjs(buildtype, [
+                    '--run-test=full',
+                    '--profile=test/profiles/host-linux.profile'])
+
+@job('mock-linux')
+def job_mock_linux():
+    start_container()
+    for buildtype in BUILDTYPES:
+        build_iotjs(buildtype, [
+                    '--run-test=full',
+                    '--target-os=mock',
+                    '--profile=test/profiles/mock-linux.profile'])
+
+@job('rpi2')
+def job_rpi2():
+    start_container()
+    for buildtype in BUILDTYPES:
+        build_iotjs(buildtype, [
+                    '--target-arch=arm',
+                    '--target-board=rpi2',
+                    '--profile=test/profiles/rpi2-linux.profile'])
+
+@job('artik053')
+def job_artik053():
+    start_container()
+
+    exec_docker(DOCKER_TIZENRT_PATH, ['git', 'fetch', '--tags'])
+    # Checkout specified tag
+    exec_docker(DOCKER_TIZENRT_PATH, ['git', 'checkout', TIZENRT_TAG])
+    # Pick libtuv's sys/uio.h and add transition header
+    exec_docker(DOCKER_TIZENRT_PATH, ['git', 'cherry-pick',
+                'e020ef62431484b64747c760880d2b6723eb28e4'])
+    exec_docker(DOCKER_TIZENRT_OS_PATH,
+                ['ln', '-fs', 'sys/uio.h', 'include'])
+    # Set configure
+    exec_docker(DOCKER_TIZENRT_OS_TOOLS_PATH, [
+                './configure.sh', 'artik053/iotjs'])
+
+    for buildtype in BUILDTYPES:
+        set_config_tizenrt(buildtype)
+        exec_docker(DOCKER_TIZENRT_OS_PATH, [
+                    'make', 'IOTJS_ROOT_DIR=%s' % DOCKER_IOTJS_PATH,
+                    'IOTJS_BUILD_OPTION="--buildtype=%s '
+                    '--profile=test/profiles/tizenrt.profile"' % buildtype
+                    ])
+
+@job('stm32f4dis')
+def job_stm32f4dis():
+    start_container()
+
+    # Copy the application files to apps/system/iotjs.
+    exec_docker(DOCKER_ROOT_PATH, [
+                'cp', '-r',
+                fs.join(DOCKER_IOTJS_PATH,'config/nuttx/stm32f4dis/app/'),
+                fs.join(DOCKER_NUTTX_APPS_PATH, 'system/iotjs/')])
+
+    exec_docker(DOCKER_ROOT_PATH, [
+                'cp', '-r',
+                fs.join(DOCKER_IOTJS_PATH,
+                        'config/nuttx/stm32f4dis/config.travis'),
+                fs.join(DOCKER_NUTTX_PATH,
+                        'configs/stm32f4discovery/usbnsh/defconfig')])
+
+    for buildtype in BUILDTYPES:
+        exec_docker(DOCKER_NUTTX_PATH, ['make', 'distclean'])
+        exec_docker(DOCKER_NUTTX_TOOLS_PATH,
+                    ['./configure.sh', 'stm32f4discovery/usbnsh'])
+        exec_docker(DOCKER_NUTTX_PATH, ['make', 'clean'])
+        exec_docker(DOCKER_NUTTX_PATH, ['make', 'context'])
+        # Build IoT.js
+        build_iotjs(buildtype, [
+                    '--target-arch=arm',
+                    '--target-os=nuttx',
+                    '--nuttx-home=' + DOCKER_NUTTX_PATH,
+                    '--target-board=stm32f4dis',
+                    '--jerry-heaplimit=78',
+                    '--profile=test/profiles/nuttx.profile'])
+        # Build Nuttx
+        if buildtype == "release":
+            rflag = 'R=1'
+        else:
+            rflag = 'R=0'
+        exec_docker(DOCKER_NUTTX_PATH, [
+                    'make', 'all',
+                    'IOTJS_ROOT_DIR=' + DOCKER_IOTJS_PATH, rflag])
+
+@job('tizen')
+def job_tizen():
+    start_container()
+    for buildtype in BUILDTYPES:
+        if buildtype == "debug":
+            exec_docker(DOCKER_IOTJS_PATH, [
+                        'config/tizen/gbsbuild.sh',
+                        '--debug', '--clean'])
+        else:
+            exec_docker(DOCKER_IOTJS_PATH, ['config/tizen/gbsbuild.sh',
+                        '--clean'])
+
+@job('misc')
+def job_misc():
+    ex.check_run_cmd('tools/check_signed_off.sh', ['--travis'])
+    ex.check_run_cmd('tools/check_tidy.py')
+
+@job('external-modules')
+def job_external_modules():
+    start_container()
+    for buildtype in BUILDTYPES:
+        build_iotjs(buildtype, [
+                    '--run-test=full',
+                    '--profile=test/profiles/host-linux.profile',
+                    '--external-modules=test/external_modules/'
+                    'mymodule1,test/external_modules/mymodule2',
+                    '--cmake-param=-DENABLE_MODULE_MYMODULE1=ON',
+                    '--cmake-param=-DENABLE_MODULE_MYMODULE2=ON'])
+
+@job('es2015')
+def job_es2015():
+    start_container()
+    for buildtype in BUILDTYPES:
+        build_iotjs(buildtype, [
+                    '--run-test=full',
+                    '--jerry-profile=es2015-subset'])
+
+@job('no-snapshot')
+def job_no_snapshot():
+    start_container()
+    for buildtype in BUILDTYPES:
+        build_iotjs(buildtype, ['--run-test=full', '--no-snapshot',
+                                '--jerry-lto'])
+
+@job('host-darwin')
+def job_host_darwin():
+    for buildtype in BUILDTYPES:
+        ex.check_run_cmd('./tools/build.py', [
+                         '--run-test=full',
+                         '--buildtype=' + buildtype,
+                         '--clean',
+                         '--profile=test/profiles/host-darwin.profile'])
+
+@job('asan')
+def job_asan():
+    start_container()
+    build_iotjs('debug', [
+                '--compile-flag=-fsanitize=address',
+                '--compile-flag=-O2'
+                ] + BUILDOPTIONS_SANITIZER,
+                ['ASAN_OPTIONS=detect_stack_use_after_return=1:'
+                'check_initialization_order=true:strict_init_order=true',
+                'TIMEOUT=600'])
+
+@job('ubsan')
+def job_ubsan():
+    start_container()
+    build_iotjs('debug', [
+                '--compile-flag=-fsanitize=undefined'
+                ] + BUILDOPTIONS_SANITIZER,
+                ['UBSAN_OPTIONS=print_stacktrace=1', 'TIMEOUT=600'])
+
+@job('coverity')
+def job_coverity():
+    ex.check_run_cmd('./tools/build.py', ['--clean'])
+
 if __name__ == '__main__':
-    if os.getenv('RUN_DOCKER') == 'yes':
-        run_docker()
-        start_mosquitto_server()
-        start_node_server()
-
-    test = os.getenv('OPTS')
-    if test == 'host-linux':
-        for buildtype in BUILDTYPES:
-            build_iotjs(buildtype, [
-                        '--cmake-param=-DENABLE_MODULE_ASSERT=ON',
-                        '--run-test=full',
-                        '--profile=profiles/minimal.profile'])
-
-        for buildtype in BUILDTYPES:
-            build_iotjs(buildtype, [
-                        '--run-test=full',
-                        '--profile=test/profiles/host-linux.profile'])
-
-    elif test == 'mock-linux':
-        for buildtype in BUILDTYPES:
-            build_iotjs(buildtype, [
-                        '--run-test=full',
-                        '--target-os=mock',
-                        '--profile=test/profiles/mock-linux.profile'])
-
-    elif test == 'rpi2':
-        for buildtype in BUILDTYPES:
-            build_iotjs(buildtype, [
-                        '--target-arch=arm',
-                        '--target-board=rpi2',
-                        '--profile=test/profiles/rpi2-linux.profile'])
-
-    elif test == 'artik053':
-        exec_docker(DOCKER_TIZENRT_PATH, ['git', 'fetch', '--tags'])
-        # Checkout specified tag
-        exec_docker(DOCKER_TIZENRT_PATH, ['git', 'checkout', TIZENRT_TAG])
-        # Set configure
-        exec_docker(DOCKER_TIZENRT_OS_TOOLS_PATH, [
-                    './configure.sh', 'artik053/iotjs'])
-
-        for buildtype in BUILDTYPES:
-            set_config_tizenrt(buildtype)
-            exec_docker(DOCKER_TIZENRT_OS_PATH, [
-                        'make', 'IOTJS_ROOT_DIR=%s' % DOCKER_IOTJS_PATH,
-                        'IOTJS_BUILD_OPTION="--buildtype=%s '
-                        '--profile=test/profiles/tizenrt.profile"' % buildtype
-                        ])
-
-    elif test == 'stm32f4dis':
-        # Copy the application files to apps/system/iotjs.
-        exec_docker(DOCKER_ROOT_PATH, [
-                    'cp', '-r',
-                    fs.join(DOCKER_IOTJS_PATH,'config/nuttx/stm32f4dis/app/'),
-                    fs.join(DOCKER_NUTTX_APPS_PATH, 'system/iotjs/')])
-
-        exec_docker(DOCKER_ROOT_PATH, [
-                    'cp', '-r',
-                    fs.join(DOCKER_IOTJS_PATH,
-                            'config/nuttx/stm32f4dis/config.travis'),
-                    fs.join(DOCKER_NUTTX_PATH,
-                            'configs/stm32f4discovery/usbnsh/defconfig')])
-
-        for buildtype in BUILDTYPES:
-            exec_docker(DOCKER_NUTTX_PATH, ['make', 'distclean'])
-            exec_docker(DOCKER_NUTTX_TOOLS_PATH,
-                        ['./configure.sh', 'stm32f4discovery/usbnsh'])
-            exec_docker(DOCKER_NUTTX_PATH, ['make', 'clean'])
-            exec_docker(DOCKER_NUTTX_PATH, ['make', 'context'])
-            # Build IoT.js
-            build_iotjs(buildtype, [
-                        '--target-arch=arm',
-                        '--target-os=nuttx',
-                        '--nuttx-home=' + DOCKER_NUTTX_PATH,
-                        '--target-board=stm32f4dis',
-                        '--jerry-heaplimit=78',
-                        '--profile=test/profiles/nuttx.profile'])
-            # Build Nuttx
-            if buildtype == "release":
-                rflag = 'R=1'
-            else:
-                rflag = 'R=0'
-            exec_docker(DOCKER_NUTTX_PATH, [
-                        'make', 'all',
-                        'IOTJS_ROOT_DIR=' + DOCKER_IOTJS_PATH, rflag])
-
-    elif test == 'tizen':
-        for buildtype in BUILDTYPES:
-            if buildtype == "debug":
-                exec_docker(DOCKER_IOTJS_PATH, [
-                            'config/tizen/gbsbuild.sh',
-                            '--debug', '--clean'])
-            else:
-                exec_docker(DOCKER_IOTJS_PATH, ['config/tizen/gbsbuild.sh',
-                            '--clean'])
-
-    elif test == "misc":
-        ex.check_run_cmd('tools/check_signed_off.sh', ['--travis'])
-        ex.check_run_cmd('tools/check_tidy.py')
-
-    elif test == "external-modules":
-        for buildtype in BUILDTYPES:
-            build_iotjs(buildtype, [
-                        '--run-test=full',
-                        '--profile=test/profiles/host-linux.profile',
-                        '--external-modules=test/external_modules/'
-                        'mymodule1,test/external_modules/mymodule2',
-                        '--cmake-param=-DENABLE_MODULE_MYMODULE1=ON',
-                        '--cmake-param=-DENABLE_MODULE_MYMODULE2=ON'])
-
-    elif test == 'es2015':
-        for buildtype in BUILDTYPES:
-            build_iotjs(buildtype, [
-                        '--run-test=full',
-                        '--jerry-profile=es2015-subset'])
-
-    elif test == "no-snapshot":
-        for buildtype in BUILDTYPES:
-            build_iotjs(buildtype, ['--run-test=full', '--no-snapshot',
-                                    '--jerry-lto'])
-
-    elif test == "host-darwin":
-        for buildtype in BUILDTYPES:
-            ex.check_run_cmd('./tools/build.py', [
-                             '--run-test=full',
-                             '--buildtype=' + buildtype,
-                             '--clean',
-                             '--profile=test/profiles/host-darwin.profile'])
-
-    elif test == "asan":
-        build_iotjs('debug', [
-                    '--compile-flag=-fsanitize=address',
-                    '--compile-flag=-O2'
-                    ] + BUILDOPTIONS_SANITIZER,
-                    ['ASAN_OPTIONS=detect_stack_use_after_return=1:'
-                    'check_initialization_order=true:strict_init_order=true',
-                    'TIMEOUT=600'])
-
-    elif test == "ubsan":
-        build_iotjs('debug', [
-                    '--compile-flag=-fsanitize=undefined'
-                    ] + BUILDOPTIONS_SANITIZER,
-                    ['UBSAN_OPTIONS=print_stacktrace=1', 'TIMEOUT=600'])
-
-    elif test == "coverity":
-        ex.check_run_cmd('./tools/build.py', ['--clean'])
+    JOBS[os.getenv('OPTS')]()