// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = "1.8.22"
    repositories {
        google()
        mavenCentral()
        //noinspection JcenterRepositoryObsolete
        jcenter() {
            content {
                // https://youtrack.jetbrains.com/issue/KT-44730
                includeModule("org.jetbrains.trove4j", "trove4j")
            }
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.4.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jacoco:org.jacoco.core:0.8.5"
    }
}

plugins {
    id 'org.jetbrains.dokka' version '1.9.20'
    id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}

nexusPublishing {
    repositories {
        sonatype{
            nexusUrl.set(uri('https://ossrh-staging-api.central.sonatype.com/service/local/'))
            snapshotRepositoryUrl.set(uri('https://central.sonatype.com/repository/maven-snapshots/'))
            username.set(System.getenv("MAVEN_USERNAME"))
            password.set(System.getenv("MAVEN_PASSWORD"))
        }
    }
}

apply plugin: 'io.github.gradle-nexus.publish-plugin'


subprojects {
    apply plugin: 'org.jetbrains.dokka'
}

allprojects {
    group = 'com.auth0.android'

    repositories {
        google()
        mavenCentral()
        //noinspection JcenterRepositoryObsolete
        jcenter() {
            content {
                // https://youtrack.jetbrains.com/issue/KT-44730
                includeModule("org.jetbrains.trove4j", "trove4j")
                includeModule("com.soywiz.korlibs.korte", "korte-jvm")
                includeModule("org.jetbrains.kotlinx", "kotlinx-html-jvm")
            }
        }
    }
}
