buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        // AGP 8.5.1+ aligns uncompressed .so at 16KB automatically
        // Requires JDK 17+
        classpath 'com.android.tools.build:gradle:8.5.1'
    }
}

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

group = 'software.amazon.awssdk.crt'
version = '1.0.0-dev'


if (project.hasProperty("sonatypeUsername") && project.hasProperty("sonatypePassword")) {
    apply plugin: 'io.github.gradle-nexus.publish-plugin'
    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(project.property("sonatypeUsername") as String)
                password.set(project.property("sonatypePassword") as String)
            }
        }
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

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