Make paths relative

Change-Id: Iefdf9b2a0313bbdc0532450bb10ca9b7cca41014
pull/754/head
Tomáš Mlynarič 2 years ago
parent f577fb06cc
commit 375480a2f9

@ -58,11 +58,11 @@ internal fun Project.configureAndroidCompose(
private fun Project.buildComposeMetricsParameters(): List<String> {
val metricParameters = mutableListOf<String>()
val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics")
val projectPath = project.path.replace(':', '_').drop(1)
val relativePath = projectDir.relativeTo(rootDir)
val enableMetrics = (enableMetricsProvider.orNull == "true")
if (enableMetrics) {
val metricsFolder = rootProject.buildDir.resolve("compose-metrics/$projectPath")
val metricsFolder = rootProject.buildDir.resolve("compose-metrics").resolve(relativePath)
metricParameters.add("-P")
metricParameters.add(
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath
@ -72,7 +72,7 @@ private fun Project.buildComposeMetricsParameters(): List<String> {
val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports")
val enableReports = (enableReportsProvider.orNull == "true")
if (enableReports) {
val reportsFolder = rootProject.buildDir.resolve("compose-reports/$projectPath")
val reportsFolder = rootProject.buildDir.resolve("compose-reports").resolve(relativePath)
metricParameters.add("-P")
metricParameters.add(
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath

Loading…
Cancel
Save