plugins {
    id 'java'

    id 'application'
    id 'jvm-test-suite'
    id 'com.google.cloud.tools.jib' version '3.4.5'
}

application {
    mainClass = 'nu.marginalia.query.QueryMain'
    applicationName = 'query-service'
}

tasks.distZip.enabled = false

apply from: "$rootProject.projectDir/docker.gradle"


java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(rootProject.ext.jvmVersion))
    }
}

apply from: "$rootProject.projectDir/srcsets.gradle"

dependencies {
    implementation project(':code:common:config')
    implementation project(':code:common:model')
    implementation project(':code:common:db')
    implementation project(':code:common:service')
    implementation project(':code:common:renderer')
    implementation project(':code:index:api')

    implementation project(':code:functions:search-query')
    implementation project(':code:functions:search-query:api')
    implementation project(':code:functions:link-graph:api')
    implementation project(':code:functions:link-graph:aggregate')
    implementation project(':code:functions:nsfw-domain-filter')

    implementation libs.bundles.slf4j

    implementation dependencies.create(libs.spark.get()) {
        exclude group: 'org.eclipse.jetty'
    }
    implementation libs.bundles.jetty
    implementation libs.gson
    implementation libs.prometheus
    implementation libs.notnull
    implementation libs.guava
    implementation dependencies.create(libs.guice.get()) {
        exclude group: 'com.google.guava'
    }
    implementation libs.bundles.mariadb
    implementation libs.guava
    libs.bundles.grpc.get().each {
        implementation dependencies.create(it) {
            exclude group: 'com.google.guava'
        }
    }



    testImplementation libs.bundles.slf4j.test
    testImplementation libs.bundles.junit
    testImplementation libs.mockito

}

