All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlinx.jupyter.repl.creating.Providers.kt Maven / Gradle / Ivy

Go to download

Implementation of REPL compiler and preprocessor for Jupyter dialect of Kotlin (IDE-compatible)

There is a newer version: 0.12.0-333
Show newest version
package org.jetbrains.kotlinx.jupyter.repl.creating

import java.util.ServiceLoader

fun loadDefaultReplFactory(
    replComponentsProvider: ReplComponentsProvider,
    classLoader: ClassLoader = Thread.currentThread().contextClassLoader,
): ReplFactory {
    val factoryProviders = ServiceLoader.load(ReplFactoryProvider::class.java, classLoader).toList()
    require(factoryProviders.isNotEmpty()) {
        "No REPL factory providers are available on the current classpath"
    }

    val factoryProvider = factoryProviders.first()
    return factoryProvider.createReplFactory(replComponentsProvider)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy