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

kotlin.script.experimental.jvm.compat.expectedLocationUtil.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-RC2
Show newest version
/*
 * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
 * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
 */

@file:Suppress("DEPRECATION")

package kotlin.script.experimental.jvm.compat

import kotlin.script.experimental.api.ScriptAcceptedLocation
import kotlin.script.experimental.location.ScriptExpectedLocation

fun List.mapToLegacyExpectedLocations(): List = map {
    when (it) {
        ScriptAcceptedLocation.Sources -> ScriptExpectedLocation.SourcesOnly
        ScriptAcceptedLocation.Tests -> ScriptExpectedLocation.TestsOnly
        ScriptAcceptedLocation.Libraries -> ScriptExpectedLocation.Libraries
        ScriptAcceptedLocation.Project -> ScriptExpectedLocation.Project
        ScriptAcceptedLocation.Everywhere -> ScriptExpectedLocation.Everywhere
    }
}

fun List.mapLegacyExpectedLocations(): List = map {
    when (it) {
        ScriptExpectedLocation.SourcesOnly -> ScriptAcceptedLocation.Sources
        ScriptExpectedLocation.TestsOnly -> ScriptAcceptedLocation.Tests
        ScriptExpectedLocation.Libraries -> ScriptAcceptedLocation.Libraries
        ScriptExpectedLocation.Project -> ScriptAcceptedLocation.Project
        ScriptExpectedLocation.Everywhere -> ScriptAcceptedLocation.Everywhere
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy