/*
 * 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 v 3.0 only", or the "Server Side Public License, v 1".
 */

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

esplugin {
  name = 'reindex-management'
  description = 'Reindex management features and endpoints'
  classname = 'org.elasticsearch.reindex.management.ReindexManagementPlugin'
  extendedPlugins = ['reindex']
}

dependencies {
  compileOnly project(path: ':modules:reindex')
  internalClusterTestImplementation project(path: ':modules:reindex')

  testImplementation project(':modules:rest-root')

  clusterModules project(':modules:reindex')
  clusterModules project(":modules:rest-root")
}

restResources {
  restApi {
    include '_common', 'index', 'bulk', 'reindex', 'reindex_get', 'reindex_list', 'reindex_rethrottle', 'delete_by_query', 'tasks', 'capabilities'
  }
}

configurations {
  restTests {
    attributes {
      attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE)
    }
  }
}

artifacts {
  restTests(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test"))
}

testClusters.configureEach {
  module ':modules:rest-root'
}
