added lists of possible values for buildSystemTarget collectors
This commit is contained in:
@@ -5,12 +5,16 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.statistics
|
package org.jetbrains.kotlin.idea.statistics
|
||||||
|
|
||||||
// Note: along with adding a group to this enum you should also add its GROUP_ID to plugin.xml and get it whitelisted
|
/* Note: along with adding a group to this enum you should also add its GROUP_ID to plugin.xml and get it whitelisted
|
||||||
// (see https://confluence.jetbrains.com/display/FUS/IntelliJ+Reporting+API).
|
* (see https://confluence.jetbrains.com/display/FUS/IntelliJ+Reporting+API).
|
||||||
enum class FUSEventGroups(groupIdSuffix: String) {
|
*
|
||||||
GradleTarget("gradle.target"),
|
* Default value for [events] parameter is intended for collectors which don't have yet a set of allowed values for FUS Whitelist
|
||||||
MavenTarget("maven.target"),
|
*/
|
||||||
JPSTarget("jps.target"),
|
enum class FUSEventGroups(groupIdSuffix: String, val events: Set<String> = hashSetOf()) {
|
||||||
|
|
||||||
|
GradleTarget("gradle.target", gradleTargetEvents),
|
||||||
|
MavenTarget("maven.target", mavenTargetEvents),
|
||||||
|
JPSTarget("jps.target", JPSTargetEvents),
|
||||||
Refactoring("ide.action.refactoring"),
|
Refactoring("ide.action.refactoring"),
|
||||||
NewFileTemplate("ide.newFileTempl"),
|
NewFileTemplate("ide.newFileTempl"),
|
||||||
NPWizards("ide.npwizards"),
|
NPWizards("ide.npwizards"),
|
||||||
@@ -18,3 +22,46 @@ enum class FUSEventGroups(groupIdSuffix: String) {
|
|||||||
|
|
||||||
val GROUP_ID: String = "kotlin.$groupIdSuffix"
|
val GROUP_ID: String = "kotlin.$groupIdSuffix"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val gradleTargetEvents = hashSetOf(
|
||||||
|
"kotlin-android",
|
||||||
|
"kotlin-platform-common",
|
||||||
|
"kotlin-platform-js",
|
||||||
|
"kotlin-platform-jvm",
|
||||||
|
"MPP.androidJvm",
|
||||||
|
"MPP.androidJvm.android",
|
||||||
|
"MPP.common",
|
||||||
|
"MPP.common.metadata",
|
||||||
|
"MPP.js",
|
||||||
|
"MPP.js.js",
|
||||||
|
"MPP.jvm",
|
||||||
|
"MPP.jvm.jvm",
|
||||||
|
"MPP.jvm.jvmWithJava",
|
||||||
|
"MPP.native",
|
||||||
|
"MPP.native.androidNativeArm32",
|
||||||
|
"MPP.native.androidNativeArm64",
|
||||||
|
"MPP.native.iosArm32",
|
||||||
|
"MPP.native.iosArm64",
|
||||||
|
"MPP.native.iosX64",
|
||||||
|
"MPP.native.linuxArm32Hfp",
|
||||||
|
"MPP.native.linuxArm64",
|
||||||
|
"MPP.native.linuxMips32",
|
||||||
|
"MPP.native.linuxMipsel32",
|
||||||
|
"MPP.native.linuxX64",
|
||||||
|
"MPP.native.macosX64",
|
||||||
|
"MPP.native.mingwX64",
|
||||||
|
"MPP.native.mingwX86",
|
||||||
|
"MPP.native.wasm32",
|
||||||
|
"MPP.native.zephyrStm32f4Disco"
|
||||||
|
)
|
||||||
|
val mavenTargetEvents = hashSetOf(
|
||||||
|
"common",
|
||||||
|
"js",
|
||||||
|
"jvm"
|
||||||
|
)
|
||||||
|
val JPSTargetEvents = hashSetOf(
|
||||||
|
"common",
|
||||||
|
"js",
|
||||||
|
"jvm",
|
||||||
|
"native"
|
||||||
|
)
|
||||||
@@ -14,9 +14,15 @@ open class KotlinFUSLogger {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val context = FeatureUsageData().addData("plugin_version", KotlinPluginUtil.getPluginVersion())
|
private val context = FeatureUsageData().addData("plugin_version", KotlinPluginUtil.getPluginVersion())
|
||||||
|
private val logger = FUCounterUsageLogger.getInstance()
|
||||||
|
|
||||||
fun log(group: FUSEventGroups, event: String) {
|
fun log(group: FUSEventGroups, event: String) {
|
||||||
FUCounterUsageLogger.getInstance().logEvent(group.GROUP_ID, event, context)
|
if (group.events.contains(event)) {
|
||||||
|
logger.logEvent(group.GROUP_ID, event, context)
|
||||||
|
} else {
|
||||||
|
logger.logEvent(group.GROUP_ID, "unknown", context)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun log(group: FUSEventGroups, event: String, eventData: Map<String, String>) {
|
fun log(group: FUSEventGroups, event: String, eventData: Map<String, String>) {
|
||||||
@@ -24,7 +30,7 @@ open class KotlinFUSLogger {
|
|||||||
for (entry in eventData) {
|
for (entry in eventData) {
|
||||||
localContext.addData(entry.key, entry.value)
|
localContext.addData(entry.key, entry.value)
|
||||||
}
|
}
|
||||||
FUCounterUsageLogger.getInstance().logEvent(group.GROUP_ID, event, localContext)
|
logger.logEvent(group.GROUP_ID, event, localContext)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-4
@@ -223,10 +223,9 @@ class KotlinGradleProjectResolverExtension : AbstractProjectResolverExtension()
|
|||||||
ideModule.coroutines = gradleModel.coroutines
|
ideModule.coroutines = gradleModel.coroutines
|
||||||
ideModule.platformPluginId = gradleModel.platformPluginId
|
ideModule.platformPluginId = gradleModel.platformPluginId
|
||||||
|
|
||||||
KotlinFUSLogger.log(
|
if (gradleModel.hasKotlinPlugin) {
|
||||||
FUSEventGroups.GradleTarget,
|
KotlinFUSLogger.log(FUSEventGroups.GradleTarget, gradleModel.kotlinTarget ?: "unknown")
|
||||||
gradleModel.kotlinTarget ?: "unknown"
|
}
|
||||||
)
|
|
||||||
|
|
||||||
addImplementedModuleNames(gradleModule, ideModule, ideProject, gradleModel)
|
addImplementedModuleNames(gradleModule, ideModule, ideProject, gradleModel)
|
||||||
|
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
|||||||
</extensions>
|
</extensions>
|
||||||
|
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.gradle.target" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.gradle.target" version="2"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.maven.target" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.maven.target" version="2"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.jps.target" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.jps.target" version="2"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.gradle.library" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.gradle.library" version="1"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.ide.action.refactoring" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.ide.action.refactoring" version="1"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.ide.newFileTempl" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.ide.newFileTempl" version="1"/>
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
|||||||
</extensions>
|
</extensions>
|
||||||
|
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.gradle.target" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.gradle.target" version="2"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.maven.target" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.maven.target" version="2"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.jps.target" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.jps.target" version="2"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.gradle.library" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.gradle.library" version="1"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.ide.action.refactoring" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.ide.action.refactoring" version="1"/>
|
||||||
<statistics.counterUsagesCollector groupId="kotlin.ide.newFileTempl" version="1"/>
|
<statistics.counterUsagesCollector groupId="kotlin.ide.newFileTempl" version="1"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user