sync: Switch code to use ndn-cxx

Thic commit also moves code to ndn::chronoshare namespace

Change-Id: I6eae8cab53fd68faa0e9523d166dbb60d1b59a95
diff --git a/.Jenkinsfile b/.Jenkinsfile
index c1e0090..f4f3325 100644
--- a/.Jenkinsfile
+++ b/.Jenkinsfile
@@ -1,11 +1,7 @@
-//////////////////////
+#!/usr/bin/env groovy
 
-stage 'Checkout from git'
+stage 'Starting CI check'
 node {
-    deleteDir()
-    git url: 'http://gerrit.named-data.net/ndn-tools'
-    sh "git fetch origin ${GERRIT_REFSPEC} && git checkout FETCH_HEAD"
-    stash name: 'code', includes: '**/*, .git/**/*', useDefaultExcludes: false
 }
 
 //////////////////////
@@ -15,32 +11,52 @@
 def labels = [
     "OSX-10.12",
     "Ubuntu-16.04-64bit",
-    "code-coverage"
+    "code-coverage",
 ]
 
 def builds = [:]
 
 // Apparently, cannot use for-loop iteration, see https://issues.jenkins-ci.org/browse/JENKINS-27421
 for (int i = 0; i < labels.size(); i++) {
-    String label = labels.get(i);
+  String label = labels.get(i);
 
-    builds[label] = {
-        node(label) {
-            wrap([$class: 'hudson.plugins.ansicolor.AnsiColorBuildWrapper', colorMapName: 'xterm']) {
-                deleteDir()
-                unstash "code"
+  builds[label] = {
+    node(label) {
+      wrap([$class: 'hudson.plugins.ansicolor.AnsiColorBuildWrapper', colorMapName: 'xterm']) {
 
-                sh "XUNIT=yes ./.jenkins"
+        deleteDir()
+        git url: 'https://gerrit.named-data.net/ChronoShare'
+        sh "git fetch origin ${GERRIT_REFSPEC} && git checkout FETCH_HEAD"
 
-                if (label == "code-coverage") {
-                  step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'build/coverage.xml', failNoReports: true, failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
-                } else {
-                  // don't publish test results for code coverage run
-                  step([$class: 'XUnitBuilder', testTimeMargin: '50000', thresholdMode: 1, tools: [[$class: 'BoostTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: 'build/xunit*.xml', skipNoTestFiles: true, stopProcessingIfError: true]]])
-                }
-            }
+        withEnv(["NODE_LABELS=\"$label\""]) {
+          sh "./.jenkins"
         }
+
+        if (label == "code-coverage") {
+          publishHTML(target: [
+                      allowMissing: false,
+                               alwaysLinkToLastBuild: false,
+                               keepAll: true,
+                               reportDir: 'build/coverage',
+                               reportFiles: 'index.html',
+                               reportName: "GCOVR Coverage Report"
+                               ])
+          // CoverturaPublisher is not yet supported by pipelines, see https://issues.jenkins-ci.org/browse/JENKINS-30700
+          // step([$class: 'CoberturaPublisher',
+          //       coberturaReportFile: 'build/coverage.xml',
+          //       autoUpdateHealth: false, autoUpdateStability: false, zoomCoverageChart: true,
+          //       failNoReports: true, failUnhealthy: false, failUnstable: false,
+          //       maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'UTF-8'])
+        } else {
+          // don't publish test results for code coverage run
+          step([$class: 'XUnitBuilder',
+                testTimeMargin: '50000', thresholdMode: 1,
+                tools: [[$class: 'BoostTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: true,
+                         pattern: 'build/xunit*.xml', skipNoTestFiles: true, stopProcessingIfError: true]]])
+        }
+      }
     }
+  }
 }
 
 parallel builds