build: Switch to gradle build system
Change-Id: I0a11a49860a361684815dedd07e992d27d497523
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..4f16ee0
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,148 @@
+buildscript {
+ repositories {
+ jcenter()
+ mavenCentral()
+ }
+}
+
+apply plugin: 'java'
+apply plugin: 'maven'
+apply plugin: 'signing'
+
+group = 'net.named-data.jndn-extra'
+version = '1.0.1-SNAPSHOT'
+
+sourceCompatibility = JavaVersion.VERSION_1_7
+targetCompatibility = JavaVersion.VERSION_1_7
+compileJava.options.encoding = 'UTF-8'
+
+repositories {
+ jcenter()
+ mavenLocal()
+ mavenCentral()
+ maven {
+ url "https://oss.sonatype.org/content/repositories/snapshots/"
+ }
+}
+
+sourceSets {
+ integrationTest {
+ java {
+ compileClasspath += main.output + test.output
+ runtimeClasspath += main.output + test.output
+ srcDir file('src/integration-test/java')
+ }
+ }
+}
+
+configurations {
+ integrationTestCompile.extendsFrom testCompile
+ integrationTestRuntime.extendsFrom testRuntime
+}
+
+dependencies {
+ compile 'com.google.guava:guava:18.0'
+ compile 'net.named-data:jndn:0.7'
+
+ testCompile 'junit:junit:4.12'
+ testCompile 'com.intel.jndn.mock:jndn-mock:0.11.0'
+}
+
+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
+ }
+ 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-xx utilities'
+ packaging 'jar'
+ description 'Collection of tools to simplify synchronous and asynchronous data transfer over the NDN network'
+ url 'https://github.com/cawka/jndn-utils'
+
+ scm {
+ connection 'scm:git:https://github.com/cawka/jndn-utils'
+ developerConnection 'scm:git:https://github.com/cawka/jndn-utils'
+ url 'https://github.com/cawka/jndn-utils'
+ }
+
+ 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'
+ }
+ }
+ }
+ }
+ }
+}