plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
    alias(libs.plugins.kotlin.compose)
}

version = rootProject.file('VERSION').text.trim()

android {
    namespace 'net.vasilchuk.rebutton'
    compileSdk 35

    defaultConfig {
        applicationId "net.vasilchuk.rebutton"
        minSdk 30
        targetSdk 35
        versionCode version.toInteger()
        versionName "1." + version

    }

    signingConfigs {
        release {
            storeFile file("../keys/ReButton.jks")
            keyAlias "ReButton"
            storePassword System.getenv('KEYSTORE_PASSWORD')
            keyPassword System.getenv('RELEASE_SIGN_KEY_PASSWORD')
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            if (System.getenv('KEYSTORE_PASSWORD')) {
                signingConfig signingConfigs.release
            }
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = '11'
    }
    buildFeatures {
        compose true
    }
}

dependencies {

    implementation libs.wear
    implementation libs.wearable
    implementation libs.support.wearable
    implementation libs.play.services.wearable
    implementation libs.appcompat
    implementation libs.material
    implementation libs.activity
    implementation libs.preference
    implementation libs.constraintlayout
    implementation libs.lifecycle.runtime.ktx
    implementation libs.activity.compose
    implementation platform(libs.compose.bom)
    implementation libs.ui
    implementation libs.ui.graphics
    implementation libs.ui.tooling.preview
    implementation libs.material3
    compileOnly libs.google.wearable
    androidTestImplementation platform(libs.compose.bom)
    androidTestImplementation libs.ui.test.junit4
    debugImplementation libs.ui.tooling
    debugImplementation libs.ui.test.manifest
}