build: Add gradle build system and upgrade to use jndn version 0.9
Change-Id: I5e8c355dd3ad1e87d2ac06ec78dcf8fa66b9bc08
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..1aadacf
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,122 @@
+buildscript {
+ repositories {
+ jcenter()
+ mavenCentral()
+ }
+}
+
+apply plugin: 'java'
+apply plugin: 'maven'
+apply plugin: 'signing'
+
+group = 'com.intel.jndn.mock'
+version = '1.0.1-SNAPSHOT'
+
+sourceCompatibility = JavaVersion.VERSION_1_7
+targetCompatibility = JavaVersion.VERSION_1_7
+compileJava.options.encoding = 'UTF-8'
+
+repositories {
+ jcenter()
+ mavenLocal()
+ mavenCentral()
+}
+
+dependencies {
+ compile 'net.named-data:jndn:0.9'
+ testCompile 'junit:junit:4.12'
+}
+
+task javadocJar(type: Jar) {
+ classifier = 'javadoc'
+ from javadoc
+}
+
+task sourcesJar(type: Jar) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+}
+
+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
+}
+
+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-mock'
+ packaging 'jar'
+ description 'Tools for testing NDN Java code without using network IO'
+ url 'https://github.com/01org/jndn-mock'
+
+ scm {
+ connection 'scm:git:https://github.com/01org/jndn-mock'
+ developerConnection 'scm:git:https://github.com/01org/jndn-mock'
+ url 'https://github.com/01org/jndn-mock'
+ }
+
+ 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'
+ }
+ }
+ }
+ }
+ }
+}