From d549ca6c7a4fdb12366c87a565a01e3b4c76439d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mlynari=C4=8D?= Date: Fri, 26 May 2023 16:15:05 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Simon Marquis --- README.md | 4 ++-- .../com/google/samples/apps/nowinandroid/AndroidCompose.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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