/*
 * Copyright Thoughtworks, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

description = 'API to configure/access cruise-config.xml'

dependencies {
  implementation project(':config:config-api')
  implementation project(':common')
  implementation project(':util')
  implementation(project.deps.jgit) {
    exclude(group: 'org.apache.httpcomponents')
    exclude(module: 'jsch')
    exclude(module: 'jzlib')
  }
  implementation project.deps.springContext
  implementation project.deps.slf4jApi
  implementation project.deps.caffeine
  implementation project.deps.commonsIO
  implementation project.deps.commonsLang3
  implementation project.deps.cloning
  implementation project.deps.jakartaAnnotation
  implementation project.deps.jdom
  if (project.deps.jdom) {
    // Required for use of org.jdom2.xpath.XPathFactory where jaxen is the default impl
    runtimeOnly project.deps.jaxen
  }
  compileOnly project.deps.jetBrainsAnnotations
  annotationProcessor project.deps.lombok
  compileOnly project.deps.lombok

  testImplementation project(":plugin-infra:go-plugin-infra")
  testImplementation(testFixtures(project(":config:config-api")))
  testImplementation(testFixtures(project(':test:test-utils')))
  testImplementation project.deps.junit5Api
  testImplementation project.deps.assertJ
  testImplementation project.deps.xmlUnit
  testRuntimeOnly project.deps.junit5Engine
  testRuntimeOnly project.deps.junit5PlatformLauncher
  testImplementation project.deps.mockitoJunit5

  testFixturesApi(project(':config:config-api')) {
    capabilities { requireFeature('server-only') }
  }
  testFixturesImplementation project(':base')
  testFixturesImplementation project(':util')
}

test {
  systemProperty('go.enforce.server.immutability', 'N')
}

clean {
  delete 'config'
}
