apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'maven-publish'

android {
    namespace 'com.fraggjkee.smsconfirmationview'

    compileSdk = 34
    buildToolsVersion = "34.0.0"

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 34

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }

    kotlinOptions {
        jvmTarget = '17'
    }

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

    buildFeatures {
        dataBinding true
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation "com.google.android.material:material:1.9.0"

    // Required for automatic code retrieval from SMS (Consent API)
    // https://developers.google.com/identity/sms-retriever/user-consent/overview
    implementation "com.google.android.gms:play-services-auth:20.6.0"
    implementation "com.google.android.gms:play-services-auth-api-phone:18.0.1"

    // Contains modern "Start activity/fragment for result" APIs which are
    // required for SMS retrieval feature
    implementation "androidx.activity:activity-ktx:1.7.2"
    implementation "androidx.fragment:fragment-ktx:1.6.1"
}

publishing {
    publications {
        release(MavenPublication) {
            groupId = 'com.fraggjkee'
            artifactId = 'smsconfirmationview'
            version = '1.7.3'

            afterEvaluate {
                from components.release
            }
        }
    }
}
