/*
 * 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; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

evaluationDependsOn(xpackModule('core'))

apply plugin: 'elasticsearch.internal-es-plugin'
apply plugin: 'elasticsearch.internal-cluster-test'
apply plugin: 'elasticsearch.internal-java-rest-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'

esplugin {
  name = 'logsdb'
  description = 'A plugin for logsdb related functionality'
  classname ='org.elasticsearch.xpack.logsdb.LogsDBPlugin'
  extendedPlugins = ['x-pack-core']
}
base {
  archivesName = 'x-pack-logsdb'
}

restResources {
  restApi {
    include 'bulk', 'search', '_common', 'indices', 'index', 'cluster', 'data_stream', 'ingest', 'cat', 'capabilities', 'esql.query'
  }
}

dependencies {
  compileOnly project(path: xpackModule('core'))
  testImplementation project(':modules:data-streams')
  testImplementation(testArtifact(project(xpackModule('core'))))
  javaRestTestImplementation(testArtifact(project(xpackModule('spatial'))))
  internalClusterTestImplementation(testArtifact(project(xpackModule('core'))))
}

tasks.named("javaRestTest").configure {
  usesDefaultDistribution("Requires a bunch of xpack plugins")
}

tasks.named('yamlRestTest') {
  usesDefaultDistribution("Requires a bunch of xpack plugins")
}
