apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

android {
    compileSdk 34


    defaultConfig {
        applicationId "me.henneke.wearauthn.authenticator"
        minSdk 21
        targetSdk 34
        versionCode makeVersionCode(minSdkVersion.apiLevel, false)
        versionName makeVersionName()
    }
    signingConfigs {
        testSign {
            storeFile file('../ci_keystore.jks')
            storePassword 'hunter2'
            keyAlias 'key0'
            keyPassword 'hunter2'
        }
        nightlySign {
            storeFile file('../nightly_keystore.jks')
            storePassword project.hasProperty("storePassword") ? project.storePassword : ""
            keyAlias 'key0'
            keyPassword project.hasProperty("keyPassword") ? project.keyPassword : ""
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.testSign
        }
        debug {
            minifyEnabled false
        }
        signed {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.nightlySign
        }
    }
    flavorDimensions += "distribution"
    productFlavors {
        playStore {
            dimension "distribution"
        }
        nightly {
            dimension "distribution"
            applicationIdSuffix ".nightly"
            versionCode getNightlyVersionCode()
            versionName getNightlyVersionName()
        }
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }
    namespace 'me.henneke.wearauthn.companion'
    buildFeatures {
        buildConfig true
        viewBinding true
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
    implementation 'androidx.fragment:fragment-ktx:1.8.2'
    implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.4'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.4'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4'

    implementation 'com.android.billingclient:billing:7.0.0'

    implementation 'com.google.android.gms:play-services-tasks:18.2.0'
    implementation 'com.google.android.gms:play-services-wearable:18.2.0'

    implementation 'com.google.android.material:material:1.12.0'

    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3'
}
