apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-crash'
//apply plugin: 'kotlin-android'
apply plugin: 'com.novoda.build-properties'
apply plugin: 'jacoco-android'

buildProperties {
    notThere {
        file rootProject.file('debug_gradle.properties')
    }
    secrets {
        file rootProject.file('gradle.properties')
    }
}

android {
    signingConfigs {
        signing {
            keyAlias((buildProperties.secrets['android_key_alias'] | buildProperties.notThere['android_key_alias']).string)
            keyPassword((buildProperties.secrets['android_store_password'] | buildProperties.notThere['android_store_password']).string)
            storeFile file('fastaccess-public')
            storePassword((buildProperties.secrets['android_store_password'] | buildProperties.notThere['android_store_password']).string)
        }
    }
    compileSdkVersion 25
    buildToolsVersion "26.0.0-rc2"
    defaultConfig {
        applicationId "com.fastaccess.github"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 251
        versionName "2.5.1"
        signingConfig signingConfigs.signing
        buildConfigString "GITHUB_CLIENT_ID", (buildProperties.secrets['github_client_id'] | buildProperties.notThere['github_client_id']).string
        buildConfigString "GITHUB_SECRET", (buildProperties.secrets['github_secret'] | buildProperties.notThere['github_secret']).string
        buildConfigString "IMGUR_CLIENT_ID", (buildProperties.secrets['imgur_client_id'] | buildProperties.notThere['imgur_client_id']).string
        buildConfigString "IMGUR_SECRET", (buildProperties.secrets['imgur_secret'] | buildProperties.notThere['imgur_secret']).string
        buildConfigField "String", "REST_URL", '"https://api.github.com/"'
        buildConfigField "String", "IMGUR_URL", '"https://api.imgur.com/3/"'
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath true
            }
        }
    }

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

    sourceSets {
        main {
            res.srcDirs = [
                    "src/main/res/",
                    "src/main/res/layouts/main_layouts",
                    "src/main/res/layouts/row_layouts",
                    "src/main/res/layouts/other_layouts",
                    "src/main/res/translations",
                    "src/main/res"
            ]
        }
    }

    lintOptions {
        abortOnError false
        htmlReport true
        xmlReport true
        disable 'InvalidPackage'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    configurations {
        all*.exclude module: 'annotations'
    }

    dexOptions {
        jumboMode true
    }

    testOptions {
        unitTests.returnDefaultValues = true
    }
}

repositories {
    maven { url "https://clojars.org/repo/" }
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url "https://jitpack.io" }
    maven { url "https://maven.google.com" }
    mavenCentral()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.android.support:appcompat-v7:${supportVersion}"
    compile "com.android.support:design:${supportVersion}"
    compile "com.android.support:cardview-v7:${supportVersion}"
    compile "com.android.support:recyclerview-v7:${supportVersion}"
    compile "com.android.support:preference-v14:${supportVersion}"
    compile "com.android.support:customtabs:${supportVersion}"
    compile "com.android.support:palette-v7:${supportVersion}"
//    compile "com.android.support:support-emoji-appcompat:${supportVersion}"
    compile "net.grandcentrix.thirtyinch:thirtyinch:${thirtyinchVersion}"
    compile "net.grandcentrix.thirtyinch:thirtyinch-rx:${thirtyinchVersion}"
    compile "com.squareup.retrofit2:retrofit:${retrofit}"
    compile "com.squareup.retrofit2:converter-gson:${retrofit}"
    compile "com.squareup.retrofit2:adapter-rxjava:${retrofit}"
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'cn.gavinliu.android.lib:ShapedImageView:0.8.3'
    compile "frankiesardo:icepick:${icepickVersion}"
    compile "com.jakewharton:butterknife:${butterKnifeVersion}"
    compile 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.1-rc1'
    compile 'io.reactivex:rxandroid:1.2.1'
    compile 'io.reactivex:rxjava:1.3.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'
    compile 'com.annimon:stream:1.1.7'
    compile 'com.github.GrenderG:Toasty:1.1.3'
    compile 'com.github.JediBurrell:MaterialTapTargetPrompt:-SNAPSHOT'
    compile 'com.github.k0shk0sh:RetainedDateTimePickers:1.0.2'
    compile 'com.github.daniel-stoneuk:material-about-library:1.8.1'
    compile "io.requery:requery:${requery}"
    compile "io.requery:requery-android:${requery}"
    compile('com.mikepenz:aboutlibraries:5.9.5@aar') { transitive = true }
    compile 'com.github.nightwhistler:HtmlSpanner:0.4'
    compile 'net.sourceforge.htmlcleaner:htmlcleaner:2.2'
    compile 'com.github.matthiasrobbers:shortbread:1.0.1'
    compile 'com.atlassian.commonmark:commonmark:0.9.0'
    compile 'com.firebase:firebase-jobdispatcher:0.6.0'
    compile "com.google.firebase:firebase-ads:${gms}"
    compile "com.google.firebase:firebase-messaging:${gms}"
    releaseCompile "com.google.firebase:firebase-crash:${gms}"
    compile "com.google.android.gms:play-services-auth:${gms}"
//    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:${kotlin_version}"
    provided "org.projectlombok:lombok:${lombokVersion}"
    annotationProcessor "io.requery:requery-processor:${requery}"
    annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
    annotationProcessor "frankiesardo:icepick-processor:${icepickVersion}"
    annotationProcessor "com.jakewharton:butterknife-compiler:${butterKnifeVersion}"
    annotationProcessor 'com.github.matthiasrobbers:shortbread-compiler:1.0.1'
    testCompile "net.grandcentrix.thirtyinch:thirtyinch-test:$thirtyinchVersion"
    testCompile "junit:junit:${junitVersion}"
    testCompile "org.mockito:mockito-core:${mockitoVersion}"
    testCompile "org.assertj:assertj-core:${assertjVersion}"
    androidTestCompile "com.android.support:support-annotations:${supportVersion}"
    androidTestCompile "org.mockito:mockito-core:${mockitoVersion}"
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile "com.android.support.test.espresso:espresso-intents:${espresseVersion}"
    androidTestCompile "com.android.support.test.espresso:espresso-core:${espresseVersion}"
}

apply plugin: 'com.google.gms.google-services'