/*
 * Copyright 2021 EPAM Systems, Inc. (https://www.epam.com/)
 *
 * 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.
 */


plugins {
    id 'java'
    id "jacoco"
    id "org.sonarqube" version "2.6.1"
    id "io.spring.dependency-management" version "1.0.6.RELEASE"
    id "org.springframework.boot" version "2.0.2.RELEASE"
}

group 'com.epam.pipeline'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

bootJar {
    archiveName "monitoring-service.jar"
    manifest {
        attributes(
                "Implementation-Version": "$version")
    }
}

repositories {
    mavenCentral()
}

dependencies {
    // Core library
    implementation project(":cloud-pipeline-common:model")

    configurations {
        all*.exclude module : 'spring-boot-starter-logging'
    }

    // Spring
    implementation group: "org.springframework.boot", name: "spring-boot-starter", version: springBootVersion

    // Logging
    implementation group: "org.apache.logging.log4j", name: "log4j-slf4j-impl", version: log4jVersion
    implementation group: "org.apache.logging.log4j", name: "log4j-api", version: log4jVersion
    implementation group: "org.apache.logging.log4j", name: "log4j-core", version: log4jVersion
    implementation group: "org.apache.logging.log4j", name: "log4j-jcl", version: log4jVersion

    //Lombok
    implementation group: "org.projectlombok", name: "lombok", version: lombokVersion

    // Retrofit
    implementation group: "com.squareup.retrofit2", name: "retrofit", version: retrofitVersion
    implementation group: "com.squareup.retrofit2", name: "converter-jackson", version: retrofitVersion
    implementation group: "com.squareup.okhttp3", name: "okhttp", version: okhttpVersion

    // Jackson
    implementation group: "com.fasterxml.jackson.core", name: "jackson-databind", version: jaksonVersion

    // RxJava
    implementation group: "io.reactivex.rxjava2", name: "rxjava", version: rxjavaVersion

    //K8s
    implementation group: "io.fabric8", name: "kubernetes-client", version: k8sLibraryVersion

    // Elasticsearch
    implementation group: "org.elasticsearch", name: "elasticsearch", version: elasticsearchVersion
    implementation group: "org.elasticsearch.client", name: "elasticsearch-rest-high-level-client", version: elasticsearchVersion
    testImplementation group: "org.elasticsearch.client", name: "transport", version: elasticsearchVersion

    //Tests
    testImplementation group: "org.springframework.boot", name: "spring-boot-starter-test", version: springBootVersion
    testImplementation group: "org.projectlombok", name: "lombok", version: lombokVersion
    testImplementation group: "org.junit.jupiter", name: "junit-jupiter-api", version: junitVersion
    testImplementation group: "org.junit.jupiter", name: "junit-jupiter-engine", version: junitVersion
    testImplementation group: "org.hamcrest", name: "hamcrest-all", version: hamcrestVersion
    testImplementation group: "org.mockito", name: "mockito-core", version: mockitoVersion
    testImplementation group: "org.mockito", name: "mockito-junit-jupiter", version: mockitoVersion
}

test {
    useJUnitPlatform()

    reports {
        html.enabled = true
    }
}
