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

plugins {
  id 'java'
  id 'maven'
  id 'signing'
  id 'checkstyle'
  id 'org.sonarqube' version '2.7.1'
  id 'net.saliman.cobertura' version '2.6.1'
}

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

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/"
  }
}

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 {
  checkstyleConfig
  integrationTestCompile.extendsFrom testCompile
  integrationTestRuntime.extendsFrom testRuntime
}

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

  testCompile 'junit:junit:4.12'
  testCompile 'net.named-data.jndn-extra:jndn-mock:1.1.1'
  testRuntime 'org.slf4j:slf4j-api:1.7.28'

  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
}

task integrationTest(type: Test) {
  description 'Compile and run integration tests'
  group = 'verification'

  testClassesDirs = sourceSets.integrationTest.output.classesDirs
  classpath = sourceSets.integrationTest.runtimeClasspath

  mustRunAfter test
}

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
  checkstyleMain {
    exclude 'com/intel/jndn/management/enums/NfdTlv.java'
  }
  checkstyleTest {
    configFile file('config/checkstyle/checkstyle-test.xml')
  }
  checkstyleIntegrationTest {
    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-management'
        packaging 'jar'
        description 'Tools for managing an NDN forwarding daemon'
        url 'https://github.com/named-data/jndn-management'

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

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