buildscript {
    ext.kotlin_version = '1.3.61'
    repositories {
        google()
        jcenter()
//        maven { url 'https://maven.aliyun.com/repository/google' }
//        maven{ url 'https://maven.aliyun.com/repository/jcenter'}
        maven {
            url 'http://download.flutter.io'
        }
        maven { url 'http://developer.huawei.com/repo/'}

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.huawei.agconnect:agcp:1.0.0.300'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
//        maven { url 'https://maven.aliyun.com/repository/google' }
//        maven{ url 'https://maven.aliyun.com/repository/jcenter'}
        maven {
            url 'http://download.flutter.io'
        }
        maven { url'http://developer.huawei.com/repo/'}

    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    configurations.all {
        resolutionStrategy {
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'androidx.core') {
                    details.useVersion "1.0.1"
                }
                if (details.requested.group == 'androidx.lifecycle') {
                    details.useVersion "2.0.0-rc01"
                }
                if (details.requested.group == 'androidx.legacy') {
                    details.useVersion "1.0.0-rc01"
                }
                if (details.requested.group == 'androidx.versionedparcelable') {
                    details.useVersion "1.0.0"
                }

                if (details.requested.group == 'com.google.android.gms') {
                    details.useVersion "17.0.0"
                }


                if (details.requested.group == 'androidx.fragment') {
                    details.useVersion "1.0.0"
                }
                if (details.requested.group == 'androidx.appcompat') {
                    details.useVersion "1.0.1"
                }

                if (details.requested.group == 'androidx.annotation') {
                    details.useVersion "1.1.0"
                }


            }
        }
    }
}
subprojects {
    project.evaluationDependsOn(':app')
}

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


tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}