Add project path subfolder

Change-Id: I1b680a37ecbd80b894b0d1b649633936cbe41328
pull/754/head
Tomáš Mlynarič 2 years ago
parent d549ca6c7a
commit f577fb06cc

@ -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

Loading…
Cancel
Save