|
|
@ -23,7 +23,6 @@ import org.gradle.kotlin.dsl.dependencies
|
|
|
|
import org.gradle.kotlin.dsl.getByType
|
|
|
|
import org.gradle.kotlin.dsl.getByType
|
|
|
|
import org.gradle.kotlin.dsl.withType
|
|
|
|
import org.gradle.kotlin.dsl.withType
|
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
import java.io.File
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Configure Compose-specific options
|
|
|
|
* Configure Compose-specific options
|
|
|
@ -59,9 +58,11 @@ internal fun Project.configureAndroidCompose(
|
|
|
|
private fun Project.buildComposeMetricsParameters(): List<String> {
|
|
|
|
private fun Project.buildComposeMetricsParameters(): List<String> {
|
|
|
|
val metricParameters = mutableListOf<String>()
|
|
|
|
val metricParameters = mutableListOf<String>()
|
|
|
|
val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics")
|
|
|
|
val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics")
|
|
|
|
|
|
|
|
val projectPath = project.path.replace(':', '_').drop(1)
|
|
|
|
|
|
|
|
|
|
|
|
val enableMetrics = (enableMetricsProvider.orNull == "true")
|
|
|
|
val enableMetrics = (enableMetricsProvider.orNull == "true")
|
|
|
|
if (enableMetrics) {
|
|
|
|
if (enableMetrics) {
|
|
|
|
val metricsFolder = rootProject.buildDir.resolve("compose-metrics")
|
|
|
|
val metricsFolder = rootProject.buildDir.resolve("compose-metrics/$projectPath")
|
|
|
|
metricParameters.add("-P")
|
|
|
|
metricParameters.add("-P")
|
|
|
|
metricParameters.add(
|
|
|
|
metricParameters.add(
|
|
|
|
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath
|
|
|
|
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath
|
|
|
@ -71,7 +72,7 @@ private fun Project.buildComposeMetricsParameters(): List<String> {
|
|
|
|
val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports")
|
|
|
|
val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports")
|
|
|
|
val enableReports = (enableReportsProvider.orNull == "true")
|
|
|
|
val enableReports = (enableReportsProvider.orNull == "true")
|
|
|
|
if (enableReports) {
|
|
|
|
if (enableReports) {
|
|
|
|
val reportsFolder = rootProject.buildDir.resolve("compose-reports")
|
|
|
|
val reportsFolder = rootProject.buildDir.resolve("compose-reports/$projectPath")
|
|
|
|
metricParameters.add("-P")
|
|
|
|
metricParameters.add("-P")
|
|
|
|
metricParameters.add(
|
|
|
|
metricParameters.add(
|
|
|
|
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath
|
|
|
|
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath
|
|
|
|