buildscript {
    ext.kotlin_version = '1.6.10'

    ext {
        compileSdkVersion   = 33
        targetSdkVersion    = 33
        appCompatVersion    = "1.1.0"
    }

    repositories {
        google()
        jcenter()
    }

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

// allprojects {
//     repositories {
//         google()
//         jcenter()
//         maven {
//             // [required] background_fetch
//             url "${project(':background_fetch').projectDir}/libs"
//         }
//     }
// }

subprojects {
    afterEvaluate {project ->
        if (project.plugins.hasPlugin('android') || project.plugins.hasPlugin('android-library')) {
            android {
                compileSdkVersion 33
                buildToolsVersion '31.0.0'
            }
        }
    }
}

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

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