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

plugins {
  id 'org.sonarqube' version '2.6.2'
  id 'net.saliman.cobertura' version '2.5.4'
}

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

// group = 'com.intel.jndn.management'
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.26'

  checkstyleConfig "com.puppycrawl.tools:checkstyle:8.22"
}

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/01org/jndn-management'

        scm {
          connection 'scm:git:https://github.com/cawka/jndn-management'
          developerConnection 'scm:git:https://github.com/01org/jndn-management'
          url 'https://github.com/01org/jndn-management'
        }

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

cobertura {
  coverageFormats = ['html', 'xml']
}
