/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the "Elastic License
 * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
 * Public License v 1"; you may not use this file except in compliance with, at
 * your election, the "Elastic License 2.0", the "GNU Affero General Public
 * License v3.0 only", or the "Server Side Public License, v 1".
 */

apply plugin: 'elasticsearch.build'

dependencies {
  api project(":test:framework")
  api project(":libs:x-content")

  // json schema validation dependencies
  implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
  implementation "com.networknt:json-schema-validator:${versions.networknt_json_schema_validator}"
  implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
  implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
  implementation "org.apache.commons:commons-compress:1.26.1"
  implementation "commons-io:commons-io:2.15.1"
  implementation "org.apache.commons:commons-lang3:${versions.commons_lang3}"
}

// the main files are actually test files, so use the appropriate forbidden api sigs
tasks.named('forbiddenApisMain').configure {
  replaceSignatureFiles 'jdk-signatures', 'es-all-signatures', 'es-test-signatures'
}

// TODO: should we have licenses for our test deps?
tasks.named("dependencyLicenses").configure { enabled = false }
tasks.named("dependenciesInfo").configure { enabled = false }

tasks.named("thirdPartyAudit").configure {
  ignoreMissingClasses(
          // classes are missing
          'com.github.luben.zstd.BufferPool',
          'com.github.luben.zstd.ZstdInputStream',
          'com.github.luben.zstd.ZstdOutputStream',
          'org.brotli.dec.BrotliInputStream',
          'org.objectweb.asm.AnnotationVisitor',
          'org.objectweb.asm.Attribute',
          'org.objectweb.asm.ClassReader',
          'org.objectweb.asm.ClassVisitor',
          'org.objectweb.asm.FieldVisitor',
          'org.objectweb.asm.Label',
          'org.objectweb.asm.MethodVisitor',
          'org.objectweb.asm.Type',
          'org.slf4j.Logger',
          'org.slf4j.LoggerFactory',
          'org.tukaani.xz.DeltaOptions',
          'org.tukaani.xz.FilterOptions',
          'org.tukaani.xz.LZMA2InputStream',
          'org.tukaani.xz.LZMA2Options',
          'org.tukaani.xz.LZMAInputStream',
          'org.tukaani.xz.LZMAOutputStream',
          'org.tukaani.xz.MemoryLimitException',
          'org.tukaani.xz.UnsupportedOptionsException',
          'org.tukaani.xz.XZ',
          'org.tukaani.xz.XZOutputStream',
  )
}
