// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url 'https://maven.google.com'
        }
    }
    dependencies {
        // Error:(1, 0) The android gradle plugin version 2.4.0-alpha7 is too old, please update to the latest version.
        // To override this check from the command line please set the ANDROID_DAILY_OVERRIDE environment variable to "xxxxxxxxxxxxxxxxx"
        // If you come across the above error, run the following command and restart Android Studio
        // launchctl setenv ANDROID_DAILY_OVERRIDE <your-value-on-error-message>
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
        classpath 'com.google.gms:google-services:3.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url 'https://maven.google.com'
        }
    }

    ext.getLocalProperty = { prop, defaultValue = "" ->
        def file = project.rootProject.file('local.properties')
        if (file.exists()) {
            Properties properties = new Properties()
            properties.load(file.newDataInputStream())
            return properties.getProperty(prop, defaultValue)
        } else {
            return defaultValue
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
