Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Re-enable nRF52840 lock example targets in travis
Browse files Browse the repository at this point in the history
-- Download sdk and tools for the nrf52840 lock example target in the
   before_install script rather than in the prepare script. This makes sure
   that dependancy installation happens only once as we add more
   applications in the future for the nrf52840 platform that use the
   same dependencies.
-- Enable building nRF52840 Lock Example on Linux and OSX
  • Loading branch information
suryanshup committed Jul 17, 2019
1 parent 942bc9e commit 5f026ae
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 167 deletions.
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#
# Description:
# This file is the Travis CI hosted, distributed continuous
# This file is the Travis CI hosted, distributed continuous
# integration configuration file for the OpenWeave Core library.
#

Expand Down Expand Up @@ -64,6 +64,12 @@ matrix:
compiler: clang
- name: "ESP32 (openweave-esp32-demo)"
env: BUILD_TARGET="esp32"
- name: "nRF52840 Lock Example (Linux)"
env: BUILD_TARGET="nrf52840-lock-example"
os: linux
- name: "nRF52840 Lock Example (OS X)"
env: BUILD_TARGET="nrf52840-lock-example"
os: osx
- name: "Linux with Defaults against GCC Functional and Unit Tests"
env: BUILD_TARGET="linux-auto-gcc-check" CC="gcc"
os: linux
Expand Down Expand Up @@ -104,4 +110,4 @@ deploy:
tags: true
env:
global:
secure: PJdNS8L51Y+Op8xc2C9U13Y6eQUAszDEKigB0jn9LsXB8BZwJsu3mjmtLTQBU99nqAhsCKiN85kxry6APi/xjcDJ3/iRP8IpP8KJ/VV68CChdu1X/2iatSS/EOAT4ZBoo3sUCmP98w4k5G6HiVCpnNprhZOg8xsD9bflVkX9Au67hcwfHfKWyX1c/kbYYyegSWd+7GgkNZRGAws1yuwL1MwGppDqKQJ1bOciALaA1LMzzl1wvrle6t+CWvLH51YoIgndFsTJaphGqXp/hveCIsXEGKY5ZN8RkfuSvs9JupsfoXjA9Nxg2WfLC5c4MeyJV9yvzF9zZNglra9+PTlHFMxnuSvyIKRiHb9rwXMwgtb8Tqwhe0Cikj77gHdRUfZjUNBS34nNRqACSFjSFDM9N862z17BqfMZu0A0znquM24vfm+JV1i7OZ8USdbbmBqtL5qJgimQv2/Y/j3H/o6IrqOLEhuzOXQynclf6xi6AdXlcJ1QmTTicU5JbETJuzkvOYsnUs7TBV0FaPf+j98LEHTXZUPlDtQz4sIu757SiYUuR6Jm357yOwyv+x/PMk250g2op0TtMksjR3HQahnz8HJPYLenOxogYqarqY6E4TNm2P+bRDCPgxQ+dTSvlrcH8qhl+PHImn38q38ghm98WUvqdwxAApI3cZdy4Ja/3WA=
secure: PJdNS8L51Y+Op8xc2C9U13Y6eQUAszDEKigB0jn9LsXB8BZwJsu3mjmtLTQBU99nqAhsCKiN85kxry6APi/xjcDJ3/iRP8IpP8KJ/VV68CChdu1X/2iatSS/EOAT4ZBoo3sUCmP98w4k5G6HiVCpnNprhZOg8xsD9bflVkX9Au67hcwfHfKWyX1c/kbYYyegSWd+7GgkNZRGAws1yuwL1MwGppDqKQJ1bOciALaA1LMzzl1wvrle6t+CWvLH51YoIgndFsTJaphGqXp/hveCIsXEGKY5ZN8RkfuSvs9JupsfoXjA9Nxg2WfLC5c4MeyJV9yvzF9zZNglra9+PTlHFMxnuSvyIKRiHb9rwXMwgtb8Tqwhe0Cikj77gHdRUfZjUNBS34nNRqACSFjSFDM9N862z17BqfMZu0A0znquM24vfm+JV1i7OZ8USdbbmBqtL5qJgimQv2/Y/j3H/o6IrqOLEhuzOXQynclf6xi6AdXlcJ1QmTTicU5JbETJuzkvOYsnUs7TBV0FaPf+j98LEHTXZUPlDtQz4sIu757SiYUuR6Jm357yOwyv+x/PMk250g2op0TtMksjR3HQahnz8HJPYLenOxogYqarqY6E4TNm2P+bRDCPgxQ+dTSvlrcH8qhl+PHImn38q38ghm98WUvqdwxAApI3cZdy4Ja/3WA=
82 changes: 62 additions & 20 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,49 @@

