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

org.jetbrains.kotlin.library.UnresolvedLibrary.kt Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
@file:Suppress("FunctionName")

package org.jetbrains.kotlin.library

fun UnresolvedLibrary(path: String, libraryVersion: String?): RequiredUnresolvedLibrary =
    RequiredUnresolvedLibrary(path, libraryVersion)

fun UnresolvedLibrary(path: String, libraryVersion: String?, lenient: Boolean): UnresolvedLibrary =
    if (lenient) LenientUnresolvedLibrary(path, libraryVersion) else RequiredUnresolvedLibrary(path, libraryVersion)

sealed class UnresolvedLibrary {
    abstract val path: String
    abstract val libraryVersion: String?
    abstract fun substitutePath(newPath: String): UnresolvedLibrary
}

data class RequiredUnresolvedLibrary(
    override val path: String,
    override val libraryVersion: String?
) : UnresolvedLibrary() {
    override fun substitutePath(newPath: String): RequiredUnresolvedLibrary {
        return copy(path = newPath)
    }
}

data class LenientUnresolvedLibrary(
    override val path: String,
    override val libraryVersion: String?
) : UnresolvedLibrary() {
    override fun substitutePath(newPath: String): LenientUnresolvedLibrary {
        return copy(path = newPath)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy