plugins {
    id 'java'
    id 'application'
    id 'org.springframework.boot' version '3.3.2'
    id 'io.spring.dependency-management' version '1.1.6'
    id "net.ltgt.errorprone" version "4.0.1"
}


group = 'io.easystartup.suggestfeature'
version = '1.0'

repositories {
    mavenCentral()
    google()
}

application {
    mainClassName = 'io.easystartup.suggestfeature.Main'
}

bootJar {
    mainClass = 'io.easystartup.suggestfeature.Main'
}
compileJava.options.encoding = 'UTF-8'

dependencies {
    implementation group: 'com.amazonaws', name: 'aws-java-sdk-ses', version: '1.12.767'

    implementation 'io.jsonwebtoken:jjwt-api:0.12.5'
    implementation 'io.jsonwebtoken:jjwt-impl:0.12.5'
    implementation 'io.jsonwebtoken:jjwt-jackson:0.12.5'

    implementation 'com.auth0:java-jwt:4.4.0'


    implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.5.0-M2'
    implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
    implementation group: 'org.apache.commons', name: 'commons-text', version: '1.12.0'
    implementation group: 'commons-io', name: 'commons-io', version: '2.16.1'
    implementation group: 'commons-validator', name: 'commons-validator', version: '1.9.0'
    implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.3.1'

    implementation group: 'org.commonmark', name: 'commonmark', version: '0.23.0'

    implementation group: 'org.jsoup', name: 'jsoup', version: '1.18.1'

    // For dotenv file
    implementation group: 'io.github.cdimascio', name: 'dotenv-java', version: '3.0.1'

    implementation group: 'com.fasterxml.uuid', name: 'java-uuid-generator', version: '5.1.0'
    implementation group: 'software.amazon.awssdk', name: 's3', version: '2.27.12'
    implementation group: 'software.amazon.awssdk', name: 'auth', version: '2.27.12'


    implementation group: 'com.google.code.gson', name: 'gson', version: '2.11.0'
    implementation group: 'com.google.guava', name: 'guava', version: '33.2.1-jre'

    implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.5.6'
    implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.5.6'

    implementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '5.1.2'
    implementation group: 'org.xerial.snappy', name: 'snappy-java', version: '1.1.10.5'
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-mongodb', version: '3.3.2'
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '3.3.2'
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jersey', version: '3.3.2'
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '3.3.2'
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: '3.3.2'
    implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: '6.3.1'
    implementation group: 'org.springframework.security', name: 'spring-security-core', version: '6.3.1'

    implementation group: 'org.glassfish.jersey.media', name: 'jersey-media-multipart', version: '3.1.8'
    implementation group: 'dnsjava', name: 'dnsjava', version: '3.6.1'
    implementation group: 'com.github.slugify', name: 'slugify', version: '3.0.7'
    // for transliterator of slugify
    implementation group: 'com.ibm.icu', name: 'icu4j', version: '75.1'

    // kubernetes
    implementation group: 'io.kubernetes', name: 'client-java', version: '20.0.1'
    implementation group: 'com.opencsv', name: 'opencsv', version: '5.9'

    // Resiliency4j
    implementation group: 'io.github.resilience4j', name: 'resilience4j-all', version: '2.2.0'

    errorprone("com.google.errorprone:error_prone_core:2.31.0")


    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}


// Error prone to catch static errors at compile time
tasks.withType(JavaCompile).configureEach {
    options.errorprone.disableWarningsInGeneratedCode = true
    // fix some by default
//    options.errorprone.errorproneArgs.addAll(
//            "-XepPatchChecks:UnnecessaryParentheses,EqualsGetClass,AlmostJavadoc",
//            "-XepPatchLocation:IN_PLACE"
//    )
    options.errorprone.errorproneArgs.addAll(
            "-Xep:MissingSummary:OFF",
            "-Xep:AlmostJavadoc:OFF"
    )
}

test {
    useJUnitPlatform()
}