buildscript {
    ext.kotlin_version = '1.9.24'
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:8.5.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

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

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    namespace "software.amazon.awssdk.crttest"

    compileSdk 35
    buildToolsVersion "35.0.0"

    useLibrary 'android.test.runner'
    useLibrary 'android.test.base'
    useLibrary 'android.test.mock'

    defaultConfig {
        applicationId "software.amazon.awssdk.crttest"
        minSdkVersion 26
        targetSdkVersion 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    // Ensure JNI libs from dependencies stay UNCOMPRESSED so AGP can 16KB-zip-align them
    packagingOptions {
        jniLibs { useLegacyPackaging false }
    }

    sourceSets {
        main {
            java.srcDir 'src/main/java'
        }
        androidTest {
            setRoot '../..'
            java.srcDir '../../java'
            java.srcDir 'src/androidTest/java'
            assets.srcDir 'src/androidTest/assets'
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
        coreLibraryDesugaringEnabled true
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

dependencies {
    api 'software.amazon.awssdk.crt:aws-crt-android:1.0.0-SNAPSHOT'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core:1.2.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"

    testImplementation 'junit:junit:4.13'

    implementation 'commons-cli:commons-cli:1.5.0' // For Elasticurl CommandLine related classes
    implementation 'com.sun.net.httpserver:http:20070405' // For CredentialProvidersTest HttpServer
    implementation 'junit:junit:4.13'
    androidTestImplementation "junit:junit:4.13"

    androidTestImplementation "androidx.test:core:1.5.0"
    androidTestImplementation "androidx.test:runner:1.5.2"
    androidTestImplementation "androidx.test:rules:1.5.0"
    androidTestImplementation "androidx.test.ext:junit:1.1.5"
}
