Skip to content

Commit ae44265

Browse files
committed
Init configurationMetrics parameter with a default value
#KTI-1611 Fixed (cherry picked from commit 3a2dd1b)
1 parent d0984cc commit ae44265

File tree

1 file changed

+2
-0
lines changed
  • libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics

1 file changed

+2
-0
lines changed

libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/BuildFusService.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ abstract class BuildFusService : BuildService<BuildFusService.Parameters>, AutoC
128128
})
129129
spec.parameters.useBuildFinishFlowAction.set(GradleVersion.current().baseVersion >= GradleVersion.version("8.1"))
130130
spec.parameters.buildStatisticsConfiguration.set(KotlinBuildStatsConfiguration(project))
131+
//init value to avoid `java.lang.IllegalStateException: GradleScopeServices has been closed` exception on close
132+
spec.parameters.configurationMetrics.add(MetricContainer())
131133
}.also { buildService ->
132134
//DO NOT call buildService.get() before all parameters.configurationMetrics are set.
133135
// buildService.get() call will cause parameters calculation and configuration cache storage.

0 commit comments

Comments
 (0)