// Top-level build file where you can add configuration options common to all sub-projects/modules.

apply from: 'ktlint.gradle'
apply from: 'bumpVersion.gradle'

buildscript {
    ext.kotlin_version = '1.3.41'
    ext.dokka_version = '0.9.18'     // https://plugins.gradle.org/plugin/org.jetbrains.dokka
    ext.bintray_version = '0.9.1'    // https://github.com/novoda/bintray-release
    ext.detektVersion = '1.0.0-RC16' // https://plugins.gradle.org/plugin/io.gitlab.arturbosch.detekt

    ext.koinVersion = '2.0.1'        // https://github.com/InsertKoinIO/koin
    ext.coroutines_version = '1.2.2'

    repositories {
        google()
        jcenter()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
        classpath "com.novoda:bintray-release:${bintray_version}"
        classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
}

subprojects {
    apply plugin: 'io.gitlab.arturbosch.detekt'

    detekt {
        toolVersion = rootProject.ext.detektVersion
        input = files("$projectDir")
        filters = ".*/resources/.*,.*/build/.*,.*Test.kt"
        config = files("$rootDir/detekt-config.yml")
        reports {
            xml.enabled = false
            html.enabled = true
            html.destination = file("$buildDir/reports/detekt.html")
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
