Prepare release 2.8

Change-Id: I98c36a7763387cd27df88713e68035dff222b187
diff --git a/.jenkins.d/01-deps.sh b/.jenkins.d/01-deps.sh
index db2d808..d3709b5 100755
--- a/.jenkins.d/01-deps.sh
+++ b/.jenkins.d/01-deps.sh
@@ -7,19 +7,48 @@
 set -x
 
 if has OSX $NODE_LABELS; then
+    FORMULAE=(boost pkg-config libxml2)
+    if [[ -n $USE_OPENSSL_1_1 ]]; then
+        FORMULAE+=(openssl@1.1)
+    else
+        FORMULAE+=(openssl)
+    fi
+
     brew update
-    brew upgrade
-    brew install boost pkg-config cryptopp openssl
-    brew install libxml2
-    brew link --force libxml2
+    if [[ -n $TRAVIS ]]; then
+        # Travis images come with a large number of brew packages
+        # pre-installed, don't waste time upgrading all of them
+        for FORMULA in "${FORMULAE[@]}"; do
+            brew outdated $FORMULA || brew upgrade $FORMULA
+        done
+    else
+        brew upgrade
+    fi
+    brew install "${FORMULAE[@]}"
     brew cleanup
 fi
 
 if has Ubuntu $NODE_LABELS; then
     sudo apt-get -qq update
-    sudo apt-get -qq install build-essential pkg-config libboost-all-dev \
-                             libcrypto++-dev libsqlite3-dev libssl-dev
-    sudo apt-get install -qq -y python-setuptools python-dev python-pygraphviz python-kiwi
-    # sudo apt-get install -qq -y python-pygoocanvas python-gnome2
-    # sudo apt-get install -qq -y python-rsvg ipython
+    sudo apt-get -qy install build-essential pkg-config libboost-all-dev \
+                             libsqlite3-dev libssl-dev
+
+    if [[ $JOB_NAME == *"code-coverage" ]]; then
+        sudo apt-get -qy install gcovr lcov libgd-perl
+    fi
+fi
+
+if has Ubuntu-16.04 $NODE_LABELS; then
+    sudo apt-get -qy install python-setuptools python-dev python-pygraphviz castxml \
+                             python-kiwi python-gnome2 ipython libcairo2-dev python3-gi \
+                             libgirepository1.0-dev python-gi python-gi-cairo \
+                             gir1.2-gtk-3.0 gir1.2-goocanvas-2.0 python-pip
+    sudo pip install pygraphviz pycairo PyGObject pygccxml
+elif has Ubuntu $NODE_LABELS; then
+    sudo apt-get -qy install build-essential libsqlite3-dev libboost-all-dev libssl-dev \
+                             git python3-setuptools castxml \
+                             gir1.2-goocanvas-2.0 gir1.2-gtk-3.0 libgirepository1.0-dev \
+                             python3-dev python3-gi python3-gi-cairo \
+                             python3-pip python3-pygraphviz python3-pygccxml
+    sudo pip3 install kiwi
 fi
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index f0fb72e..58599ea 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -1,10 +1,11 @@
 #!/usr/bin/env bash
-set -x
 set -e
 
 JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
 source "$JDIR"/util.sh
 
+set -x
+
 pushd ns-3 >/dev/null
 
 git submodule update --init
@@ -13,15 +14,18 @@
 sudo rm -Rf build/ .waf-1* .waf3-1*
 find . -name '*.pyc' | sudo xargs rm -f
 
-# Configure/build in debug mode
 if has OSX $NODE_LABELS; then
     export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig"
+    if [[ -n $USE_OPENSSL_1_1 ]]; then
+        OPENSSL="--with-openssl=/usr/local/opt/openssl@1.1"
+    fi
 fi
-./waf -j${WAF_JOBS:-1} configure -d debug --enable-examples --enable-tests $EXTRA_FLAGS
+
+./waf -j${WAF_JOBS:-1} configure -d debug --enable-examples --enable-tests $OPENSSL
 ./waf -j${WAF_JOBS:-1} build
 
 # Install
-sudo ./waf -j${WAF_JOBS:-1} install
+sudo_preserve_env PATH -- ./waf -j${WAF_JOBS:-1} install
 
 if has Linux $NODE_LABELS; then
     sudo ldconfig