#
# Description:
# This file is the script for Travis CI hosted, distributed continuous
# This file is the script for Travis CI hosted, distributed continuous
# integration 'before_install' trigger of the 'install' step.
#

NORDIC_SDK_FOR_THREAD_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/SDKs/nRF5-SDK-for-Thread/nRF5-SDK-for-Thread-and-Zigbee/nRF5SDKforThreadandZigbee20029775ac.zip
TMPDIR=${TMPDIR-/tmp}

NORDIC_COMMAND_LINE_TOOLS_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF5-command-line-tools/sw/nRF-Command-Line-Tools_9_8_1_Linux-x86_64.tar
HASH_CMD="shasum -a 256"
CACHEDIR=${TRAVIS_BUILD_DIR}/cache

ARM_GCC_TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
FetchURL() {
local URL="$1"
local LOCAL_FILE_NAME=$2
local HASH=$3

TMPDIR=${TMPDIR-/tmp}
# NOTE: 2 spaces required between hash value and file name.
if ! (echo "${HASH} ${LOCAL_FILE_NAME}" | ${HASH_CMD} -c --status >/dev/null 2>&1); then
rm -f ${LOCAL_FILE_NAME}
wget -O ${LOCAL_FILE_NAME} -nv "${URL}" || exit 1
fi
}

# Tool download links
#
export NORDIC_SDK_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/SDKs/nRF5-SDK-for-Thread/nRF5-SDK-for-Thread-and-Zigbee/nRF5SDKforThreadandZigbeev300d310e71.zip
NORDIC_SDK_HASH=39842f47cbd1b9ba18a892de2732d5eb0610d7ec38f10ec48aeb326e92e06444

if test "${TRAVIS_OS_NAME}" = "linux"; then

export NORDIC_COMMAND_LINE_TOOLS_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-9-x-x/nRF-Command-Line-Tools_9_8_1_Linux-x86_64.tar
NORDIC_COMMAND_LINE_TOOLS_HASH=ed3eb5325f9e1dcbfc2046f3b347b7b76a802ddb31a8b113965b4097a893f6d1

export ARM_GCC_TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
ARM_GCC_TOOLCHAIN_HASH=bb17109f0ee697254a5d4ae6e5e01440e3ea8f0277f2e8169bf95d07c7d5fe69

elif test "${TRAVIS_OS_NAME}" = "osx"; then

export NORDIC_COMMAND_LINE_TOOLS_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-9-x-x/nRF-Command-Line-Tools_9_8_1_OSX.tar
NORDIC_COMMAND_LINE_TOOLS_HASH=b4b77e4368267ba948f5bedbdc1be7699322e453c4e9f097f48763b78e192ff2

export ARM_GCC_TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-mac.tar.bz2
ARM_GCC_TOOLCHAIN_HASH=c1c4af5226d52bd1b688cf1bd78f60eeea53b19fb337ef1df4380d752ba88759

fi

die()
{
Expand Down Expand Up @@ -76,38 +108,45 @@ installdeps()

nrf5-sdk)
# Install Nordic nRF52840 SDK for Thread and Zigbee
wget -O ${TMPDIR}/nordic_sdk_for_thread.zip -nv ${NORDIC_SDK_FOR_THREAD_URL} || exit 1
unzip -d ${TRAVIS_BUILD_DIR}/nRF5x-SDK-for-Thread-and-Zigbee -q ${TMPDIR}/nordic_sdk_for_thread.zip || exit 1
rm ${TMPDIR}/nordic_sdk_for_thread.zip

#
mkdir -p ${CACHEDIR}
NORDIC_SDK_FILE_NAME=${CACHEDIR}/`basename ${NORDIC_SDK_URL}`
FetchURL "${NORDIC_SDK_URL}" ${NORDIC_SDK_FILE_NAME} ${NORDIC_SDK_HASH}
unzip -d ${TRAVIS_BUILD_DIR}/nRF5x-SDK-for-Thread-and-Zigbee -q ${NORDIC_SDK_FILE_NAME} || exit 1

