apply plugin: "com.github.ben-manes.versions"

buildscript {
    apply from: "appinfo.gradle"
    apply from: "versions.gradle"
    apply from: "dependencies.gradle"

    apply from: "instance.gradle"

    addRepos(repositories)

    dependencies {
        classpath deps.androidGradlePlugin
        classpath deps.kotlinGradlePlugin

        classpath deps.gradlePluginVersions
    }
}

allprojects {
    addRepos(repositories)

    tasks.withType(JavaCompile) {
        options.encoding(buildVersions.encoding)
        options.compilerArgs += [
                "-Xlint:all",
                "-Xlint:unchecked",
                "-Xlint:-deprecation",
        ]
    }

    apply plugin: com.github.benmanes.gradle.versions.VersionsPlugin
    tasks.named("dependencyUpdates").configure {
        gradleReleaseChannel = "current"

        rejectVersionIf {
            isNonStable(it.candidate.version)
        }
    }
}

task clean(type: Delete) {
    delete(rootProject.buildDir)
    delete("${rootProject.buildDir}/app/huskyBeta")
    delete("${rootProject.buildDir}/app/huskyStable")
    delete("${rootProject.buildDir}/app/huskyDev")
    delete("${rootProject.buildDir}/app/huskyNewhusky")
}
