// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.compose_version = "1.3.1"
    ext.kotlin_version = "1.7.10"
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

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

        classpath 'com.vanniktech:gradle-maven-publish-plugin:0.18.0' // NEW
        classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.10.2' // NEW
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }

    plugins.withId("com.vanniktech.maven.publish") {
        mavenPublish {
            sonatypeHost = "S01"

            publishing {
                repositories {
                    maven {
                        def releasesRepoUrl = "$buildDir/repos/releases"
                        def snapshotsRepoUrl = "$buildDir/repos/snapshots"
                        url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
                    }
                }
            }
        }
    }
}

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