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

buildscript {
    
    ext {
        agp_version = '8.5.0'
        agp_version1 = '7.4.2'
        agp_version2 = '7.1.0'
        agp_version3 = '3.6.1'
        agp_version4 = '8.10.1'
    }
    repositories {
        google()
        mavenCentral()
        
    }
    dependencies {
        classpath "com.android.tools.build:gradle:$agp_version4"

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

plugins {
    id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}

def getSonatypeRepositoryToken() { return hasProperty('ossrhToken') ? ossrhToken : "" }

def getSonatypeRepositoryTokenPassword() { return hasProperty('ossrhTokenPassword') ? ossrhTokenPassword : "" }

nexusPublishing {
    packageGroup = GROUP // optional if packageGroup == project.getGroup()
    repositories {
        sonatype {
            nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
            snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
            username = getSonatypeRepositoryToken()
            password = getSonatypeRepositoryTokenPassword()
        }
    }
    transitionCheckOptions {
        maxRetries.set(120)
        delayBetween.set(java.time.Duration.ofMillis(30000))
    }
}
allprojects {
    repositories {
        google()
        mavenCentral()
        
    }
}

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