apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.vanniktech.code.quality.tools'
apply plugin: 'com.vanniktech.android.junit.jacoco'

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath 'com.vanniktech:gradle-code-quality-tools-plugin:0.4.0'
        classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.4.0'
        classpath 'com.vanniktech:gradle-maven-publish-plugin:0.1.0'

        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0'
        classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.8'
    }
}

codeQualityTools {
    lint {
        textReport = true
    }
}

junitJacoco {
    ignoreProjects = ['app'] // Don't care about sample
}

subprojects {
    repositories {
        jcenter()
    }

    plugins.apply('net.ltgt.errorprone')
}

ext {
    minSdkVersion = 14
    compileSdkVersion = 23
    targetSdkVersion = 23
    buildToolsVersion = '23.0.2'

    supportLibraryVersion = '23.2.1'
    leakCanaryVersion = '1.3.1'

    versionCode = VERSION_CODE
    versionName = VERSION_NAME

    junit = 'junit:junit:4.12'
    mockito = 'org.mockito:mockito-core:1.10.19'
    robolectric = 'org.robolectric:robolectric:3.1'

    supportAppCompat = "com.android.support:appcompat-v7:$supportLibraryVersion"

    leakCanaryDebug = "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
    leakCanaryRelease = "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"

    javaVersion = JavaVersion.VERSION_1_7
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.13'
    distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}