ext {
    encoding = "UTF-8"

    javaVersion = '1.8'
    junitVersion = '4.12'
    kafkaVersion = '2.0.0'
    jacksonVersion = '2.9.5'
    avroVersion = '1.8.2'
    slf4jVersion = '1.7.21'
    //
    scalaVersion = '2.11.8'
    baseScalaVersion = scalaVersion.split("\\.")[0] + '.' + scalaVersion.split("\\.")[1]
}

project.version = ext.kafkaVersion

task wrapper(type: Wrapper) {
    gradleVersion = '4.9'
}

allprojects {

    plugins.withType(JavaPlugin).whenPluginAdded {

        version = rootProject.version
        sourceCompatibility = rootProject.javaVersion
        libsDirName = 'lib'

        configurations {
            provided
            testCompile.extendsFrom provided
        }

        repositories {

            mavenCentral()
        }

        dependencies {
            compile group: 'org.slf4j', name:'slf4j-api', version: slf4jVersion
            compile group: 'org.slf4j', name:'slf4j-log4j12', version: slf4jVersion
            testCompile group: 'junit', name: 'junit', version: junitVersion
        }

        sourceSets {
            main {
                compileClasspath += configurations.provided
            }
        }

//        idea {
//            module {
//                scopes.PROVIDED.plus += [configurations.provided]
//            }
//        }

    }
}

