apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'com.bmuschko.nexus'
apply plugin: 'maven-publish'

buildscript {
  repositories {
    jcenter()
  }

  dependencies {
    classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'

  }
}

sourceCompatibility = 1.8

jar {
  manifest {
    attributes 'Implementation-Title': 'Cyclops Jackson', 'Implementation-Version': version
  }
}

repositories {
  mavenCentral()

}

configurations {
  provided
}

dependencies {

  compile project(':cyclops')
  compile 'com.fasterxml.jackson.core:jackson-databind:'+jacksonVersion
  provided group: 'org.projectlombok', name: 'lombok', version: lombokVersion
  testCompile project(':cyclops-reactive-collections')
  testCompile 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:'+jacksonVersion
  testCompile group: 'junit', name: 'junit', version: '4.12'
  testCompile group: 'junit', name: 'junit', version: '4.12'
  testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
  testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'


}

sourceSets {
  main.compileClasspath += [configurations.provided]
  test.compileClasspath += [configurations.provided]
  test.runtimeClasspath += [configurations.provided]
}

eclipse.classpath.plusConfigurations += [configurations.provided]  // Eclipse users only

test {
  systemProperties 'property': 'value'
}

modifyPom {
  project {
    name 'cyclops-jackson'
    description 'Cyclops integration for Jackson'
    url 'https://github.com/oath/cyclops'
    inceptionYear '2015'

    groupId 'com.oath.cyclops'
    artifactId 'cyclops-jackson-integration'
    version "$version"

    scm {
      url 'ssh://git@github.com:aol/cyclops.git'
      connection 'ssh://git@github.com:aol/cyclops.git'
      developerConnection 'ssh://git@github.com:aol/cyclops.git'
    }

    licenses {
      license {
        name 'The MIT License (MIT)'
        url 'https://github.com/oath/cyclops/blob/master/licence.txt'
        distribution 'repo'
      }
    }

    developers {
      developer {
        id 'johnmcclean'
        name 'John McClean'
        email 'john.mcclean@oath.com'
      }
    }
  }
}

extraArchive {
  sources = true
  tests = true
  javadoc = true
}

nexus {
  sign = true
  repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
  snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
}

