jayaSuryaT
04/18/2023, 9:38 AMKotlinCompile.kotlinOptions.freeCompilerArgs
via CLI, when executing a gradle task?
Context : I have my Android project’s root gradle file configured as bellow, this is to be able to generate Jetpack Compose compiler metrics.
subprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
if (project.findProperty("enableComposeReports") == "true") {
freeCompilerArgs += ["-P", "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + rootProject.buildDir.absolutePath + "/compose_metrics/"]
}
}
}
}
So, instead of setting this up in gradle
, can I pass these freeCompilerArgs
via CLI when executing a gradle task itself?
Something like this (this is just an example):
./gradlew assembleRelease -Pkotlin.compiler.arguments="plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=<path>"
Vampire
04/18/2023, 9:47 AMjayaSuryaT
04/19/2023, 4:50 AMjayaSuryaT
04/27/2023, 3:59 PM