;;

nrf5-tools)
# Install Nordic nRF5x Command Line Tools
wget -O ${TMPDIR}/nordic_command_line_tools.tar -nv ${NORDIC_COMMAND_LINE_TOOLS_URL} || exit 1
#
mkdir -p ${CACHEDIR}
NORDIC_COMMAND_LINE_TOOLS_FILE_NAME=${CACHEDIR}/`basename ${NORDIC_COMMAND_LINE_TOOLS_URL}`
FetchURL "${NORDIC_COMMAND_LINE_TOOLS_URL}" ${NORDIC_COMMAND_LINE_TOOLS_FILE_NAME} ${NORDIC_COMMAND_LINE_TOOLS_HASH}
mkdir ${TRAVIS_BUILD_DIR}/nRF5x-Command-Line-Tools
tar -C ${TRAVIS_BUILD_DIR}/nRF5x-Command-Line-Tools -xf ${TMPDIR}/nordic_command_line_tools.tar || exit 1
rm ${TMPDIR}/nordic_command_line_tools.tar
tar -C ${TRAVIS_BUILD_DIR}/nRF5x-Command-Line-Tools -xf ${NORDIC_COMMAND_LINE_TOOLS_FILE_NAME} || exit 1

;;

arm-gcc)
# Install ARM GCC Toolchain
wget -O ${TMPDIR}/arm_gcc_toolchain.tar.bz2 -nv ${ARM_GCC_TOOLCHAIN_URL} || exit 1
#
mkdir -p ${CACHEDIR}
ARM_GCC_TOOLCHAIN_FILE_NAME=${CACHEDIR}/`basename ${ARM_GCC_TOOLCHAIN_URL}`
FetchURL "${ARM_GCC_TOOLCHAIN_URL}" ${ARM_GCC_TOOLCHAIN_FILE_NAME} ${ARM_GCC_TOOLCHAIN_HASH}
mkdir ${TRAVIS_BUILD_DIR}/arm
tar -jxf ${TMPDIR}/arm_gcc_toolchain.tar.bz2 --directory ${TRAVIS_BUILD_DIR}/arm || exit 1
rm ${TMPDIR}/arm_gcc_toolchain.tar.bz2
tar -jxf ${ARM_GCC_TOOLCHAIN_FILE_NAME} --directory ${TRAVIS_BUILD_DIR}/arm || exit 1

;;


osx-autotools)
HOMEBREW_NO_AUTO_UPDATE=1 brew install automake libtool
;;

osx-openssl)
HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl
;;

esac
}

Expand Down Expand Up @@ -135,8 +174,11 @@ case "${BUILD_TARGET}" in

;;

nrf52840)
.travis/prepare_nrf52840.sh
nrf52840-lock-example)
installdeps "nrf5-sdk"
installdeps "nrf5-tools"
installdeps "arm-gcc"
.travis/prepare_nrf52840_lock_example.sh

;;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,8 @@

TMPDIR=${TMPDIR-/tmp}

# Set tools download links
#
NORDIC_SDK_FOR_THREAD_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/SDKs/nRF5-SDK-for-Thread/nRF5-SDK-for-Thread-and-Zigbee/nRF5SDKforThreadandZigbeev300d310e71.zip
NORDIC_COMMAND_LINE_TOOLS_URL=https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF5-command-line-tools/sw/nRF-Command-Line-Tools_9_8_1_Linux-x86_64.tar
ARM_GCC_TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2

# --------------------------------------------------------------------------------

set -x

# Install Nordic nRF52840 SDK for Thread and Zigbee
#
wget -O ${TMPDIR}/nordic_sdk_for_thread.zip -nv ${NORDIC_SDK_FOR_THREAD_URL} || exit 1
unzip -d ${TRAVIS_BUILD_DIR}/nRF5x-SDK-for-Thread-and-Zigbee -q ${TMPDIR}/nordic_sdk_for_thread.zip || exit 1
rm ${TMPDIR}/nordic_sdk_for_thread.zip

# Install Nordic nRF5x Command Line Tools
#
wget -O ${TMPDIR}/nordic_command_line_tools.tar -nv ${NORDIC_COMMAND_LINE_TOOLS_URL} || exit 1
mkdir ${TRAVIS_BUILD_DIR}/nRF5x-Command-Line-Tools
tar -C ${TRAVIS_BUILD_DIR}/nRF5x-Command-Line-Tools -xf ${TMPDIR}/nordic_command_line_tools.tar || exit 1
rm ${TMPDIR}/nordic_command_line_tools.tar

