buildscript {
    ext {
        agp_version = '8.2.2'
    }
}
allprojects {
    repositories {
        google()
        mavenCentral()
    }
}
subprojects {
   afterEvaluate { project ->
        if (project.hasProperty('android')) {
            project.android {
                if (namespace == null) {
                    namespace project.group
                }
            }

            if (project.name == "shared_preferences_android" || project.name == "receive_sharing_intent" || project.name == "open_settings_plus") {
                tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
                    kotlinOptions {
                        jvmTarget = "1.8" // Specific setting for these libraries
                    }
                }
                if (project.hasProperty("android")) {
                    project.android {
                        compileOptions {
                            sourceCompatibility JavaVersion.VERSION_1_8
                            targetCompatibility JavaVersion.VERSION_1_8
                        }
                    }
                }
            }
        }
    }
    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
        kotlinOptions {
            jvmTarget = "1.8" // Force all modules to target JVM 1.8
        }
    }


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

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