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.iottest"   // required on AGP 8+
    compileSdkVersion 35

    defaultConfig {
        applicationId "software.amazon.awssdk.iottest"
        minSdkVersion 26
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    sourceSets {
        main {
            java.srcDir '../../../../samples/Mqtt/Mqtt5X509/src/main/java'
            java.srcDir 'src/main/java'
        }
    }

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

    packagingOptions { jniLibs { useLegacyPackaging false } }

    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
        coreLibraryDesugaringEnabled true
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
}

dependencies {
    api 'software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk-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'

    androidTestImplementation "androidx.test:core:1.2.0"
    androidTestImplementation "androidx.test:runner:1.5.2"
    androidTestImplementation "androidx.test:rules:1.5.0"
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
}
