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

plugins {
  id 'java'
  id 'maven'
  id 'signing'
  //id 'checkstyle'
  id 'org.sonarqube' version '2.8'
  id 'net.saliman.cobertura' version '3.0.0'
}

group = 'net.named-data.jndn-extra'
version = '1.2.0'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = 'UTF-8'

repositories {
  mavenLocal()
  jcenter()
  mavenCentral()
  maven {
    url "https://oss.sonatype.org/content/repositories/releases/"
  }
}

configurations {
  checkstyleConfig
}

dependencies {
  compile 'net.named-data:jndn:0.24'

  testCompile 'junit:junit:4.12'
  testRuntime 'org.slf4j:slf4j-api:1.7.30'

  checkstyleConfig 'com.puppycrawl.tools:checkstyle:8.23'
}

task javadocJar(type: Jar) {
  classifier = 'javadoc'
  from javadoc
}

task sourcesJar(type: Jar) {
  classifier = 'sources'
  from sourceSets.main.allSource
}

tasks.withType(JavaCompile) {
  options.deprecation = true
}

tasks.withType(Test) {
  reports.html.destination = file("${reporting.baseDir}/${name}")
  testLogging {
    events "passed", "skipped", "failed"
    showStandardStreams = true
    exceptionFormat = "full"
  }
  outputs.upToDateWhen { false }
}

tasks.withType(Checkstyle) {
  checkstyleClasspath = project.configurations.checkstyleConfig
  checkstyleTest {
    configFile file('config/checkstyle/checkstyle-test.xml')
  }
}

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/named-data/jndn-mock'

        scm {
          connection 'scm:git:https://github.com/named-data/jndn-mock.git'
          developerConnection 'scm:git:ssh://git@github.com/named-data/jndn-mock.git'
          url 'https://github.com/named-data/jndn-mock'
        }

        licenses {
          license {
            name 'GNU Lesser General Public License, Version 3.0+'
            url 'https://www.gnu.org/licenses/lgpl-3.0.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']
}
