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

org.jetbrains.kotlinx.jupyter.libraries.LibraryInfoCacheImpl.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.libraries

import org.jetbrains.kotlinx.jupyter.common.LibraryDescriptorsManager
import org.jetbrains.kotlinx.jupyter.util.createCachedFun

class LibraryInfoCacheImpl(
    private val libraryDescriptorsManager: LibraryDescriptorsManager,
) : LibraryInfoCache {
    override fun getLibraryInfoByRef(reference: String): AbstractLibraryResolutionInfo.ByGitRef {
        return infoByRef(reference)
    }

    override fun getLibraryInfoByRefWithFallback(reference: String): AbstractLibraryResolutionInfo.ByGitRefWithClasspathFallback {
        return infoByRefWithFallback(reference)
    }

    private val infoByRef =
        createCachedFun { ref: String ->
            AbstractLibraryResolutionInfo.ByGitRef(ref, libraryDescriptorsManager)
        }

    private val infoByRefWithFallback =
        createCachedFun { ref: String ->
            AbstractLibraryResolutionInfo.ByGitRefWithClasspathFallback(ref, libraryDescriptorsManager)
        }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy