diff --git a/README.md b/README.md index cb97c2a6b..ae8c3b3aa 100644 --- a/README.md +++ b/README.md @@ -159,8 +159,8 @@ Run the following command to get and analyse compose compiler metrics: ./gradlew assembleRelease -PenableComposeCompilerMetrics=true -PenableComposeCompilerReports=true ``` -The reports files will be added to build/compose-reports in root folder. The metrics files will also be -added to build/compose-metrics in root folder. +The reports files will be added to [build/compose-reports](build/compose-reports). The metrics files will also be +added to [build/compose-metrics](build/compose-metrics). For more information on Compose compiler metrics, see [this blog post](https://medium.com/androiddevelopers/jetpack-compose-stability-explained-79c10db270c8). diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidCompose.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidCompose.kt index ebf82b970..393c68535 100644 --- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidCompose.kt +++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidCompose.kt @@ -61,7 +61,7 @@ private fun Project.buildComposeMetricsParameters(): List { val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics") val enableMetrics = (enableMetricsProvider.orNull == "true") if (enableMetrics) { - val metricsFolder = File(project.rootProject.buildDir, "compose-metrics") + val metricsFolder = rootProject.buildDir.resolve("compose-metrics") metricParameters.add("-P") metricParameters.add( "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath @@ -71,7 +71,7 @@ private fun Project.buildComposeMetricsParameters(): List { val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports") val enableReports = (enableReportsProvider.orNull == "true") if (enableReports) { - val reportsFolder = File(project.rootProject.buildDir, "compose-reports") + val reportsFolder = rootProject.buildDir.resolve("compose-reports") metricParameters.add("-P") metricParameters.add( "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath