apply plugin: 'com.android.application'

// Manifest info
def buildTime = new Date().format("yyyy-MM-dd HH:mm", TimeZone.getTimeZone("GMT+8:00"))
def versionMajor = 1
def versionMinor = 0
def versionPatch = 6
def versionBuild = 0// bump for dogfood builds, public betas, etc.

def firApplicationId = "55fd648a00fc7453bd000002"
def firApiToken = "e9643ae1e41c57d6d829504ce8f9f90a"

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    defaultConfig {
        applicationId "com.knight.arch"
        minSdkVersion 15
        targetSdkVersion 23


        buildConfigField "String", "BUILD_TIME", "\"${buildTime}\""
        buildConfigField "String", "FIR_APPLICATION_ID", "\"${firApplicationId}\""
        buildConfigField "String", "FIR_API_TOKEN", "\"${firApiToken}\""
        versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
        versionName "${versionMajor}.${versionMinor}.${versionPatch}"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:design:23.1.0'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'de.psdev.licensesdialog:licensesdialog:1.8.0'
    compile 'com.readystatesoftware.systembartint:systembartint:1.0.4'
    compile 'com.balysv:material-ripple:1.0.2'
    compile 'com.android.support:recyclerview-v7:23.1.0'

    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp:2.2.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'

    compile 'com.facebook.stetho:stetho:1.1.1'
    compile 'com.facebook.stetho:stetho-okhttp:1.1.1'

    compile 'com.orhanobut:logger:1.10'
    compile 'com.squareup.picasso:picasso:2.3.2'

    provided 'com.squareup.dagger:dagger-compiler:1.2.2'
    compile 'com.squareup.dagger:dagger:1.2.2'

    compile 'io.reactivex:rxjava:1.0.8'
    compile 'io.reactivex:rxandroid:0.24.0'

    compile 'com.umeng.analytics:analytics:latest.integration'

    compile 'de.greenrobot:eventbus:2.4.0'


}

//
//File propFile = file('signing.properties');
//if (propFile.exists()) {
//
//    def Properties props = new Properties();
//    props.load(new FileInputStream(propFile))
//
//    if (props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
//            props.containsKey('KEY_ALIAS') && props.contains('KEY_PASSWORD')) {
//        android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
//        android.signingConfigs.release.storePassword = pros['STORE_PASSWORD']
//        android.signingConfigs.release.keyAlias = pros['KEY_ALIAS']
//        android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
//    } else {
//        android.buildTypes.release.signingConfig = null
//    }
//
//} else {
//    android.buildTypes.release.signingConfig = null
//}
