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

buildscript {
    ext {
        compose_ui_version = '1.4.1'
    }
}
plugins {
    id 'com.android.application' version '7.4.2' apply false
    id 'com.android.library' version '7.4.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
    id 'io.github.gradle-nexus.publish-plugin' version "1.3.0"
}

apply from: 'scripts/publish-root.gradle'

subprojects {
    tasks.withType(KotlinCompile).configureEach {
        if (project.findProperty("navBar.enableComposeCompilerReports") == "true") {
            freeCompilerArgs += [
                    "-P",
                    "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
                            project.buildDir.absolutePath + "/compose_metrics"
            ]
            freeCompilerArgs += [
                    "-P",
                    "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
                            project.buildDir.absolutePath + "/compose_metrics"
            ]
        }
    }
}