diff --git a/.jenkins.d/20-tests.sh b/.jenkins.d/20-tests.sh
index bf14236..bf0bfee 100755
--- a/.jenkins.d/20-tests.sh
+++ b/.jenkins.d/20-tests.sh
@@ -1,40 +1,19 @@
 #!/usr/bin/env bash
-set -x
+set -e
 
 JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
 source "$JDIR"/util.sh
 
-set -e
+set -x
 
 pushd ns-3 >/dev/null
 
-BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; v = _cache.BOOST_VERSION.split('_'); print int(v[0]) * 100000 + int(v[1]) * 100;")
-
-ut_log_args() {
-    if (( BOOST_VERSION >= 106200 )); then
-        echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
-    else
-        if [[ -n $XUNIT ]]; then
-            echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
-                 --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
-        else
-            echo --log_level=test_suite
-        fi
-    fi
-}
-
-ASAN_OPTIONS="color=always"
-ASAN_OPTIONS+=":detect_leaks=false"
-ASAN_OPTIONS+=":detect_stack_use_after_return=true"
-ASAN_OPTIONS+=":check_initialization_order=true"
-ASAN_OPTIONS+=":strict_init_order=true"
-ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
-ASAN_OPTIONS+=":detect_container_overflow=false"
-ASAN_OPTIONS+=":strict_string_checks=true"
-ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
-export ASAN_OPTIONS
+export BOOST_TEST_BUILD_INFO=1
+export BOOST_TEST_COLOR_OUTPUT=1
+export BOOST_TEST_DETECT_MEMORY_LEAK=0
+export BOOST_TEST_LOGGER=HRF,test_suite,stdout:XML,all,build/xunit-log.xml
 
 # Run unit tests
-./waf --run "ndnSIM-unit-tests $(ut_log_args)"
+./waf --run "ndnSIM-unit-tests"
 
 popd >/dev/null
diff --git a/.jenkins.d/README.md b/.jenkins.d/README.md
new file mode 100644
index 0000000..7c78349
--- /dev/null
+++ b/.jenkins.d/README.md
@@ -0,0 +1,33 @@
+CONTINUOUS INTEGRATION SCRIPTS
+==============================
+
+Environment Variables Used in Build Scripts
+-------------------------------------------
+
+- `NODE_LABELS`: the variable defines a list of OS properties.  The set values are used by the
+  build scripts to select proper behavior for different OS.
+
+  The list should include at least `[OS_TYPE]`, `[DISTRO_TYPE]`, and `[DISTRO_VERSION]`.
+
+  Possible values for Linux:
+
+  * `[OS_TYPE]`: `Linux`
+  * `[DISTRO_TYPE]`: `Ubuntu`
+  * `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`
+
+  Possible values for macOS:
+
+  * `[OS_TYPE]`: `OSX`
+  * `[DISTRO_TYPE]`: `OSX` (can be absent)
+  * `[DISTRO_VERSION]`: `OSX-10.12`, `OSX-10.13`, `OSX-10.14`
+
+- `JOB_NAME`: optional variable to define type of the job.  Depending on the defined job type,
+  the build scripts can perform different tasks.
+
+  Possible values:
+
+  * empty: default build process
+  * `code-coverage` (Ubuntu Linux is assumed): debug build with tests and code coverage analysis
+  * `limited-build`: only a single debug build with tests
+
+- `WAF_JOBS`: number of parallel build jobs used by waf, defaults to 1.
diff --git a/.jenkins.d/util.sh b/.jenkins.d/util.sh
index a89bc27..8ddc4ba 100755
--- a/.jenkins.d/util.sh
+++ b/.jenkins.d/util.sh
@@ -16,3 +16,22 @@
     set ${saved_xtrace}
     return ${ret}
 }
+
+sudo_preserve_env() {
+    local saved_xtrace
+    [[ $- == *x* ]] && saved_xtrace=-x || saved_xtrace=+x
+    set +x
+
+    local vars=()
+    while [[ $# -gt 0 ]]; do
+        local arg=$1
+        shift
+        case ${arg} in
+            --) break ;;
+            *)  vars+=("${arg}=${!arg}") ;;
+        esac
+    done
+
+    set ${saved_xtrace}
+    sudo env "${vars[@]}" "$@"
+}