buildscript {
    ext.kotlin_version = '1.8.22'
    repositories {
        mavenLocal() // 查找本地maven仓库
        maven { url 'https://maven.aliyun.com/repository/central' } //central
        maven { url 'https://maven.aliyun.com/repository/public' } //jcenter
        maven { url 'https://maven.aliyun.com/repository/google' } //google
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } //gradle-plugin
        maven { url 'https://maven.aliyun.com/repository/spring' } //spring
        maven { url 'https://maven.aliyun.com/repository/spring-plugin' } //spring-plugin
        maven { url 'https://maven.aliyun.com/repository/grails-core' } //grails-core
        maven { url 'https://maven.aliyun.com/repository/apache-snapshots' } //apache snapshots

        mavenCentral()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        mavenLocal() // 查找本地maven仓库
        maven { url 'https://maven.aliyun.com/repository/central' } //central
        maven { url 'https://maven.aliyun.com/repository/public' } //jcenter
        maven { url 'https://maven.aliyun.com/repository/google' } //google
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } //gradle-plugin
        maven { url 'https://maven.aliyun.com/repository/spring' } //spring
        maven { url 'https://maven.aliyun.com/repository/spring-plugin' } //spring-plugin
        maven { url 'https://maven.aliyun.com/repository/grails-core' } //grails-core
        maven { url 'https://maven.aliyun.com/repository/apache-snapshots' } //apache snapshots

        mavenCentral()
        google()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}