# Install ARM GCC Toolchain
#
wget -O ${TMPDIR}/arm_gcc_toolchain.tar.bz2 -nv ${ARM_GCC_TOOLCHAIN_URL} || exit 1
mkdir ${TRAVIS_BUILD_DIR}/arm
tar -jxf ${TMPDIR}/arm_gcc_toolchain.tar.bz2 --directory ${TRAVIS_BUILD_DIR}/arm || exit 1
rm ${TMPDIR}/arm_gcc_toolchain.tar.bz2

# Clone the openweave-nrf52840-lock-example application. This code will be used to
# test the ability to build OpenWeave for the nRF52840.
#
Expand Down
8 changes: 4 additions & 4 deletions .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#
# Description:
# This file is the script for Travis CI hosted, distributed continuous
# This file is the script for Travis CI hosted, distributed continuous
# integration 'script' step.
#

Expand Down Expand Up @@ -97,8 +97,8 @@ case "${BUILD_TARGET}" in
.travis/build_esp32.sh
;;

nrf52840)
.travis/build_nrf52840.sh
nrf52840-lock-example)
.travis/build_nrf52840_lock_example.sh
;;

linux-auto-*-distcheck)
Expand All @@ -112,6 +112,6 @@ case "${BUILD_TARGET}" in
*)
die "Unknown build target \"${BUILD_TARGET}\"."
;;

esac

84 changes: 42 additions & 42 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,59 +28,59 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am

.NOTPARALLEL:

AM_MAKEFLAGS = --no-print-directory
AM_MAKEFLAGS = --no-print-directory

SUBDIRS = \
third_party \
src \
doc \
SUBDIRS = \
third_party \
src \
doc \
$(NULL)

PRETTY_SUBDIRS = \
$(filter-out third_party,$(SUBDIRS)) \
PRETTY_SUBDIRS = \
$(filter-out third_party,$(SUBDIRS)) \
$(NULL)

EXTRA_DIST = \
BUILDING-ESP32.md \
BUILDING.md \
CONTRIBUTING.md \
Makefile-Android \
Makefile-bootstrap \
Makefile-iOS \
Makefile-Standalone \
README.md \
.default-version \
.travis.yml \
.travis/before_install.sh \
.travis/build_esp32.sh \
.travis/build_nrf52840.sh \
.travis/prepare_esp32.sh \
.travis/prepare_nrf52840.sh \
.travis/script.sh \
bootstrap \
bootstrap-configure \
repos.conf \
$(srcdir)/build/autoconf \
$(srcdir)/build/config \
$(srcdir)/build/cstyle/cstyle.options \
$(srcdir)/build/esp32 \
$(srcdir)/build/jenkins \
$(srcdir)/build/make \
$(srcdir)/build/scripts \
$(srcdir)/certs \
EXTRA_DIST = \
BUILDING-ESP32.md \
BUILDING.md \
CONTRIBUTING.md \
Makefile-Android \
Makefile-bootstrap \
Makefile-iOS \
Makefile-Standalone \
README.md \
.default-version \
.travis.yml \
.travis/before_install.sh \
.travis/build_esp32.sh \
.travis/build_nrf52840_lock_example.sh \
.travis/prepare_esp32.sh \
.travis/prepare_nrf52840_lock_example.sh \
.travis/script.sh \
bootstrap \
bootstrap-configure \
repos.conf \
$(srcdir)/build/autoconf \
$(srcdir)/build/config \
$(srcdir)/build/cstyle/cstyle.options \
$(srcdir)/build/esp32 \
$(srcdir)/build/jenkins \
$(srcdir)/build/make \
$(srcdir)/build/scripts \
$(srcdir)/certs \
$(NULL)

BUILT_SOURCES = \
.local-version \
BUILT_SOURCES = \
.local-version \
$(NULL)

dist_doc_DATA = \
CHANGELOG \
LICENSE \
dist_doc_DATA = \
CHANGELOG \
LICENSE \
$(NULL)

DISTCLEANFILES = \
.local-version \
DISTCLEANFILES = \
.local-version \
$(NULL)

# There are no source files to lint or prettify in this subdirectory.
Expand Down
Loading

0 comments on commit 5f026ae

Please sign in to comment.