apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 22
        versionCode 10008
        versionName "1.0.8"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    splits {
        abi {
            enable true
            reset()
            include 'armeabi', 'armeabi-v7a', 'mips', 'x86'
            universalApk true
        }
    }
}

ext.versionCodes = ['armeabi':1, 'armeabi-v7a':2, 'mips':3, 'x86':4]

android.applicationVariants.all { variant ->
    variant.outputs.each { output ->
        output.versionCodeOverride =
                project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1000000 + android.defaultConfig.versionCode
    }
    variant.mergeResources.doLast {
        copy { // Hack to support Asturian, which doesn't have an ISO 639-1 code, in pre-lollipop devices
            from "$buildDir/intermediates/res/$variant.dirName/values-b+ast"
            into "$buildDir/intermediates/res/$variant.dirName/values-es-rXA"
        }
    }
}

dependencies {
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:cardview-v7:22.2.0'
    compile 'com.f2prateek.progressbutton:progressbutton:2.1.0@aar'
    compile 'ch.acra:acra:4.6.2'
    compile project(':libraries:axmlrpc')
    compile project(':libraries:cropper')
    compile project(':libraries:opencv')
    compile project(':libraries:tesseract-android-tools')
    compile project(':libraries:lttoolbox-java')
}
