commonMain.co.touchlab.skie.analytics.environment.CompilerEnvironmentAnalytics.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-compiler-linker-plugin-kgp_2.1.0 Show documentation
Show all versions of kotlin-compiler-linker-plugin-kgp_2.1.0 Show documentation
Kotlin compiler plugin that improves Swift interface of a Kotlin Multiplatform framework.
@file:Suppress("invisible_reference", "invisible_member")
package co.touchlab.skie.analytics.environment
import co.touchlab.skie.configuration.SkieConfigurationFlag
import co.touchlab.skie.plugin.analytics.AnalyticsProducer
import co.touchlab.skie.util.toPrettyJson
import kotlinx.serialization.Serializable
import org.jetbrains.kotlin.backend.konan.KonanConfig
import org.jetbrains.kotlin.konan.target.Xcode
@Serializable
data class CompilerEnvironmentAnalytics(
val jvmVersion: String,
val compilerVersion: String?,
val xcodeVersion: String,
val availableProcessors: Int,
val maxJvmMemory: Long,
) {
class Producer(private val konanConfig: KonanConfig) : AnalyticsProducer {
override val name: String = "compiler-environment"
override val configurationFlag: SkieConfigurationFlag = SkieConfigurationFlag.Analytics_CompilerEnvironment
// Xcode.findCurrent().version.toString() is not redundant because from 1.9.20 the version is not a String
@Suppress("RemoveRedundantCallsOfConversionMethods")
override fun produce(): String =
CompilerEnvironmentAnalytics(
jvmVersion = Runtime.version().toString(),
compilerVersion = konanConfig.distribution.compilerVersion,
xcodeVersion = Xcode.findCurrent().version.toString(),
availableProcessors = Runtime.getRuntime().availableProcessors(),
maxJvmMemory = Runtime.getRuntime().maxMemory(),
).toPrettyJson()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy