buildscript {

    dependencies {
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.16'
    }
}

plugins {
    id 'java-library'
    id 'com.google.protobuf' version '0.8.16'
    id 'idea'
    id 'maven-publish'
}
apply from: "${project.rootProject.projectDir}/createTestBackends.gradle"

dependencies {
    testRuntimeOnly 'net.brutex.ai:dl4j-test-resources:1.0.1-SNAPSHOT'

    if(withCuda()) {
        implementation "org.bytedeco:cuda"
    }

    implementation 'com.google.protobuf:protobuf-java'
    implementation 'org.bytedeco:javacpp'
    implementation 'com.google.flatbuffers:flatbuffers-java'
    implementation 'com.google.guava:guava'
    implementation 'org.apache.commons:commons-lang3'
    implementation 'commons-io:commons-io'
    implementation 'org.slf4j:slf4j-api'
    implementation 'com.fasterxml.jackson.core:jackson-core'
    implementation 'com.fasterxml.jackson.core:jackson-annotations'
    implementation 'com.fasterxml.jackson.core:jackson-databind'
    implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
    implementation 'org.apache.commons:commons-collections4'
    implementation 'org.apache.commons:commons-compress'
    implementation 'com.jakewharton.byteunits:byteunits'
    implementation 'org.apache.commons:commons-math3'
    implementation 'net.ericaro:neoitertools'
    implementation 'commons-net:commons-net'
    implementation 'com.github.oshi:oshi-core'

    api project(':cavis-dnn:cavis-dnn-common')
}

sourceSets {
    main {
        proto {
            //srcDirs += 'src/main/protobuf/tf/
            srcDirs += 'src/main/protobuf/tf'
            srcDirs += 'src/main/protobuf/nd4j'
            srcDirs += 'src/main/protobuf/onnx'

        }
        java {
            srcDir 'src/main/java'
        }
    }
}

protobuf {
    // Configure the protoc executable
    protoc {
        // Download from repositories
        artifact = 'com.google.protobuf:protoc:3.0.0'
    }
}

idea {
    module {
        // proto files and generated Java files are automatically added as
        // source dirs.
        // If you have additional sources, add them here:
        //sourceDirs += file("/path/sto/other/source");
    }
}