apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.meetup.swarmicons"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode ((System.env.CI_BUILD_NUMBER ?: 1) as Integer)
        versionName System.env.VERSION_NAME ?: "snapshot"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        prod {
            storeFile file("${System.getProperty("user.home")}/swarmicons-keys.jks")
            keyAlias 'swarmicons'
            if (project.hasProperty('keystorePass') && project.hasProperty('swarmKeyPass')) {
                storePassword keystorePass
                keyPassword swarmKeyPass
            } else if (System.getenv("KEYSTORE_PASS") != null && System.getenv("SWARM_KEY_PASS")) {
                storePassword System.getenv("KEYSTORE_PASS")
                keyPassword System.getenv("SWARM_KEY_PASS")
            }
        }
    }

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

dependencies {
    implementation project(":icons")
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation "com.android.support:recyclerview-v7:26.1.0"
    implementation "com.android.support.constraint:constraint-layout:1.0.2"
}