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

static def releaseTime() {
    return new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("UTC"))
}

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.duolebo.bylrobot"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 20
        versionName "1.6.2"
    }

    signingConfigs {
        release {
            storeFile file('../duolebo')
            keyAlias 'duolebo'
            storePassword '1qaz2wsx#'
            keyPassword '1qaz2wsx#'
        }
    }

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

            applicationVariants.all { variant ->
                variant.outputs.all {
                    outputFileName = "dlbrobot_v${defaultConfig.versionName}_${releaseTime()}.apk"
                }
            }
        }
    }
}

def uploadServiceVersion = "3.4.2"

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation(name: 'appbase-release', ext: 'aar')
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'org.nanohttpd:nanohttpd:2.2.0'
    implementation(name: 'vpnadaptercore-release', ext: 'aar')
    implementation project(':uploadservice')
    implementation project(':uploadservice-ftp')
    implementation project(':uploadservice-okhttp')
//    implementation "net.gotev:uploadservice:$uploadServiceVersion"
//    implementation "net.gotev:uploadservice-ftp:$uploadServiceVersion"
//    implementation "net.gotev:uploadservice-okhttp:$uploadServiceVersion"
//    implementation project(':vpnadaptercore')

}
