apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 22

        versionName "v1.2.11"
        versionCode 50
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    lintOptions {
        abortOnError false
    }

    /*
    If you want to sign releases, make a file in app/keys.properties with the following content:
    keystoreFile=yourkey.store
    keystorePass=pass
    keyAlias=alias
    keyPass=pass
    */

    File f = file('keys.properties')
    boolean doSign = f.exists();

    if (doSign) {
        Properties props = new Properties()
        props.load(new FileInputStream(f))

        signingConfigs {
            release {
                storeFile file(props['keystoreFile'])
                storePassword props['keystorePass']
                keyAlias props['keyAlias']
                keyPassword props['keyPass']
            }
        }
    }

    buildTypes {
        release {
            if (doSign) {
                signingConfig signingConfigs.release
            }
            minifyEnabled true
            proguardFiles 'proguard.cfg'
        }

        beta.initWith(buildTypes.release)
        beta {
            versionNameSuffix " Beta"
        }

        debug {
            versionNameSuffix " Debug"
        }
    }

    sourceSets {
        beta.java.srcDirs = ['src/release/java']
    }
}

dependencies {
    compile 'com.android.support:support-v13:22.2.1'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:recyclerview-v7:22.2.1'
    compile 'com.android.support:cardview-v7:22.2.1'
    compile 'com.android.support:support-annotations:22.2.1'
    compile 'com.android.support:design:22.2.1'

    compile 'org.jsoup:jsoup:1.8.2'
    compile 'com.j256.ormlite:ormlite-core:4.48'
    compile 'com.j256.ormlite:ormlite-android:4.48'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.7'
    compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.1.4'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'de.greenrobot:eventbus:2.4.0'

    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    betaCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
}
