/*
 * This file was generated by the Gradle 'init' task.
 *
 * This generated file contains a sample Java library project to get you started.
 * For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
 * User Manual available at https://docs.gradle.org/7.6/userguide/building_java_projects.html
 */

plugins {
    // Apply the java-library plugin for API and implementation separation.
    id 'java-library'
    id 'com.github.johnrengelman.shadow' version '7.1.2'
    id "com.diffplug.spotless" version "6.18.0"
}

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

dependencies {
    // these dependencies are (or should be) available on the cluster itself so no
    // need to bundle these
    compileOnly 'org.apache.hadoop:hadoop-client:3.3.2'
    compileOnly 'org.apache.hive:hive-exec:3.0.0'

    // Use JUnit Jupiter for testing.
    testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
    // hive-exec is needed to make the tests run
    testImplementation 'org.apache.hive:hive-exec:3.1.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
}

tasks.named('test') {
    // Use JUnit Platform for unit tests.
    useJUnitPlatform()
}

java {
    sourceCompatibility = "1.8"
    targetCompatibility = "1.8"
}

shadowJar {
    archivesBaseName = 'featurebyte-hive-udf'
    zip64 = true
}

spotless {
    format 'misc', {
        // define the files to apply `misc` to
        target '*.gradle', '*.md', '.gitignore'

        // define the steps to apply to those files
        trimTrailingWhitespace()
        indentWithSpaces()
        endWithNewline()
    }
    java {
        removeUnusedImports()
        // apply a specific flavor of google-java-format
        googleJavaFormat('1.16.0')
        // fix formatting of type annotations
        formatAnnotations()
    }
}

group = 'com.featurebyte.hive.udf'
version = '1.0.8-SNAPSHOT'
