HostRuntime

Provides information about the runtime hosting the application.

Properties

Link copied to clipboard
abstract val name: String

The name of this runtime, which is used in string representations and for debugging purposes.

Link copied to clipboard
abstract val variant: String?

An optional variant name for this runtime. Some engines like GraalVM differentiate between runtime variants.

Link copied to clipboard
abstract val version: Version?

The version spec of this runtime, wrapped to allow version comparisons using regular operators.

Functions

Link copied to clipboard
inline fun <R> HostRuntime.on(version: Version, block: () -> R): R?

Execute a block and return its result if this runtime's is running the provided version, otherwise return null. If this runtime's version can't be detected, null will be returned.

inline fun <R> HostRuntime.on(range: Version.Range, block: () -> R): R?

Execute a block and return its result if this runtime's version is in the provided range, otherwise return null. If this runtime's version can't be detected, null will be returned.