/*
 * 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 = 'GoCD Common Module'

java {
  // For use of server-only plugins
  registerFeature('serverOnly') {
    usingSourceSet(sourceSets.create('serverOnly'))
  }
}
CapabilitySupport.extendMain(project, 'serverOnly')

dependencies {
  api project(':domain')
  implementation project(':commandline')
  implementation project(':base')
  implementation project(':util')
  implementation project(':plugin-infra:go-plugin-api')
  implementation project(':plugin-infra:go-plugin-access')
  serverOnlyImplementation(project(':plugin-infra:go-plugin-access')) { capabilities { requireFeature('server-only') } }
  api project(':config:config-api')
  serverOnlyApi(project(':config:config-api')) { capabilities { requireFeature('server-only') } }
  implementation project.deps.apacheHttpMime
  implementation project.deps.commonsCollections4
  implementation project.deps.commonsIO
  implementation project.deps.commonsText
  implementation project.deps.commonsLang3
  implementation project.deps.gson
  api project.deps.springContext
  annotationProcessor project.deps.lombok
  compileOnly project.deps.lombok
  compileOnly project.deps.jetBrainsAnnotations

  testImplementation(testFixtures(project(':config:config-api')))
  testImplementation(testFixtures(project(':domain')))
  testImplementation project.deps.junit5Api
  testRuntimeOnly project.deps.junit5Engine
  testRuntimeOnly project.deps.junit5PlatformLauncher
  testImplementation project.deps.junit5Params
  testImplementation project.deps.mockitoJunit5
  testImplementation project.deps.assertJ
  testImplementation project.deps.systemStubs
  testImplementation project.deps.jsonUnit

  testFixturesApi project(":config:config-api")
  testFixturesApi project.deps.assertJ
  testFixturesImplementation(testFixtures(project(':domain')))
  testFixturesImplementation(testFixtures(project(':test:test-utils')))
  testFixturesImplementation project.deps.mockitoCore
}

