apply plugin: 'com.android.application'
apply plugin: 'checkstyle'

android {
    useLibrary 'org.apache.http.legacy'
    compileSdkVersion 26
    buildToolsVersion '27.0.1'

    defaultConfig {
        applicationId "com.einmalfel.podlisten"
        resValue "string", "app_id", applicationId
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1030600
        versionName "1.3.6"
    }
    buildTypes {
        release {
            debuggable false
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            applicationIdSuffix '.debug'
            resValue "string", "app_id", defaultConfig.applicationId + applicationIdSuffix
            debuggable true
            jniDebuggable false
            renderscriptDebuggable false
            minifyEnabled false
            pseudoLocalesEnabled false
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    lintOptions {
        warningsAsErrors true
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    debugCompile 'com.facebook.stetho:stetho:1.5.0'
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
    compile 'ch.acra:acra:4.9.2'
    compile 'com.nononsenseapps:filepicker:4.1.0'
    compile 'org.unbescape:unbescape:1.1.5.RELEASE'
    compile 'com.einmalfel:earl:1.2.0'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.android.support:support-annotations:27.0.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:preference-v7:26.1.0'
}

task checkstyle(group: 'verification', type: Checkstyle) {
    configFile project.file("checkstyle_config.xml")
    source fileTree('src')
    include '**/*.java'
    exclude '**/thirdparty/**'
    classpath = files()
    project.tasks.check.dependsOn 'checkstyle'
}
