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

buildscript {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'net.wequick.tools.build:gradle-small:1.3.0-beta5'//Small插件版本
        classpath 'me.tatarka:gradle-retrolambda:3.7.0'
        classpath "io.realm:realm-gradle-plugin:2.1.1" //添加realm插件
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url "https://maven.google.com" }
        maven { url "https://dl.bintray.com/thelasterstar/maven/" }
        mavenCentral()
        jcenter()
    }
}

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

apply plugin: 'net.wequick.small'//引用 small 插件


small {
    aarVersion = '1.3.0-beta5'
    //这里可以设置统一的编译版本和一些配置
    buildToAssets = false
    android {
        compileSdkVersion = 26
        buildToolsVersion = "26.0.1"
        supportVersion = "26.+"
    }
}

apply plugin: 'checkstyle'
checkstyle {
    toolVersion = '6.12.1'
}

task checkstyle(type: Checkstyle) {
    source 'src'
    include '**/*.java'
    exclude '**/gen/**'
    ignoreFailures true

    configFile = new File(rootDir, "google_checks.xml")
    classpath = files()
}

task cleanBuild(type: Delete){
    delete buildDir
    delete "$rootDir/build-small"
    delete "$rootDir/app/smallLibs"

    delete "$rootDir/app+stub/build"
    delete "$rootDir/app.home/build"
    delete "$rootDir/app.main/build"
    delete "$rootDir/app.message/build"
    delete "$rootDir/app.mine/build"

    delete "$rootDir/lib.middleware/build"
    delete "$rootDir/lib.mvvm/build"
    delete "$rootDir/lib.net/build"
    delete "$rootDir/lib.style/build"
    delete "$rootDir/lib.view/build"
    delete "$rootDir/lib.video/build"

    delete "$rootDir/lib.middleware/public.txt"
    delete "$rootDir/lib.mvvm/public.txt"
    delete "$rootDir/lib.net/public.txt"
    delete "$rootDir/lib.style/public.txt"
    delete "$rootDir/lib.view/public.txt"
    delete "$rootDir/lib.video/public.txt"

    delete "$rootDir/.gradle"
}