
plugins {
    id 'java'
    id "pmd"
}

repositories {
//    mavenLocal()
    mavenCentral()
    gradlePluginPortal()
    maven {
        url = "https://maven.cubrid.org/"
    }
}

pmd {
    ruleSetFiles = files("../dodexstart.xml")
    ruleSets = []
    ignoreFailures = true
    toolVersion = "7.13.0"
    consoleOutput = false
    rulesMinimumPriority = 5
}

def vertxVersion = "4.5.26"

ext {
    hibernateVersion = "7.2.5.Final"
}

dependencies {
    implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
    implementation "io.quarkus:quarkus-rest-jackson"
    implementation "io.vertx:vertx-rx-java3:$vertxVersion"
    implementation "io.smallrye.reactive:smallrye-mutiny-vertx-jdbc-client"
    implementation "io.quarkus:quarkus-mutiny:${quarkusPlatformVersion}"
    implementation "io.vertx:vertx-jdbc-client:$vertxVersion"
    implementation "io.quarkus:quarkus-reactive-mysql-client"
    implementation "io.quarkus:quarkus-reactive-pg-client"
    implementation "io.quarkus:quarkus-reactive-db2-client"
    implementation "io.quarkiverse.neo4j:quarkus-neo4j:6.4.1"
    implementation "io.quarkus:quarkus-vertx:${quarkusPlatformVersion}"
    implementation("jakarta.xml.bind:jakarta.xml.bind-api")
    implementation "io.quarkus:quarkus-jdbc-h2:${quarkusPlatformVersion}"
    implementation "io.quarkus:quarkus-jdbc-mariadb:${quarkusPlatformVersion}"
    implementation "io.quarkus:quarkus-jdbc-postgresql:${quarkusPlatformVersion}"
    implementation "io.quarkus:quarkus-jdbc-db2:${quarkusPlatformVersion}"
    implementation "io.quarkiverse.jdbc:quarkus-jdbc-sqlite:3.0.11"
    implementation "cubrid:cubrid-jdbc:11.0.13.0378"
    implementation "io.vertx:vertx-rx-java2:$vertxVersion"
    implementation "com.google.firebase:firebase-admin:9.3.0"
    implementation "com.google.guava:guava:33.5.0-jre"
    implementation "io.quarkus:quarkus-reactive-oracle-client:${quarkusPlatformVersion}"
    implementation "io.quarkus:quarkus-reactive-mssql-client:${quarkusPlatformVersion}"
    implementation("io.quarkus:quarkus-hibernate-reactive:${quarkusPlatformVersion}")

//    testImplementation "io.quarkus:quarkus-junit5:${quarkusPlatformVersion}"
//    testImplementation "io.rest-assured:rest-assured"
}

group = "dmo.fs.db"
version = "3.20.0"

java {
    sourceCompatibility = JavaVersion.VERSION_24
    targetCompatibility = JavaVersion.VERSION_24
}

compileJava {
    options.encoding = "UTF-8"
    options.compilerArgs << "-Xlint:unchecked"
}

tasks.withType(JavaExec).configureEach {
    jvmArgs += ["--enable-native-access=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED"]

    if(JavaVersion.current() >= JavaVersion.VERSION_24) {
         jvmArgs += ["--sun-misc-unsafe-memory-access=allow"]
    }
}


jar {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
compileTestJava {
    options.encoding = 'UTF-8'
}

test {
    useJUnitPlatform()
    testLogging {
        events = ["PASSED", "FAILED", "SKIPPED"]
    }
}
