plugins {
    id 'java'
    id 'idea'

    // Spring
    id 'org.springframework.boot' version '3.3.5'
    id 'io.spring.dependency-management' version '1.1.7'

    // GraalVM
    id 'org.graalvm.buildtools.native' version '0.9.28'
}

group 'xyz.atsumeru.web'
version '1.3'

compileJava.options.encoding = 'UTF-8'
System.setProperty('file.encoding', 'UTF-8')

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

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

    developmentOnly
    runtimeClasspath {
        extendsFrom developmentOnly
    }
}

bootJar {
    manifest {
        attributes(
                'Implementation-Title':  'Atsumeru',
                'Implementation-Version': archiveVersion
        )
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.50"

    // AnnotationsProcessors
    annotationProcessor 'org.projectlombok:lombok'
    compileOnly 'org.projectlombok:lombok'

    // Spring Boot
    implementation 'org.springframework.boot:spring-boot-starter-web'

    // Spring Security
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.security:spring-security-web'

    // OpenAPI & SwaggerUI
    implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'

    // ORM
    implementation "com.j256.ormlite:ormlite-core:5.1"
    implementation "com.j256.ormlite:ormlite-jdbc:5.1"
    implementation 'org.xerial:sqlite-jdbc:3.41.2.2'

    // CLI ProgressBar
    implementation 'me.tongfei:progressbar:0.10.1'

    // ImageIO extensions (Extended JPEG and WebP support)
    implementation 'com.twelvemonkeys.imageio:imageio-jpeg:3.9.3'
    implementation 'com.twelvemonkeys.imageio:imageio-webp:3.9.3'

    // Image thumbnails creation
    implementation 'net.coobird:thumbnailator:0.4.14'

    // Image palette generation
    implementation 'com.github.trickl:palette:0.1.1'

    // Apache Commons
    implementation 'commons-io:commons-io:2.14.0'
    implementation 'org.apache.commons:commons-compress:1.26.0'

    // Comparators
    implementation "net.grey-panther:natural-comparator:1.1"

    // Caching
    implementation "com.github.ben-manes.caffeine:caffeine:2.9.0"

    // JSON
    implementation 'com.google.code.gson:gson:2.8.9'
    implementation 'org.json:json:20231013'
    implementation "org.apache.clerezza.ext:org.json.simple:0.4"

    // File formats support
    // Content type detection (Apache Tika)
    implementation 'org.apache.tika:tika-core:2.4.1'

    // Extended archives support (7Zip Bindings)
    implementation "net.sf.sevenzipjbinding:sevenzipjbinding:16.02-2.01"
    implementation "net.sf.sevenzipjbinding:sevenzipjbinding-all-platforms:16.02-2.01"

    // ePub (JSOUP parser)
    implementation "org.jsoup:jsoup:1.13.1"

    // FB2 (FB2 Parser)
    implementation files("libs/fb2parser.jar")

    // DjVu (DjVu2Image converter)
    implementation files("libs/DjVu2Image-1.0.jar")

    // PDF (PDFBox)
    implementation 'org.apache.pdfbox:pdfbox:2.0.34'
    implementation 'org.apache.pdfbox:jbig2-imageio:3.0.4'
    implementation 'com.github.jai-imageio:jai-imageio-core:1.4.0'
    implementation 'com.github.jai-imageio:jai-imageio-jpeg2000:1.3.0'
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
    all {
        exclude group: 'commons-logging', module: 'commons-logging'
    }
}