import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
    ext {
        androidBuildToolsVersion = "35.0.0"
        androidMinSdkVersion = 21
        androidTargetSdkVersion = 35
        androidCompileSdkVersion = 35
    }
}

plugins {
    alias(libs.plugins.androidApplication) apply false
    alias(libs.plugins.kotlinAndroid) apply false
    alias(libs.plugins.androidJunit5) apply false
}

allprojects {
    ext {
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        testJunit5Builder = "de.mannodermaus.junit5.AndroidJUnit5Builder"
    }
    configurations.configureEach {
        //fix for test running
        resolutionStrategy.force 'org.objenesis:objenesis:2.6'
    }
}

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

tasks.withType(KotlinCompile).configureEach {
    kotlinOptions.freeCompilerArgs += [
            '-Xno-call-assertions',
            '-Xno-receiver-assertions',
            '-Xno-param-assertions'
    ]
}

subprojects {
    tasks.withType(KotlinCompile).tap {
        configureEach {
            kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
        }
    }
}
