 plugins {
     id 'application'
     id 'java-library'
     id 'idea'
 }

if (gradle.ext.docgenExists) {
 apply plugin: 'com.google.cloud.verticals.foundations.dataharmonization.docgen'
 docgen.destinationDirectory = file("${project.projectDir.parent}/g3doc")
}

sourceSets {
    test {
        java {
            exclude '**/google/internal/**'
        }
    }
}

 group 'com.google.cloud.verticals.foundations.dataharmonization'

 mainClassName = 'com.google.cloud.verticals.foundations.dataharmonization.Main'

 repositories {
     mavenCentral()
 }

 dependencies {
     api project(":proto")
     api project(":transpiler")
     implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
     implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
     implementation group: 'com.google.guava', name: 'guava', version: "${guavaVersion}"
     implementation group: 'commons-cli', name: 'commons-cli', version: '1.4'
     implementation group: 'commons-codec', name: 'commons-codec', version: '1.13'
     implementation group: 'javax.json', name: 'javax.json-api', version: '1.0'
     implementation group: 'joda-time', name: 'joda-time', version: '2.10.5'
     implementation group: "org.apache.beam", name: "beam-sdks-java-core", version: "2.52.0"

     if (gradle.ext.has("annotationProcessorExists") && gradle.ext.annotationProcessorExists){
         annotationProcessor ("com.google.cloud.verticals.foundations.dataharmonization:annotation_processor")
     }

     testImplementation project(":testutil")
     testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version: '2.1'
     testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
     testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.12.0'
     testImplementation group: 'com.google.errorprone', name: 'error_prone_annotations', version: '2.13.1'
     testImplementation group: 'com.google.truth', name: 'truth', version: '1.1.3'
     testImplementation group: 'junit', name: 'junit', version: '4.13.2'
     testImplementation 'com.google.jimfs:jimfs:1.1'

     compileOnly         "com.google.auto.value:auto-value-annotations:1.7.4"
     annotationProcessor "com.google.auto.value:auto-value:1.7.4"

     constraints {
         implementation('org.apache.logging.log4j:log4j-api:2.16.0') {
             because 'https://nvd.nist.gov/vuln/detail/CVE-2021-44228'
         }
     }
 }