import org.ajoberstar.grgit.Grgit

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
        classpath 'org.ajoberstar:gradle-git:1.4.2'
    }
}
apply plugin: 'com.android.application'

repositories {
    mavenCentral()
}

ext {
    git = Grgit.open()
    gitVersionCode = git.tag.list().size() + 1
    gitVersionName = "${git.describe()}"
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.frozendevs.cache.cleaner"
        minSdkVersion 9
        targetSdkVersion 23
        versionCode = gitVersionCode
        versionName = gitVersionName

        vectorDrawables.useSupportLibrary = true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        ignore 'GoogleAppIndexingWarning', 'UnusedAttribute'
        textOutput 'stdout'
        textReport true
        warning 'MissingTranslation'
    }
}

dependencies {
    compile('com.android.support:support-v4:23.4.0')
    compile('com.android.support:appcompat-v7:23.4.0@aar')
    compile('com.android.support:recyclerview-v7:23.4.0@aar')
    compile('com.android.support:support-vector-drawable:23.4.0@aar')
}

if (project.hasProperty("CacheCleaner.signing") &&
        file(project.property("CacheCleaner.signing") + ".gradle").exists()) {
    apply from: project.property("CacheCleaner.signing") + ".gradle";
}
