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

buildscript {

    apply from: rootProject.file("dependencies.gradle")

    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        maven { url "https://oss.sonatype.org/service/local/repositories/snapshots/content/" }
    }
    dependencies {
        classpath deps.androidPlugin
        classpath deps.kotlinGradlePlugin
        classpath deps.gradleMavenPublishPlugin
        classpath deps.benchmarkGradlePlugin
        // Dokka is needed on classpath for vanniktech publish plugin
        classpath deps.dokkaPlugin
        classpath deps.kspGradlePlugin
        classpath deps.ktlintGradlePlugin
    }
}

allprojects {
    apply from: rootProject.file("dependencies.gradle")

    repositories {
        google()
        mavenCentral()
    }
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
    kotlinOptions {
        allWarningsAsErrors = true
    }
}

def getReleaseRepositoryUrl() {
    return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
            : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}

def getSnapshotRepositoryUrl() {
    return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
            : "https://oss.sonatype.org/content/repositories/snapshots/"
}

