Add js generate externals collecting statistics
#KT-39995 Fixed
This commit is contained in:
committed by
Andrey Uskov
parent
6f03e42ef7
commit
405e271b68
@@ -35,6 +35,7 @@ enum class GradleStatisticsEvents {
|
||||
Kapt,
|
||||
CompilerPlugins,
|
||||
MPP,
|
||||
JS,
|
||||
Libraries,
|
||||
GradleConfiguration,
|
||||
ComponentVersions,
|
||||
|
||||
@@ -99,6 +99,11 @@ class KotlinGradleFUSLogger : StartupActivity, DumbAware, Runnable {
|
||||
StringMetrics.JVM_DEFAULTS
|
||||
)
|
||||
|
||||
container.log(
|
||||
GradleStatisticsEvents.JS,
|
||||
BooleanMetrics.JS_GENERATE_EXTERNALS
|
||||
)
|
||||
|
||||
container.log(
|
||||
GradleStatisticsEvents.MPP,
|
||||
StringMetrics.MPP_PLATFORMS,
|
||||
|
||||
+6
@@ -5,10 +5,12 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.js.dukat
|
||||
|
||||
import org.jetbrains.kotlin.gradle.plugin.statistics.KotlinBuildStatsService
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.NpmDependency
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.NpmDependency.Scope.NORMAL
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.NpmDependency.Scope.OPTIONAL
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.NpmProject
|
||||
import org.jetbrains.kotlin.statistics.metrics.BooleanMetrics
|
||||
import java.io.File
|
||||
|
||||
class DtsResolver(val npmProject: NpmProject) {
|
||||
@@ -22,6 +24,7 @@ class DtsResolver(val npmProject: NpmProject) {
|
||||
externalNpmDependencies: Collection<NpmDependency>,
|
||||
considerGeneratingFlag: Boolean = true
|
||||
): List<Dts> {
|
||||
val buildStatsService = KotlinBuildStatsService.getInstance()
|
||||
return externalNpmDependencies
|
||||
.asSequence()
|
||||
.filter { !considerGeneratingFlag || it.generateExternals }
|
||||
@@ -31,6 +34,9 @@ class DtsResolver(val npmProject: NpmProject) {
|
||||
}
|
||||
.sortedBy { it.inputKey }
|
||||
.toList()
|
||||
.also {
|
||||
buildStatsService?.report(BooleanMetrics.JS_GENERATE_EXTERNALS, it.isNotEmpty())
|
||||
}
|
||||
}
|
||||
|
||||
private fun getDtsFromDependency(
|
||||
|
||||
+2
@@ -38,6 +38,8 @@ enum class BooleanMetrics(val type: BooleanOverridePolicy, val anonymization: Bo
|
||||
KOTLIN_KTS_USED(OR, SAFE),
|
||||
JVM_COMPILER_IR_MODE(OR, SAFE),
|
||||
|
||||
JS_GENERATE_EXTERNALS(OR, SAFE),
|
||||
|
||||
// User scenarios
|
||||
DEBUGGER_ENABLED(OVERRIDE, SAFE),
|
||||
COMPILATION_STARTED(OVERRIDE, SAFE),
|
||||
|
||||
Reference in New Issue
Block a user