allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            // A repository must be speficied for some reason. "registry" is a dummy.
            url = uri("https://maven.pkg.github.com/revanced/registry")
            credentials {
                username = project.findProperty("gpr.user") as String ?: System.getenv("GITHUB_ACTOR")
                password = project.findProperty("gpr.key") as String ?: System.getenv("GITHUB_TOKEN")
            }
        }
        mavenLocal()
    }
}

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

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