Skip to main content

Gradle plugin

While optional, the Hyperdrive Gradle plugin does all the legwork of generating the IR necessary to make multiplatform as seamless as it can be.

Simply add the following code to the appropriate files:

pluginManagement {    plugins {        id("org.brightify.hyperdrive") version "0.1.80"    }}
plugins {    id("org.brightify.hyperdrive")}
hyperdrive {    // MultiplatformX    multiplatformx()
    // kRPC    krpc()}

This is enough to automatically run the Hyperdrive IR generator with sensible defaults. Find out how to customize the setup here.


The default values are as follows:

hyperdrive {    multiplatformx {        // Generate `Factory.create` methods for classes annotated `@AutoFactory`.        isAutoFactoryEnabled = true
        // Generate accessors for Hyperdrive observable properties in classes annotated `@ViewModel`.        isViewModelEnabled = true
        // Modify `@Composable` functions' IR to automatically observe `BaseViewModel` without the need for `collectAsState()`.        isComposableAutoObserveEnabled = true    }
    krpc {        // For debugging purposes.        printIR = false        printKotlinLike = false    }}