plugins {
    id 'java'
    id 'org.springframework.boot' version '3.5.5'
    id 'io.spring.dependency-management' version '1.1.7'
}

group = 'com.seasonthon'
version = '0.0.1-SNAPSHOT'
description = 'everflow'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
    google()
}

dependencies {
    /* ====== Spring Web / Validation ====== */
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-validation'

    /* ====== Data/JPA/DB ====== */
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-jdbc'
    runtimeOnly 'com.mysql:mysql-connector-j'

    /* ====== Security / OAuth2 / Resource Server (JWT 검증) ====== */
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
    implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
    implementation 'com.auth0:java-jwt:4.5.0'

    /* ====== 캐시 라이브러리 (Caffeine, Redis) ====== */
    implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
    implementation 'org.springframework.boot:spring-boot-starter-data-redis'

    /* ====== AWS SDK (S3) ====== */
    implementation platform('software.amazon.awssdk:bom:2.20.27')
    implementation 'software.amazon.awssdk:s3'

    /* ====== API 문서 ====== */
    implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.11'

    /* ====== Lombok ====== */
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'

    /* ====== QueryDSL (JPA / jakarta) ====== */
    implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
    annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
    annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
    annotationProcessor 'jakarta.persistence:jakarta.persistence-api'



    /* ====== 개발 편의 / 테스트 ====== */
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.security:spring-security-test'
    testImplementation 'org.mockito:mockito-core'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.named('test') {
    useJUnitPlatform()
}
