Skip to content

Commit 6c9d75d

Browse files
author
Andrey
authored
Merge pull request #125 from KovalevAndrey/add-build-param-to-generate-report
Added parameter to generate jetpack compose compiler report
2 parents 6aceb95 + 9087478 commit 6c9d75d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

build.gradle.kts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
13
buildscript {
24
repositories {
35
google()
@@ -27,3 +29,23 @@ allprojects {
2729
}
2830
}
2931
}
32+
33+
subprojects {
34+
tasks.withType<KotlinCompile>().configureEach {
35+
kotlinOptions {
36+
if (project.findProperty("enableComposeCompilerReports") == "true") {
37+
freeCompilerArgs += listOf(
38+
"-P",
39+
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
40+
File(project.buildDir, "compose_metrics").absolutePath
41+
42+
)
43+
freeCompilerArgs += listOf(
44+
"-P",
45+
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
46+
File(project.buildDir, "compose_metrics").absolutePath
47+
)
48+
}
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)