build+src: Add gradle build system, upgrade jndn to the latest version (0.10)

[Compilation temporarily broken]

Change-Id: I0908294fe180990c8f5c0213eab09e898f16939a
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..1f498c8
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,176 @@
+buildscript {
+  repositories {
+    mavenLocal()
+    jcenter()
+    mavenCentral()
+  }
+}
+
+plugins {
+  id "org.sonarqube" version "1.2"
+  id 'net.saliman.cobertura' version '2.3.0'
+}
+
+apply plugin: 'java'
+apply plugin: 'maven'
+apply plugin: 'signing'
+apply plugin: 'maven-publish'
+
+group = 'com.intel.jndn.management'
+version = '1.0.1-SNAPSHOT'
+
+sourceCompatibility = JavaVersion.VERSION_1_7
+targetCompatibility = JavaVersion.VERSION_1_7
+compileJava.options.encoding = 'UTF-8'
+
+repositories {
+  mavenLocal()
+  jcenter()
+  mavenCentral()
+  maven {
+    url "https://oss.sonatype.org/content/repositories/snapshots/"
+  }
+}
+
+sourceSets {
+  test {
+    java {
+      exclude '**/*IT.java'
+    }
+  }
+  integrationTest {
+    java {
+      compileClasspath += main.output + test.output
+      runtimeClasspath += main.output + test.output
+      srcDir file('src/test/java')
+      include '**/*IT.java'
+    }
+  }
+}
+
+configurations {
+    integrationTestCompile.extendsFrom testCompile
+    integrationTestRuntime.extendsFrom testRuntime
+}
+
+dependencies {
+  compile 'net.named-data:jndn:0.10'
+  compile 'com.intel.jndn.utils:jndn-utils:1.0.0'
+
+  testCompile 'junit:junit:4.12'
+  testCompile 'com.intel.jndn.mock:jndn-mock:1.0.1'
+  testRuntime 'org.slf4j:slf4j-api:1.7.16'
+}
+
+task javadocJar(type: Jar) {
+  classifier = 'javadoc'
+  from javadoc
+}
+
+task sourcesJar(type: Jar) {
+  classifier = 'sources'
+  from sourceSets.main.allSource
+}
+
+task integrationTest(type: Test) {
+  description 'Compile and run integration tests'
+  testClassesDir = sourceSets.integrationTest.output.classesDir
+  classpath = sourceSets.integrationTest.runtimeClasspath
+}
+
+tasks.withType(Test) {
+  reports.html.destination = file("${reporting.baseDir}/${name}")
+  testLogging {
+    events "passed", "skipped", "failed"
+    showStandardStreams = true
+    exceptionFormat = "full"
+  }
+  outputs.upToDateWhen { false }
+}
+
+if (JavaVersion.current().isJava8Compatible()) {
+  allprojects {
+    tasks.withType(Javadoc) {
+      options.addStringOption('Xdoclint:none', '-quiet')
+    }
+  }
+}
+
+artifacts {
+  archives javadocJar, sourcesJar
+}
+
+publishing {
+  publications {
+    mavenJava(MavenPublication) {
+      artifact javadocJar
+      artifact sourcesJar
+    }
+  }
+}
+
+signing {
+  required { gradle.taskGraph.hasTask("uploadArchives") }
+  sign configurations.archives
+}
+
+uploadArchives {
+  repositories {
+    mavenDeployer {
+      beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+
+      repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+        try {
+          authentication(userName: ossrhUsername, password: ossrhPassword)
+        }
+        catch (Exception e) {
+        }
+      }
+
+      snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
+        try {
+          authentication(userName: ossrhUsername, password: ossrhPassword)
+        }
+        catch (Exception e) {
+        }
+      }
+
+      pom.project {
+        name 'jndn-management'
+        packaging 'jar'
+        description 'Tools for managing an NDN forwarding daemon'
+        url 'https://github.com/01org/jndn-management'
+
+        scm {
+          connection 'scm:git:https://github.com/cawka/jndn-management'
+          developerConnection 'scm:git:https://github.com/01org/jndn-management'
+          url 'https://github.com/01org/jndn-management'
+        }
+
+        licenses {
+          license {
+            name 'GNU Lesser General Public License, Version 3.0+'
+            url 'http://www.gnu.org/licenses/lgpl.html'
+          }
+        }
+
+        developers {
+          developer {
+            id 'andrewbrown'
+            name 'Andrew Brown'
+            url 'https://github.com/andrewsbrown'
+          }
+          developer {
+            id 'cawka'
+            name 'Alexander Afanasyev'
+            email 'aa@cs.ucla.edu'
+          }
+        }
+      }
+    }
+  }
+}
+
+cobertura {
+  coverageFormats = ['html', 'xml']
+}