description = 'GAPIC library for {{name}}'
group = 'com.google.cloud'
version = (version == 'unspecified') ? '0.0.0-SNAPSHOT' : version

compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

dependencies {
  api 'com.google.api:gax:{{version.gax}}'
  testImplementation 'com.google.api:gax:{{version.gax}}:testlib'
  api 'com.google.api:gax-httpjson:{{version.gax_httpjson}}'
  testImplementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib'
  testImplementation '{{maven.junit_junit}}'

  // TODO: remove when dropping Java 8 support.
  // https://github.com/googleapis/gapic-generator-java/issues/888
  implementation '{{maven.javax_annotation_javax_annotation_api}}'

  {{extra_deps}}
}

task smokeTest(type: Test) {
  filter {
    includeTestsMatching "*SmokeTest"
    setFailOnNoMatchingTests false
  }
}

test {
  exclude "**/*SmokeTest*"
}

clean {
  delete 'all-jars'
}

task allJars(type: Copy) {
  dependsOn test, jar
  into 'all-jars'
  // Replace with `from configurations.testRuntimeClasspath, jar` to include test dependencies
  from configurations.runtimeClasspath, jar
}
