plugins {
    id 'com.android.application'
}

android {
    compileSdk 32
    sourceSets {
        github {
            manifest.srcFile 'github/AndroidManifest.xml'
        }
    }
    defaultConfig {
        applicationId "com.abh80.smartedge"
        minSdk 26
        targetSdk 32
        versionCode 20204
        versionName "2.2.4"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    signingConfigs {
        github {
            def tmpFilePath = System.getProperty("user.home") + "/work/_temp/keystore/keystore.jks"
            storeFile = file(tmpFilePath)
            storePassword System.getenv("SIGNING_KEY_PASSWORD")
            keyAlias System.getenv("SIGNING_KEY_ALIAS")
            keyPassword System.getenv("SIGNING_KEY_PASSWORD")
        }
    }

    buildTypes {
        github {
            minifyEnabled false
            buildConfigField "Boolean", "AUTO_UPDATE", "true"
            signingConfig signingConfigs.github
        }
        release {
            minifyEnabled false
            buildConfigField "Boolean", "AUTO_UPDATE", "false"
        }
        debug {
            minifyEnabled false
            buildConfigField "Boolean", "AUTO_UPDATE", "true"
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.5.0'
    implementation 'com.google.android.material:material:1.8.0-alpha01'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'org.apache.commons:commons-lang3:3.12.0'
    implementation 'com.android.volley:volley:1.2.1'
    implementation 'org.ocpsoft.prettytime:prettytime:5.0.2.Final'
}
