apply plugin: 'android'

dependencies {
    compile 'com.android.support:support-v4:18.0.+'
    compile 'org.sufficientlysecure:donations:2.4'
    compile 'org.sufficientlysecure:html-textview:2.0'
    compile project(':libraries:RootCommands')
}

android {
    compileSdkVersion 17
    buildToolsVersion "25.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 17
    }

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }

    /*
     * To sign release build, create file gradle.properties in ~/.gradle/ with this content:
     *
     * signingStoreLocation=/home/key.store
     * signingStorePassword=xxx
     * signingKeyAlias=alias
     * signingKeyPassword=xxx
     */
    if (project.hasProperty('signingStoreLocation') &&
            project.hasProperty('signingStorePassword') &&
            project.hasProperty('signingKeyAlias') &&
            project.hasProperty('signingKeyPassword')) {
        println "Found sign properties in gradle.properties! Signing build…"

        signingConfigs {
            release {
                storeFile file(signingStoreLocation)
                storePassword signingStorePassword
                keyAlias signingKeyAlias
                keyPassword signingKeyPassword
            }
        }

        buildTypes.release.signingConfig = signingConfigs.release
    } else {
        buildTypes.release.signingConfig = null
    }

    productFlavors {
        google {
            buildConfigField "boolean", "DONATIONS_GOOGLE", "true"
        }
        fdroid {
            buildConfigField "boolean", "DONATIONS_GOOGLE", "false"
        }
    }
}