Skip to content

Commit

Permalink
Implemented collecting use-old-backend flag from Gradle
Browse files Browse the repository at this point in the history
#KT-46689 Fixed
  • Loading branch information
ausatiy authored and erokhins committed May 19, 2021
1 parent 0505d58 commit b3134c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class KotlinGradleFUSLogger : StartupActivity, DumbAware, Runnable {
BooleanMetrics.ENABLED_COMPILER_PLUGIN_JPA_SUPPORT,
BooleanMetrics.ENABLED_COMPILER_PLUGIN_SAM_WITH_RECEIVER,
BooleanMetrics.JVM_COMPILER_IR_MODE,
StringMetrics.JVM_DEFAULTS
StringMetrics.JVM_DEFAULTS,
StringMetrics.USE_OLD_BACKEND
)

container.log(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,13 @@ internal open class GradleCompilerRunner(protected val taskProvider: GradleCompi
// compiler would report metrics by itself via JMX
KotlinBuildStatsService.applyIfInitialised {
if (compilerArgs is K2JVMCompilerArguments) {
val args = K2JVMCompilerArguments()
parseCommandLineArguments(argsArray.toList(), args)
KotlinBuildStatsService.getInstance()?.report(BooleanMetrics.JVM_COMPILER_IR_MODE, args.useIR)
KotlinBuildStatsService.getInstance()?.report(StringMetrics.JVM_DEFAULTS, args.jvmDefault)
KotlinBuildStatsService.getInstance()?.apply {
val args = K2JVMCompilerArguments()
parseCommandLineArguments(argsArray.toList(), args)
report(BooleanMetrics.JVM_COMPILER_IR_MODE, args.useIR)
report(StringMetrics.JVM_DEFAULTS, args.jvmDefault)
report(StringMetrics.USE_OLD_BACKEND, args.useOldBackend.toString())
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ enum class StringMetrics(val type: StringOverridePolicy, val anonymization: Stri

// Compiler parameters
JVM_DEFAULTS(CONCAT, SAFE),
USE_OLD_BACKEND(CONCAT, SAFE)

}

0 comments on commit b3134c0

Please sign in to comment.