diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/BuildFusService.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/BuildFusService.kt index c6defd3489802..c3c60aa9601ef 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/BuildFusService.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/BuildFusService.kt @@ -95,8 +95,6 @@ abstract class BuildFusService : BuildService, AutoC val isConfigurationCacheRequested = project.isConfigurationCacheRequested val isProjectIsolationRequested = project.isProjectIsolationRequested - ProjectConfigurationFusService.registerIfAbsent(project) - project.gradle.sharedServices.registrations.findByName(serviceName)?.let { @Suppress("UNCHECKED_CAST") return (it.service as Provider) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/FinalizeConfigurationFusMetricAction.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/FinalizeConfigurationFusMetricAction.kt index 239d866cfbb96..a6b6f146be80e 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/FinalizeConfigurationFusMetricAction.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/FinalizeConfigurationFusMetricAction.kt @@ -13,17 +13,9 @@ import org.jetbrains.kotlin.gradle.plugin.await internal val FinalizeConfigurationFusMetricAction = KotlinProjectSetupCoroutine { KotlinPluginLifecycle.Stage.ReadyForExecution.await() - val projectConfigurationService = - project.gradle.sharedServices.registrations.findByName(ProjectConfigurationFusService.getServiceName(project))?.also { - val parameters = it.parameters as ProjectConfigurationFusService.Parameters - parameters.configurationMetrics.finalizeValue() - } - project.gradle.sharedServices.registrations.findByName(BuildFusService.serviceName)?.also { val parameters = it.parameters as BuildFusService.Parameters parameters.generalConfigurationMetrics.finalizeValue() - projectConfigurationService?.service?.orNull?.also { - parameters.configurationMetrics.add((it.parameters as ProjectConfigurationFusService.Parameters).configurationMetrics) - } + parameters.configurationMetrics.add(KotlinProjectConfigurationMetrics.collectMetrics(project)) } } \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/ProjectConfigurationFusService.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/ProjectConfigurationFusService.kt deleted file mode 100644 index 8517fcd55479f..0000000000000 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/statistics/ProjectConfigurationFusService.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.gradle.plugin.statistics - -import org.gradle.api.Project -import org.gradle.api.provider.Property -import org.gradle.api.provider.Provider -import org.gradle.api.services.BuildService -import org.gradle.api.services.BuildServiceParameters - -abstract class ProjectConfigurationFusService : BuildService, AutoCloseable { - interface Parameters : BuildServiceParameters { - val configurationMetrics: Property - } - - companion object { - fun getServiceName(project: Project): String = - "${project.path}_${ProjectConfigurationFusService::class.simpleName}_${ProjectConfigurationFusService::class.java.classLoader.hashCode()}" - - //register a new service for every project to collect configuration metrics - fun registerIfAbsent(project: Project): Provider { - return project.gradle.sharedServices.registerIfAbsent( - getServiceName(project), - ProjectConfigurationFusService::class.java - ) { spec -> - spec.parameters.configurationMetrics.set(project.provider { - KotlinProjectConfigurationMetrics.collectMetrics(project) - }) - } - } - } - - override fun close() { - } -} \ No newline at end of file