apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: "com.vanniktech.maven.publish.base"

repositories {
  mavenCentral()
  mavenLocal()
  maven {
    url "https://repository.mulesoft.org/nexus/content/repositories/public/"
  }
  maven {
    url "https://linkedin.jfrog.io/artifactory/open-source/" // GMA, pegasus
  }
}
dependencies {
  implementation project(":feathr-config")
  implementation project(":feathr-data-models")
  implementation project(path: ':feathr-data-models', configuration: 'dataTemplate')
  implementation spec.product.mvel
  implementation spec.product.jsqlparser

  testImplementation spec.product.testing
  testImplementation spec.product.mockito
  testImplementation spec.product.equalsverifier
  testImplementation spec.product.mockito_inline

  implementation spec.product.jackson.dataformat_yaml
  implementation spec.product.jackson.jackson_databind
  implementation spec.product.guava
}

javadoc {
  options.noQualifiers 'all'
}

java {
  withSourcesJar()
  withJavadocJar()
}

tasks.withType(Javadoc) {
  options.addStringOption('Xdoclint:none', '-quiet')
  options.addStringOption('encoding', 'UTF-8')
  options.addStringOption('charSet', 'UTF-8')
}

test {
  maxParallelForks = 1
  forkEvery = 1
  // need to keep a lower heap size (TOOLS-296596)
  minHeapSize = "512m"
  useTestNG()
}

// Required for publishing to local maven
publishing {
  publications {
    mavenJava(MavenPublication) {
      artifactId = 'feathr-compute'
      from components.java
      versionMapping {
        usage('java-api') {
          fromResolutionOf('runtimeClasspath')
        }
        usage('java-runtime') {
          fromResolutionResult()
        }
      }
    }
  }
}
