buildscript {
    ext.kotlin_version = '1.9.25'
    repositories {
        google()
        mavenCentral()
        maven {url 'https://developer.huawei.com/repo/'}
    }

    dependencies {
        classpath "com.android.tools.build:gradle:7.1.2"
        classpath 'com.huawei.agconnect:agcp:1.5.2.300'
    }
}
configurations.all {
    resolutionStrategy.force 'androidx.appcompat:appcompat:1.3.0'
}
allprojects {
    repositories {
        google()
        mavenCentral()
        maven {url 'https://developer.huawei.com/repo/'}
    }
}

rootProject.buildDir = '../build'

subprojects {
    afterEvaluate { project ->
        if (project.plugins.hasPlugin("com.android.application") ||
                project.plugins.hasPlugin("com.android.library")) {
            project.android {
                compileSdkVersion 34
            }
        }
    }
}
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.evaluationDependsOn(':app')
}


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

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