buildscript {
  repositories {
    jcenter()
    mavenCentral()
  }
}

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'

group = 'net.named-data.jndn-extra'
version = '1.0.2-SNAPSHOT'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
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:25.1-jre'
  compile 'net.named-data:jndn:0.17'

  testCompile 'junit:junit:4.12'
  testCompile 'net.named-data.jndn-extra:jndn-mock:1.1.1'
}

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'
          }
        }
      }
    }
  }
}
